Installing a script and use it via python -m

Cameron Simpson cs at zip.com.au
Sat Jan 7 16:31:48 EST 2012


On 07Jan2012 10:32, Oktaka Com <oktakaweb at gmail.com> wrote:
| Is there a way to do below:
| 
| 1) install via setup.py some script: xxx.py
| 2) python -m xxx.py
| 
| In fact, this question opens to: Is there a platform independent way
| to copy xxx.py to somewhere that the system will search for?

Depends what's in your $PYTHONPATH I think, but setup.py has an "install
for user" option. Use that, then plain old python -m xxx (note: no .py
here - it is the module name, not the file pathname).

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

I will not do it as a hack       I will not do it for my friends
I will not do it on a Mac        I will not write for Uncle Sam
I will not do it on weekends     I won't do ADA, Sam-I-Am
        - Gregory Bond <gnb at bby.com.au>



More information about the Python-list mailing list