> Date: Wed, 13 Apr 2011 17:36:24 -0700
> From: James Fort <[email protected]>
> Subject: Re: [SEAPY] Execute script from anywhere?
> To: Seattle Python Interest Group <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Thanks everyone!  I found the -m method to work best for me, as it allows me
> to execute a script from anywhere, using multiple Python installs on my
> machine (I need to do this because I sometimes have to run a script with the
> python install included with my company's software release).  Also, I
> noticed that creating a package using __init__.py is not necessary to run
> the script in module mode with -m, but it does have the helpful side effect
> of forcing me to organize my scripts into meaningful packages, and teaching
> me about package organization in general.
>
> Thanks again,
> James

Exactly right: the point of packaging (in this context) is not that
it's required for the desired functionality, but rather that once
you've discovered this capability, you're inclined to start filling up
site-packages w/ your own .py files, and it can quickly get hard to
see the trees for the forest. ;-)

Reply via email to