-3

I want to to know how to make runnable Python program in Linux. It will pack all library is necessary into 1 file to run on any Linux machine.

Thank for reading and looking forward to answering

Pravitha V
  • 3,238
  • 4
  • 29
  • 51
Thân Hoàng
  • 121
  • 1
  • 6
  • https://stackoverflow.com/questions/5458048/how-to-make-a-python-script-standalone-executable-to-run-without-any-dependency – Peter Wood Aug 26 '17 at 11:59
  • Possible duplicate of [How to make a Python script standalone executable to run without ANY dependency?](https://stackoverflow.com/questions/5458048/how-to-make-a-python-script-standalone-executable-to-run-without-any-dependency) – hnefatl Aug 26 '17 at 12:00
  • https://stackoverflow.com/a/5458250/94746 – snahor Aug 26 '17 at 12:38

1 Answers1

-1

Linux machines will all have Python 2.5 at least installed.

Start the file with a shebang:

#!/usr/bin/python

Make it executable:

$ chmod +x filename.py

Then you can run it with the command:

$./filename.py
Ben Quigley
  • 696
  • 4
  • 18