I have many python modules for my project. And I need to put those all on the server so that they will automatically run every week.
so now I am thinking about how I can move all those modules to the server. Should I package it up or should I make them into the exe file to be installed?. I do not make the GUI so I think might exe is not a good choice. but I am open to all suggestion because now I do not know exactly what I should do.
Related
I have created python desktop software. Now I want to market that as a product. But my problem is, anyone can decompile my exe file and they will get the actual code.
So is there any way to encrypt my code and convert it to exe before deployment. I have tried different ways.
But nothing is working. Is there any way to do that?.Thanks in advance
This link has most of the info you need.
But since links are discouraged here:
There is py2exe, which compiles your code into an .exe file, but afaik it's not difficult to reverse-engineer the code from the exe file.
You can of course make your code more difficult to understand. Rename your classes, functions to be non-sensical (e.g. rename print(s) to delete(s) or to a()) people will have a difficult time then.
You can also avoid all of that by using SaaS (Software as a Service), where you can host your code online on a server and get paid by people using it.
Or consider open-sourcing it :)
You can install pyinstaller per pip install pyinstaller (make sure to also add it to your environment variables) and then open shell in the folder where your file is (shift+right-click somewhere where no file is and "open PowerShell here") and the do "pyinstaller --onefile YOUR_FILE".
If there will be created a dist folder, take out the exe file and delete the build folder and the .spec I think it is.
And there you go with your standalone exe File.
I recently made a simple little game using python since I'm just learning programming and computer science. I was successful in making the game and converting it into an executable file using cx freeze. The problem now is that I can't run the application unless it is in the same folder with all the other components of the file (naturally). I was wondering how I would make a desktop application of my game without having to go into the folder in which the application was located in. Its really inconvenient to send entire folders to people so they can run my game.
Hope that makes sense,
Thanks
You can use another compiling module like pyinstaller as one example to include all required files and use the --onefile option to compile it into a single executable. In cx_freeze you can make installers by specify the bdist options. e.g. for windows python setup_file.py bdist_msi
OK, I've written a stupid simple little python program called Coloriffic that lets you adjust values of red, green, and blue and display the resulting color. I used Pygame to accomplish this.
I then looked around for how to turn that into a simple program I could give to someone else without them needing to have Python or Pygame installed. After reading of a few options (and several pieces of advice on this very site), it seemed that most people recommended cx_freeze so I downloaded the WHL and installed it. I built a setup.py script, which wasn't hard as Coloriffic has no images or other external files, and is a very simple program.
When I ran the setup.py, it worked! It created a Coloroffic.exe that ran just fine. The problem is, it also created a directory with a hundred other support files. I tried creating an MSI installer, which did give me a single executable, but one that when run simply drops the same hundred+ files in another directory.
Is there a way to take my utterly simple Coloriffic.py program and convert it into a single Windows exe file that has everything it needs INSIDE the exe and that doesn't need to be installed? I'm trying to figure out if in Python I can take my .py programs and compile them into single executables without creating a directory of support files?
If so, how do I do that?
Thanks.
EDIT: Not looking to make it closed source, just looking to gather up everything in a single file. Also, I read that "py2exe will make the exe file you want but you need to have the same version of MSVCR90.dll on the machine you're going to use your new exe" - that could be a problem, unless all Windows machines from 7 on have this file all in the same version? This is the very reason for me asking this is the first place, to create a fully independent EXE file. I also see some people recommending cx_freeze, but either they don't understand that it doesn't create a single file, or I don't understand how to make it. Is there a way to make cx_freeze create a single standalone exe?
I guess I can hope that the MSVCR90.dll dependency has been done away with and try py2exe - but I would love some advice before I go down that road if it's the wrong one.
Thanks for the suggestions and the links to other answered questions, but I still don't see a straight answer to this one?
EDIT2: One more note, when I use cx_freeze to create the executable, and then I run Coloriffic.exe, first it creates what looks like a black Dos-box window, then a second window pops up with my program. I would also like for the executable to launch just ONE window, my program, without a Dos type window coming up first and remaining up behind the program window. Thanks.
Try Py2exe, this is a pretty easy and fast approach:
Py2exe Tutorial
exe has not to be installed, but it also creates support files in the same directory
I used Pyinstaller to create a standalone exe file for a PyQt project. I did not use the single file option because the exe that is created with the single file option takes too long to open. Therefore, Pyinstaller created a dist folder that contains a bunch of files including my program.exe file. I would now like to create a setup.exe file that will place the contents of my dist folder in the program directory and create a shortcut in the start menu and on the desktop. I want it to be super simple for the user. Maybe like the setup.exe files that you get when you download a program from CNET. I found Inno-setup, which looks promising. However, I do not know if there any special considerations because the program is a standalone program create from a python/PyQt program. Thanks! Anyone have experience with this task? Is there a program everyone is using for this task that I do not know about?
Inno-Setup or NSIS are probably the easiest to use. You just tell them what files to include and where to put them and then they will create a nice installer for you. I wrote a short tutorial on my experiences using InnoSetup that you might find helpful:
http://www.blog.pythonlibrary.org/2008/08/27/packaging-wxpymail-for-distribution/
Note that this tutorial was based around a wxPython app I wrote, but the concepts are the same.
I have developed my first .app for mac, written in python and would like to share this .app with some friends.
I have converted the python scripts via py2app. Then I have one .app and compress it to an .dmg file.
I share this .dmg file with the guys and for one, this is working fine. (He has already python installed)
The other people canĀ“t open the .app file, they get error messages. After an intensive search I got it. They have no python installed.
Now my question: How can I include a "one click python installation" in my .dmg file (or as package?!)
If you create the .dmg, you can setup a background image that tells users to move your application to the /Applications folder. If your application needs no extra setup, this is preferred, or a (Mac OS X created) .zip file with it.
The package option is better if some additional setup, or scripts checking for Python dependencies, are required.