shipping python

Westley Martínez anikom15 at gmail.com
Tue Oct 11 21:08:06 EDT 2011


On Tue, Oct 11, 2011 at 05:04:45PM -0600, Kristen J. Webb wrote:
> I am new to python coming from the C/shell side.
> We have been experimenting with some code
> samples and now I'm looking at some command line
> argument processing.  I find
> 
> getopt older
> optparse new in 2.3
> argparse new in 2.7
> 
> I search around on some of my client systems and
> find lots of people in the 2.4 - 2.6 range.
> 
> After some more digging I see that I can
> easy_install argparse on my development system.
> 
> My question is will I be able to ship this
> to a customer?  Can I create .pyc files so
> that the customer does not have to install the argparse
> module?
> 
> If not, and I want to go back into the 2.3+ range,
> should I just use optparse?
> 
> I guess what I am asking here is are there any
> guidelines/recommendations for shipping python
> programs to customers?
> 
> Thanks in advance,
> Kris

If you intend for the software to run on Python <2.7 the user must have
argparse installed.  Python included argparse in the standard library in
2.7.  Understand that getopt is analog to the getopt found in the POSIX
library; optparse and argparse are designed to handle more "complex"
arguments.  Basically it depends on your needs.  If you're concerned
about portability it's very easy to deal with arguments with getopt or
just sys.argv on your own.



More information about the Python-list mailing list