Is there any equivalent feature available in Python..?

Z

zaheer.agadi

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?

Thanks
 
A

Albert Hopkins

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
 
Z

zaheer.agadi

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top