-1

Hello I have this python file main.py like this :

print "a"

This file is really simple and I would like to create a deb file for this python file. Then I would like when I type for instance main in the terminal when the package is installed main I get :

a

Thank you very much !

  • Do you want to know how to create a deb file, or how you can type `main` and run the python script? – Morgoth Mar 21 '17 at 19:48
  • please try to rephrase your posting as a question. dont list all the things you want to do. explicitly ask how to do X. also tell us what you have already tried and why you are struggeling – Neuron Mar 21 '17 at 20:20

1 Answers1

0

If you want to run main.py from the command line:

In your main.py you need to add a python shebang:

#!/usr/bin/python
print "a"

In a terminal navigate to where your file is saved and run the following commands:

chmod +x main.py
sudo cp main.py ~/bin/

Now you can type main.py on the terminal and your command should run. If you rename your file to main, then you'll only have to type main to get it to run.

If you actually want to create a deb package:

If you actually want to create a deb file, then follow this link.

Morgoth
  • 4,935
  • 8
  • 40
  • 66