Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18652 > unrolled thread

Installing a script and use it via python -m

Started byOktaka Com <oktakaweb@gmail.com>
First post2012-01-07 10:32 -0800
Last post2012-01-08 08:31 +1100
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  Installing a script and use it via python -m Oktaka Com <oktakaweb@gmail.com> - 2012-01-07 10:32 -0800
    Re: Installing a script and use it via python -m Cameron Simpson <cs@zip.com.au> - 2012-01-08 08:31 +1100

#18652 — Installing a script and use it via python -m

FromOktaka Com <oktakaweb@gmail.com>
Date2012-01-07 10:32 -0800
SubjectInstalling a script and use it via python -m
Message-ID<35d4f491-85e3-48ee-81e8-b9a627dcb19c@i26g2000vbt.googlegroups.com>
Hi all,

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?

Thanks,

[toc] | [next] | [standalone]


#18655

FromCameron Simpson <cs@zip.com.au>
Date2012-01-08 08:31 +1100
Message-ID<mailman.4519.1325971920.27778.python-list@python.org>
In reply to#18652
On 07Jan2012 10:32, Oktaka Com <oktakaweb@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@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@bby.com.au>

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web