Python script multiexecution [duplicate] - python

This question already has answers here:
Create a single executable from a Python project [closed]
(3 answers)
Closed 1 year ago.
I want to execute three python script that I have developed. I found one doubt, how could I do it using a python script?
I want to convert it into a .exe, because our solution is thought to be executed in machines without python installed so having an unique script would be helpful.
Edit: I don't know the cause of the closure, I know how to use pyinstaller, my question was how can I execute 3 python using a python script or if it is possible.
Any suggestion? Thanks!

To package script and all dependencies you can use Pyinstaller, see here.
To execute multiple script (or exe) you can write a bat file that start the 3 exe or use them as services, based on your needs.

Use pyinstaller it can convert python to executables. You can get it up and running simply by doing
pip install pyinstaller
pyinstaller myfile.py

Related

Run python script at windows startup [duplicate]

This question already has answers here:
How to start a python file while Windows starts?
(11 answers)
Closed 2 years ago.
Requirement :- I want my python file to run at windows startup
I am using Anaconda, spyder as IDE. My python file is using a package which running absolutely file when I run on Spyder itself.
Now when I have created a bat file and i have given python exe file and python script along with path
When I run it gives me error that package has not been installed.
so same file running in spyder but when trying to run .bat file it giving me error.
Please guide me how should I achieve this task.
Thank you.
You can place a shortcut that runs
C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\python3.exe myfile.py
You can find where your install of python is at with where python3 in a command prompt.
Place the shortcut in shell:startup and will run after all startup programs have run.
But since you using your ide's python instance you have to run the python environment source from its, sadly I don't use Spyder IDE and most IDE are closed python environments and are setup within their own terminals.

How to convert .py to .exe along with all its dependecies [duplicate]

This question already has answers here:
How can I make a Python script standalone executable to run without ANY dependency? [duplicate]
(19 answers)
Closed 2 years ago.
Suppose, I want to create a .exe file and i want all my features which are depended on certain packages or modules like tensorflow etc.So,how can i do this.
You can use something like pyinstaller, you can install it like this:
pip install pyinstaller
Once you install it, use this syntax to create to an exe:
pyinstaller yourprogram.py
This will create a .exe file from your program which will be in a dist folder and will include all dependencies along with it.
Additional documentation is avaialable here on how to include an icon etc.

How can we make a Python script auto executable at system startup (preferably linux) on every system it is installed on? [duplicate]

This question already has an answer here:
Create python script that runs at startup [closed]
(1 answer)
Closed 8 years ago.
I have a python script , it has to be auto - executed on startup. I know how to make it happen in my system through editing and adding files in etc/init.d . I have created a Python Package for it with setup.py and other files but I cant find a way how to make the script auto executable on every system that it is installed . Is there a way to do it using setup.py ?
Put that script in /etc/rc.local to execute it every time you boot the system.

How to my "exe" from PyCharm project [duplicate]

This question already has answers here:
Create a single executable from a Python project [closed]
(3 answers)
Closed 8 years ago.
Writing some project on Python via PyCharm.
I want to get an exe file from it.
I've tried to "Save as->XXX.exe" - but ,when i'm trying to execute it there is an error "file is not supported with such kind of OS"
p.s.
i've got win7 x64,it doesn't work on x32 too.
You cannot directly save a Python file as an exe and expect it to work -- the computer cannot automatically understand whatever code you happened to type in a text file. Instead, you need to use another program to transform your Python code into an exe.
I recommend using a program like Pyinstaller. It essentially takes the Python interpreter and bundles it with your script to turn it into a standalone exe that can be run on arbitrary computers that don't have Python installed (typically Windows computers, since Linux tends to come pre-installed with Python).
To install it, you can either download it from the linked website or use the command:
pip install pyinstaller
...from the command line. Then, for the most part, you simply navigate to the folder containing your source code via the command line and run:
pyinstaller myscript.py
You can find more information about how to use Pyinstaller and customize the build process via the documentation.
You don't necessarily have to use Pyinstaller, though. Here's a comparison of different programs that can be used to turn your Python code into an executable.

Change python output script format to exe [duplicate]

This question already has answers here:
Create a single executable from a Python project [closed]
(3 answers)
Closed 9 years ago.
Is there any way or tool to automatically change python output script format (.py) to exe ? I want to run my app on every Windows computers including that haven't got installed python.
I had to do this a while ago and I had the most success with py2exe: http://www.py2exe.org/
You create a setup.py file which gives a list of what Python code you want to include in your executable, and it packages that up along with a subset of the Python interpreter into a single exe. Works specifically on Windows. (Linux and Mac generally already have Python installed so it's much less of an issue there.)

Categories

Resources