Is there any equivalent feature available in Python..?
zaheer.agadi at gmail.com
zaheer.agadi at gmail.com
Tue Feb 24 23:17:21 EST 2009
On Feb 25, 1:10 am, Albert Hopkins <mar... at letterboxes.org> wrote:
> On Tue, 2009-02-24 at 11:05 -0800, zaheer.ag... at gmail.com wrote:
> > Hi,
>
> > Is there any Python equivalent of java jar,can I include all my
> > sources,properties file etc into a single file.Is there anyway in
> > Python that I can run like the following
>
> > java -jar Mytest.jar --startwebserver
>
> > How to so something like this in Python?
>
> Similar but not equal:
>
> $ tree mytest
> mytest
> |-- __init__.py
> `-- main.py
>
> $ cat mytest/__init__.py
> if __name__ == '__main__':
> import sys
> print sys.argv
> import mytest.main
>
> $ cat mytest/main.py
> print 'hi mom'
>
> $ zip -r mytest.zip mytest
> adding: mytest/ (stored 0%)
> adding: mytest/main.py (stored 0%)
> adding: mytest/__init__.py (deflated 4%)
>
> $ PYTHONPATH=mytest.zip python -m mytest --startserver
> [None, '--startserver']
> hi mom
Thanks A lot this should solve my problem.Just out of curiosity how is
Python eggs different from the zip file you created here
More information about the Python-list
mailing list