0

I have a simple python scripts which imports some functions and performs simple tasks based on user inputs via the python shell.

I would like to distribute this to users who do not have python installed or the same modules I have on my local machine.

I've looked at py2app but this seems to require a GUI or similar and I do not need this, only command line arguments etc.. My script used raw_import for receiving commands as below...

import time, sys, os

def main():

    name = raw_input("Enter name: ")
    print name

    time.sleep(60)
    print 'bye'
if __name__=="__main__":
    main()

would anyone know the correct way to do this..

3
  • py2exe.org Commented Jan 20, 2014 at 14:48
  • which operating system do you use? same questions for your users? Commented Jan 20, 2014 at 14:50
  • sorry its OSX not windows Commented Jan 20, 2014 at 14:51

1 Answer 1

1

Python is installed by default on OSX (and has been since at the very least 10.3). If your scripts are simple command-line affairs with no external dependencies, you don't have to do anything, just ship them.

If your script has dependencies, you need to write a proper setup.py for it, so that users may install it and its dependencies with one simple line (python setup.py install).

At that point, it means you want to read an introduction to Python packaging: http://guide.python-distribute.org/index.html

Sign up to request clarification or add additional context in comments.

2 Comments

arr, ok but I have several modules which I import, how would I allow for this..?
What modules are those? Things you wrote yourself? In that case, why not ship a zip file?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.