1

I have developed some scripts which I need to share with colleagues who does not have python nor have underlying distributions to run it. How to automatically configure environment and more importantly run the script without even python installed?

I saw some solutions on SO like py2exe. Not sure that it’s the best option. Docker is also not possible since in my case I need something what can work simply by running python3 path/to/program

sumixam
  • 67
  • 8

4 Answers4

2

You can use online coding platforms like repl.it to run scripts from the browser so u don't want to install python locally.

TheOneMusic
  • 1,339
  • 11
  • 36
Arvind M
  • 21
  • 3
  • 1
    Thanks! Will explore this one for sure, however, script has input output functionality and there may be issue with one of the APIs I use. – sumixam Jul 26 '20 at 15:34
  • Your welcome, I Think there will be no problem with input and output because i saw lot of them using repl.it to create GUI but i am not sure about APIs – Arvind M Jul 30 '20 at 14:10
1

It depends on the complexity of the script.

If it is doing complex things that it needs to be run on your computer for, like file input & output, then PyInstaller is probably the way:

pip isntall
pyinstaller -- onefile script.py

If it is just a short script, then Repl.It is a great way to save and share scripts that can be viewed and run right in the browser. It supports installing pip packages and environments. It even has a feature where you can host a terminal app as a website: repl.run

Luke Storry
  • 5,112
  • 1
  • 6
  • 21
1

Convert it into a exe file using pyinstaller Following are the steps:

1. Open cmd on the folder in which you stored your py file

2.type it on the cmd
pyinstaller -- onefile filename.py

If you don't have pyinstaller module then install it using

pip install pyinstaller
Ujjwal Dash
  • 602
  • 1
  • 2
  • 8
0

I am using PyInstaller to create a complete standalone executables, that does not depend on a machine having python interpreter. Here is a complete guide: https://datatofish.com/executable-pyinstaller/

Ilian Zapryanov
  • 1,037
  • 2
  • 16
  • 27