I am still a beginner of Python programming, i have tried to use Flask and Pyscript to deploy my program but none of these methods work for me and these methods are quite complicated for a beginner like me.
Thanks for any help from sifus here.
Python how to share my Python program with friend?, without let them see the codes inside?
|
|
Apr 26 2023, 10:54 AM, updated 3y ago
Show posts by this member only | Post
#1
|
![]() ![]() ![]() ![]() ![]()
Junior Member
788 posts Joined: Nov 2007 |
Hi guys, recently i just started to learn Python and successfully created a simple little program. Now i would like to deploy and share this little program with my friends to let them play with it, but i don't want to let them see the codes i writing inside the program. Is there any simple way to accomplish this?
I am still a beginner of Python programming, i have tried to use Flask and Pyscript to deploy my program but none of these methods work for me and these methods are quite complicated for a beginner like me. Thanks for any help from sifus here. |
|
|
|
|
|
Apr 26 2023, 10:57 AM
Show posts by this member only | Post
#2
|
![]() ![]() ![]() ![]() ![]() ![]() ![]()
Senior Member
6,270 posts Joined: Jul 2005 From: UEP Subang Jaya |
QUOTE(adam_lew85 @ Apr 26 2023, 10:54 AM) Hi guys, recently i just started to learn Python and successfully created a simple little program. Now i would like to deploy and share this little program with my friends to let them play with it, but i don't want to let them see the codes i writing inside the program. Is there any simple way to accomplish this? The term you are looking to google is obfuscation.I am still a beginner of Python programming, i have tried to use Flask and Pyscript to deploy my program but none of these methods work for me and these methods are quite complicated for a beginner like me. Thanks for any help from sifus here. If you're using python, generally the expectation is that your code is openly readable. You can package it to an exe which most 'normal' users can only read, but that's not fool proof (depending on who your friends are this is probably good enough). guysmiley liked this post
|
|
|
Apr 26 2023, 11:03 AM
Show posts by this member only | Post
#3
|
![]() ![]() ![]()
Junior Member
401 posts Joined: Jan 2003 |
Your little python program is web based? Since you mentioned Flask and Pyscript.
Another rather popular option is Pyarmor. |
|
|
Apr 26 2023, 11:08 AM
Show posts by this member only | Post
#4
|
![]() ![]() ![]() ![]() ![]()
Junior Member
944 posts Joined: Jul 2005 |
maybe can try compile to .exe via pyinstaller
|
|
|
Apr 26 2023, 03:20 PM
Show posts by this member only | Post
#5
|
![]() ![]() ![]() ![]() ![]()
Junior Member
788 posts Joined: Nov 2007 |
QUOTE(LostAndFound @ Apr 26 2023, 10:57 AM) The term you are looking to google is obfuscation. If you're using python, generally the expectation is that your code is openly readable. You can package it to an exe which most 'normal' users can only read, but that's not fool proof (depending on who your friends are this is probably good enough). QUOTE(junyian @ Apr 26 2023, 11:03 AM) Your little python program is web based? Since you mentioned Flask and Pyscript. Another rather popular option is Pyarmor. QUOTE(soul78 @ Apr 26 2023, 11:08 AM) obfuscation process seems complicated, what i want is just to hide those codes i put inside the programcurrently my python program only can work in terminal and repit, i am thinking how to share the program with my friends for them to play with it? maybe make it into web-based is the best option? if use the pyinstaller to make it into exe, can it be opened in our smartphone directly? |
|
|
Apr 26 2023, 03:59 PM
Show posts by this member only | Post
#6
|
![]() ![]() ![]() ![]() ![]()
Junior Member
788 posts Joined: Nov 2007 |
|
|
|
|
|
|
Apr 26 2023, 07:00 PM
Show posts by this member only | IPv6 | Post
#7
|
![]() ![]()
Validating
163 posts Joined: Apr 2020 |
|
|
|
Apr 26 2023, 08:27 PM
Show posts by this member only | IPv6 | Post
#8
|
![]() ![]() ![]()
Junior Member
423 posts Joined: Apr 2022 |
create a cmd file
hide your script in many layers of folder then in the cmd file put , cd <directory> , then python <your script name>.py <whatever variables> looool This post has been edited by 15cm: Apr 26 2023, 08:29 PM |
|
|
Apr 26 2023, 08:30 PM
Show posts by this member only | IPv6 | Post
#9
|
![]() ![]() ![]() ![]() ![]() ![]()
Senior Member
1,050 posts Joined: Jan 2016 From: Land of floods, Kota Tinggi |
You can compile to .pyc file. Look up Python bytecode.
|
|
|
Apr 26 2023, 09:48 PM
Show posts by this member only | IPv6 | Post
#10
|
![]() ![]() ![]() ![]() ![]()
Junior Member
788 posts Joined: Nov 2007 |
QUOTE(15cm @ Apr 26 2023, 08:27 PM) create a cmd file I am writing my code in Notepad and save as .py file. How to hide the code in layers of folder? hide your script in many layers of folder then in the cmd file put , cd <directory> , then python <your script name>.py <whatever variables> looool Can teach me how to create a cmd file? As long as they can open my program on their smartphone then is OK ady. |
|
|
Apr 26 2023, 09:49 PM
Show posts by this member only | IPv6 | Post
#11
|
![]() ![]() ![]() ![]() ![]()
Junior Member
788 posts Joined: Nov 2007 |
|
|
|
Apr 26 2023, 09:52 PM
Show posts by this member only | IPv6 | Post
#12
|
![]() ![]() ![]() ![]() ![]()
Junior Member
788 posts Joined: Nov 2007 |
|
|
|
Apr 26 2023, 10:09 PM
Show posts by this member only | IPv6 | Post
#13
|
![]() ![]() ![]()
Junior Member
423 posts Joined: Apr 2022 |
QUOTE(adam_lew85 @ Apr 26 2023, 09:48 PM) I am writing my code in Notepad and save as .py file. How to hide the code in layers of folder? its a joke looolCan teach me how to create a cmd file? As long as they can open my program on their smartphone then is OK ady. wait you want to convert your python script into smartphone app? |
|
|
|
|
|
Apr 26 2023, 11:47 PM
|
![]() ![]() ![]() ![]() ![]()
Junior Member
788 posts Joined: Nov 2007 |
|
|
|
Apr 27 2023, 02:05 AM
Show posts by this member only | IPv6 | Post
#15
|
![]() ![]()
Validating
163 posts Joined: Apr 2020 |
Use Oxyry (https://pyob.oxyry.com/)?
You can then paste it on Online Python Compiler and share the link with your friends. It can work in web browser on phone or PC. |
|
|
Apr 27 2023, 09:52 AM
|
![]() ![]() ![]() ![]() ![]()
Junior Member
788 posts Joined: Nov 2007 |
|
|
|
Apr 27 2023, 10:02 AM
|
![]() ![]() ![]() ![]() ![]()
Junior Member
788 posts Joined: Nov 2007 |
QUOTE(Tullamarine @ Apr 27 2023, 02:05 AM) Use Oxyry (https://pyob.oxyry.com/)? I googled and all of the online compiler is to share the code to friend, actually i don't want to share the code, i just want to share the program only, which means my friend just only need to tap on the app or exe file then can run it immediately. You can then paste it on Online Python Compiler and share the link with your friends. It can work in web browser on phone or PC. Thanks anyway for your sharing This post has been edited by adam_lew85: Apr 27 2023, 10:03 AM |
|
|
Apr 27 2023, 11:19 AM
|
![]() ![]() ![]()
Junior Member
401 posts Joined: Jan 2003 |
You have more options if it's for PC. If it's for smartphone, you have a lot more work to do.
Since you want this as an EXE (which means Windows only on PC), then pyinstaller (suggested by @soul78) would be the best option. |
|
|
Apr 27 2023, 12:59 PM
Show posts by this member only | IPv6 | Post
#19
|
![]() ![]() ![]() ![]() ![]() ![]()
Senior Member
1,050 posts Joined: Jan 2016 From: Land of floods, Kota Tinggi |
QUOTE(adam_lew85 @ Apr 26 2023, 09:52 PM) Can this pyc file run on smartphone? My priority is to let the end user easily run my program on their smartphone Short answer is yes. Do you have what in mind on how to run Python on smartphone? Do your program need GUI?The generated .pyc file should work across architectures, meaning .pyc generated by x86_64 Windows Python should work when running on arm64 Linux Python. Of course you still need to install Python to work. Also I only tested simple hello world so far... This post has been edited by TruboXL: Apr 27 2023, 01:00 PM |
|
|
Apr 27 2023, 06:06 PM
Show posts by this member only | IPv6 | Post
#20
|
![]() ![]() ![]()
Junior Member
423 posts Joined: Apr 2022 |
QUOTE(adam_lew85 @ Apr 26 2023, 11:47 PM) ya can we convert the script into smartphone app? there are several projects set up for these kind of requirement , however, none of those took off.... or any other simple way to share my program with others and let them play it directly on their smartphone python kivy is what you are looking for there are probably others, but very very few people use python to build mobile apps. its just not native. ----------------------- side note : it is possible to run python script on android, just install pydroid 3. but your python script wont be a standalone app so your friend can see your script content. This post has been edited by 15cm: Apr 27 2023, 06:07 PM |
| Change to: | 0.0199sec
0.72
5 queries
GZIP Disabled
Time is now: 24th December 2025 - 05:16 PM |