How to package a python program
Im new to python programming.Im writ开发者_如何学运维ing a simple command line based twitter app,and i have to use external libraries like simplejson,tweepy etc. Is there a way i can package my python program to include these libraries as well,so that when i distribute this program, the user doesnt have to install the required libraries first himself ?
Thank You
Python will search for modules in the current directory, so you can just package the libraries along in a subdirectory. For example, if myprogram.py use the foo package:
import foo
this means that there's either
- a
foo.pyon your Python path; put it into the same directory asmyprogram.py, or - a directory
fooon your Python path which contains a module__init__.py; put the entire directory (.pyfiles only, no need for.pycfiles) into the same directory asmyprogram.py.
Of course, have a look at the licenses first to check whether they allow redistribution with your program in this manner.
加载中,请稍侯......
精彩评论