allanswers.org - FAQ: Python -- an object-oriented language

 Home >  Programmingpython-faq >

FAQ: Python -- an object-oriented language

Section 1 of 4 - Prev - Next
All sections - 1 - 2 - 3 - 4


Archive-name: python-faq/part1
Submitted-by: Guido van Rossum 
Version: 1.34
Last-modified: 9 September 1996

This article contains answers to Frequently Asked Questions about
Python (an object-oriented interpreted programming language -- see
the answer to question 1.1 for a short overview).

Copyright 1993-1995 Guido van Rossum.  Unchanged electronic
redistribution of this FAQ is allowed.  Printed redistribution only
with permission of the author.  No warranties.

Author's address:
        Guido van Rossum
        C.N.R.I.
        1895 Preston White Drive
        Reston, VA 20191
        U.S.A.
Email:  , 

The latest version of this FAQ is available by anonymous ftp from
.  It will also be posted
regularly to the newsgroups comp.answers  and
comp.lang.python .

Many FAQs, including this one, are available by anonymous ftp
.  The name under
which a FAQ is archived appears in the Archive-name line at the top of
the article.  This FAQ is archived as python-faq/part1
.

There's a mail server on that machine which will send you files from
the archive by e-mail if you have no ftp access.  You send a e-mail
message to  containing the single word help
in the message body to receive instructions.

This FAQ is divided in the following chapters:

 1. General information and availability
 2. Python in the real world
 3. Building Python and Other Known Bugs
 4. Programming in Python
 5. Extending Python
 6. Python's design
 7. Using Python on non-UNIX platforms

To find the start of a particular chapter, search for the chapter number
followed by a dot and a space at the beginning of a line (e.g. to
find chapter 4 in vi, type /^4\. /).

Here's an overview of the questions per chapter:

 1. General information and availability
  1.1. Q. What is Python?
  1.2. Q. Why is it called Python?
  1.3. Q. How do I obtain a copy of the Python source?
  1.4. Q. How do I get documentation on Python?
  1.5. Q. Are there other ftp sites that mirror the Python distribution?
  1.6. Q. Is there a newsgroup or mailing list devoted to Python?
  1.7. Q. Is there a WWW page devoted to Python?
  1.8. Q. Is the Python documentation available on the WWW?
  1.9. Q. Is there a book on Python, or will there be one out soon?
  1.10. Q. Are there any published articles about Python that I can quote?
  1.11. Q. Are there short introductory papers or talks on Python?
  1.12. Q. How does the Python version numbering scheme work?
  1.13. Q. How do I get a beta test version of Python?
  1.14. Q. Are there copyright restrictions on the use of Python?
  1.15. Q. Why was Python created in the first place?

 2. Python in the real world
  2.1. Q. How many people are using Python?
  2.2. Q. Have any significant projects been done in Python?
  2.3. Q. Are there any commercial projects going on using Python?
  2.4. Q. How stable is Python?
  2.5. Q. What new developments are expected for Python in the future?
  2.6. Q. Is it reasonable to propose incompatible changes to Python?
  2.7. Q. What is the future of Python?
  2.8. Q. What is the PSA, anyway?
  2.9. Q. How do I join the PSA?
  2.10. Q. What are the benefits of joining the PSA?

 3. Building Python and Other Known Bugs
  3.1. Q. Is there a test set?
  3.2. Q. When running the test set, I get complaints about floating point
       operations, but when playing with floating point operations I cannot
       find anything wrong with them.
  3.3. Q. Link errors after rerunning the configure script.
  3.4. Q. The python interpreter complains about options passed to a
       script (after the script name).
  3.5. Q. When building on the SGI, make tries to run python to create
       glmodule.c, but python hasn't been built or installed yet.
  3.6. Q. I use VPATH but some targets are built in the source directory.
  3.7. Q. Trouble building or linking with the GNU readline library.
  3.8. Q. Trouble with socket I/O on older Linux 1.x versions.
  3.9. Q. Trouble with prototypes on Ultrix.
  3.10. Q. Trouble with posix.listdir on NeXTSTEP 3.2.
  3.11. Q. Other trouble building Python on platform X.
  3.12. Q. How to configure dynamic loading on Linux.
  3.13. Q. Errors when linking with a shared library containing C++ code.
  3.14. Q. I built with tkintermodule.c enabled but get "Tkinter not found".
  3.15. Q. I built with Tk 4.0 but Tkinter complains about the Tk version.
  3.16. Q. Link errors for Tcl/Tk symbols when linking with Tcl/Tk.
  3.17. Q. I configured and built Python for Tcl/Tk but "import Tkinter"
        fails.
  3.18. Q. Tk doesn't work right on DEC Alpha.
  3.19. Q. Several common system calls are missing from the posix module.
  3.20. Q. ImportError: No module named string, on MS Windows.
  3.21. Q. Core dump on SGI when using the gl module.

 4. Programming in Python
  4.1. Q. Is there a source code level debugger with breakpoints, step,
       etc.?
  4.2. Q. Can I create an object class with some methods implemented in
       C and others in Python (e.g. through inheritance)?  (Also phrased as:
       Can I use a built-in type as base class?)
  4.3. Q. Is there a curses/termcap package for Python?
  4.4. Q. Is there an equivalent to C's onexit() in Python?
  4.5. Q. When I define a function nested inside another function, the
       nested function seemingly can't access the local variables of the
       outer function.  What is going on?  How do I pass local data to a
       nested function?
  4.6. Q. How do I iterate over a sequence in reverse order?
  4.7. Q. My program is too slow.  How do I speed it up?
  4.8. Q. When I have imported a module, then edit it, and import it
       again (into the same Python process), the changes don't seem to take
       place.  What is going on?
  4.9. Q. How do I find the current module name?
  4.10. Q. I have a module in which I want to execute some extra code
        when it is run as a script.  How do I find out whether I am running as
        a script?
  4.11. Q. I try to run a program from the Demo directory but it fails
        with ImportError: No module named ...; what gives?
  4.12. Q. I have successfully built Python with STDWIN but it can't
        find some modules (e.g. stdwinevents).
  4.13. Q. What GUI toolkits exist for Python?
  4.14. Q. Are there any interfaces to database packages in Python?
  4.15. Q. Is it possible to write obfuscated one-liners in Python?
  4.16. Q. Is there an equivalent of C's "?:" ternary operator?
  4.17. Q. My class defines __del__ but it is not called when I delete the
        object.
  4.18. Q. How do I change the shell environment for programs called
        using os.popen() or os.system()?  Changing os.environ doesn't work.
  4.19. Q. What is a class?
  4.20. Q. What is a method?
  4.21. Q. What is self?
  4.22. Q. What is a unbound method?
  4.23. Q. How do I call a method defined in a base class from a derived
        class that overrides it?
  4.24. Q. How do I call a method from a base class without using the
        name of the base class?
  4.25. Q. How can I organize my code to make it easier to change the base
        class?
  4.26. Q. How can I find the methods or attributes of an object?
  4.27. Q. I can't seem to use os.read() on a pipe created with os.popen().
  4.28. Q. How can I create a stand-alone binary from a Python script?
  4.29. Q. What WWW tools are there for Python?
  4.30. Q. How do I run a subprocess with pipes connected to both input
        and output?
  4.31. Q. How do I call a function if I have the arguments in a tuple?
  4.32. Q. How do I enable font-lock-mode for Python in Emacs?
  4.33. Q. Is there an inverse to the format operator (a la C's scanf())?
  4.34. Q. Can I have Tk events handled while waiting for I/O?
  4.35. Q. How do I write a function with output parameters (call by reference)?
  4.36. Q. Please explain the rules for local and global variables in Python.
  4.37. Q. How can I have modules that mutually import each other?
  4.38. Q. How do I copy an object in Python?
  4.39. Q. How to implement persistent objects in Python?  (Persistent ==
        automatically saved to and restored from disk.)

 5. Extending Python
  5.1. Q. Can I create my own functions in C?
  5.2. Q. Can I create my own functions in C++?
  5.3. Q. How can I execute arbitrary Python statements from C?
  5.4. Q. How can I evaluate an arbitrary Python expression from C?
  5.5. Q. How do I extract C values from a Python object?
  5.6. Q. How do I use mkvalue() to create a tuple of arbitrary length?
  5.7. Q. How do I call an object's method from C?
  5.8. Q. How do I catch the output from print_error()?
  5.9. Q. How do I access a module written in Python from C?
  5.10. Q. How do I interface to C++ objects from Python?

 6. Python's design
  6.1. Q. Why isn't there a switch or case statement in Python?
  6.2. Q. Why does Python use indentation for grouping of statements?
  6.3. Q. Why are Python strings immutable?
  6.4. Q. Why don't strings have methods like index() or sort(), like
       lists?
  6.5. Q. Why does Python use methods for some functionality
       (e.g. list.index()) but functions for other (e.g. len(list))?
  6.6. Q. Why can't I derive a class from built-in types (e.g. lists or
       files)?
  6.7. Q. Why must 'self' be declared and used explicitly in method
       definitions and calls?
  6.8. Q. Can't you emulate threads in the interpreter instead of
       relying on an OS-specific thread implementation?
  6.9. Q. Why can't lambda forms contain statements?
  6.10. Q. Why don't lambdas have access to variables defined in the
        containing scope?
  6.11. Q. Why can't recursive functions be defined inside other functions?
  6.12. Q. Why is there no more efficient way of iterating over a dictionary
        than first constructing the list of keys()?
  6.13. Q. Can Python be compiled to machine code, C or some other language?
  6.14. Q. Why doesn't Python use proper garbage collection?

 7. Using Python on non-UNIX platforms
  7.1. Q. Is there a Mac version of Python?
  7.2. Q. Is there a DOS version of Python?
  7.3. Q. Is there a Windows 3.1(1) version of Python?
  7.4. Q. Is there a Windows NT version of Python?
  7.5. Q. Is there a Windows 95 version of Python?
  7.6. Q. Is there an OS/2 version of Python?
  7.7. Q. Is there a VMS version of Python?
  7.8. Q. What about IBM mainframes, or other non-UNIX platforms?
  7.9. Q. Where are the source or Makefiles for the non-UNIX versions?
  7.10. Q. What is the status and support for the non-UNIX versions?
  7.11. Q. I have a PC version but it appears to be only a binary.
        Where's the library?
  7.12. Q. Where's the documentation for the Mac or PC version?
  7.13. Q. The Mac (PC) version doesn't seem to have any facilities for
        creating or editing programs apart from entering it interactively, and
        there seems to be no way to save code that was entered interactively.
        How do I create a Python program on the Mac (PC)?

To find a particular question, search for the question number followed
by a dot, a space, and a Q at the beginning of a line (e.g. to find
question 4.2 in vi, type /^4\.2\. Q/).


1. General information and availability
 =======================================

1.1. Q. What is Python?

A. Python is an interpreted, interactive, object-oriented programming
language.  It incorporates modules, exceptions, dynamic typing, very
high level dynamic data types, and classes.  Python combines
remarkable power with very clear syntax.  It has interfaces to many
system calls and libraries, as well as to various window systems, and
is extensible in C or C++.  It is also usable as an extension language
for applications that need a programmable interface.  Finally, Python
is portable: it runs on many brands of UNIX, on the Mac, and on PCs
under MS-DOS, Windows, Windows NT, and OS/2.

To find out more, the best thing to do is to start reading the
tutorial from the documentation set (see a few questions further
down).

1.2. Q. Why is it called Python?

A. Apart from being a computer scientist, I'm also a fan of "Monty
Python's Flying Circus" (a BBC comedy series from the seventies, in
the -- unlikely -- case you didn't know).  It occurred to me one day
that I needed a name that was short, unique, and slightly mysterious.
And I happened to be reading some scripts from the series at the
time...  So then I decided to call my language Python.  But Python is
not a joke.  And don't you associate it with dangerous reptiles
either!  (If you need an icon, use an image of the 16-ton weight from
the TV series or of a can of SPAM :-)

1.3. Q. How do I obtain a copy of the Python source?

A. The latest complete Python source distribution is always available
by anonymous ftp, e.g.
.  It is a
gzipped tar file containing the complete C source, LaTeX
documentation, Python library modules, example programs, and several
useful pieces of freely distributable software.  This will compile and
run out of the box on most UNIX platforms.  (See section 7 for
non-UNIX information.)

Sometimes beta versions of a newer release are available; check the
subdirectory "beta" of the above-mentioned URL (i.e.
).  (At the time of
writing, beta3 for Python 1.4 is available there, and should be
checked before reporting problems with version 1.3.)

Occasionally a set of patches is issued which has to be applied using
the patch program.  These patches are placed in the same directory,
e.g. .  (At the time
of writing, no patches exist.)

An index of said ftp directory can be found in the file INDEX.  An
HTML version of the index can be found in the file index.html,
.

1.4. Q. How do I get documentation on Python?

A. The LaTeX source for the documentation is part of the source
distribution.  If you don't have LaTeX, the latest Python
documentation set is always available by anonymous ftp, e.g.
.  It is a
gzipped tar file containing PostScript files of the reference manual,
the library manual, and the tutorial.  Note that the library manual is
the most important one of the set, as much of Python's power stems
from the standard or built-in types, functions and modules, all of
which are described here.  PostScript for a high-level description of
Python is in the file nluug-paper.ps (a separate file on the ftp
site).

1.5. Q. Are there other ftp sites that mirror the Python distribution?

A. The following anonymous ftp sites keep mirrors of the Python
distribution:

USA:

        
        
        
        
        
        
        

Europe:

        
        
        
        
        
        
        

Australia:

        

Or try archie on the string "python".

1.6. Q. Is there a newsgroup or mailing list devoted to Python?

A. There is a newsgroup, comp.lang.python ,
and a mailing list.  The newsgroup and mailing list are gatewayed into
each other -- if you can read news it's unnecessary to subscribe to
the mailing list.  Send e-mail to  to
(un)subscribe to the mailing list.  Hypermail archives of (nearly)
everything posted to the mailing list (and thus the newsgroup) are
available on our WWW server,
.  The raw archives
are also available by ftp, e.g.
.  The
uncompressed versions of these files can be read with the standard
UNIX Mail program ("Mail -f file") or with nn ("nn file").  To read
them using MH, you could use "inc -file file".  (The archival service
has stopped archiving new articles around the end of April 1995.  I
hope to revive it on the PSA server www.python.org sometime in the
future.)

1.7. Q. Is there a WWW page devoted to Python?

A. Yes,  is the official Python home page.
At the time of writing, this page is not yet completely operational;
you may have a look at the old Python home page:
 or at the U.S. copy:
.

1.8. Q. Is the Python documentation available on the WWW?

A. Yes, see  (Python's home page).  It
contains pointers to hypertext versions of the whole documentation set
(as hypertext, not just PostScript).

If you wish to browse this collection of HTML files on your own
machine, it is available bundled up by anonymous ftp,
e.g. .

An Emacs-INFO set containing the library manual is also available by
ftp, e.g. .

1.9. Q. Is there a book on Python, or will there be one out soon?

A. Mark Lutz is writing a Python book for O'Reilly and Associates, to
be published early 1996.  See the outline (in PostScript):
.

1.10. Q. Are there any published articles about Python that I can quote?

A. So far the only refereed and published article that describes
Python in some detail is:

    Guido van Rossum and Jelke de Boer, "Interactively Testing Remote
    Servers Using the Python Programming Language", CWI Quarterly, Volume
    4, Issue 4 (December 1991), Amsterdam, pp 283-303.

LaTeX source for this paper is available as part of the Python source
distribution.

See also the next section (supposedly Aaron Watters' paper has been
refereed).

1.11. Q. Are there short introductory papers or talks on Python?

A. A recent, very entertaining introduction to Python is the tutorial by
Aaron Watters in UnixWorld Online:

    Aaron R. Watters: "The What, Why, Who, and Where of Python",
    

An olded paper is:

    Guido van Rossum, "An Introduction to Python for UNIX/C
    Programmers", in the proceedings of the NLUUG najaarsconferentie
    1993 (dutch UNIX users group meeting November 1993).

PostScript for this paper and for the slides used for the accompanying
presentation is available by ftp as
 and
, respectively.

Slides for a talk on Python that I gave at the Usenix Symposium on
Very High Level Languages in Santa Fe, NM, USA in October 1994 are
available as .

1.12. Q. How does the Python version numbering scheme work?

A. Python versions are numbered A.B.C or A.B.  A is the major version
number -- it is only incremented for major changes in functionality or
source structure.  B is the minor version number, incremented for less
earth-shattering changes to a release.  C is the patchlevel -- it is
incremented for each new patch release.  Not all releases have patch
releases.  Note that in the past, patches have added significant
changes; in fact the changeover from 0.9.9 to 1.0.0 was the first time
that either A or B changed!

Beta versions have an additional suffix of "betaN" for some small
number N.  Note that (for instance) all versions labeled 1.4betaN
*precede* the actual release of 1.4.  1.4b3 is short for 1.4beta3.

1.13. Q. How do I get a beta test version of Python?

A. If there are any beta releases, they are published in the normal
source directory (e.g. ).

1.14. Q. Are there copyright restrictions on the use of Python?

A. Hardly.  You can do anything you want with the source, as long as
you leave the copyrights in, and display those copyrights in any
documentation about Python that you produce.  Also, don't use the
author's institute's name in publicity without prior written
permission, and don't hold them responsible for anything (read the
actual copyright for a precise legal wording).

In particular, if you honor the copyright rules, it's OK to use Python
for commercial use, to sell copies of Python in source or binary form,
or to sell products that enhance Python or incorporate Python (or part
of it) in some form.  I would still like to know about all commercial
use of Python!

1.15. Q. Why was Python created in the first place?

A. Here's a *very* brief summary of what got me started:

- I had extensive experience with implementing an interpreted language
in the ABC group at CWI, and from working with this group I had
learned a lot about language design.  This is the origin of many
Python features, including the use of indentation for statement
grouping and the inclusion of very-high-level data types (although the
details are all different in Python).

- I had a number of gripes about the ABC language, but also liked many
of its features.  It was impossible to extend the ABC language (or its
implementation) to remedy my complaints -- in fact its lack of
extensibility was one of its biggest problems.

- I had some experience with using Modula-2+ and talked with the
designers of Modula-3 (and read the M3 report).  M3 is the origin of
the syntax and semantics used for exceptions, and some other Python
features.

- I was working in the Amoeba distributed operating system group at
CWI.  We needed a better way to do system administration than by
writing either C programs or Bourne shell scripts, since Amoeba had
its own system call interface which wasn't easily accessible from the
Bourne shell.  My experience with error handling in Amoeba made me
acutely aware of the importance of exceptions as a programming
language feature.

- It occurred to me that a scripting language with a syntax like ABC
but with access to the Amoeba system calls would fill the need.  I
realized that it would be foolish to write an Amoeba-specific
language, so I decided that I needed a language that was generally
extensible.

- During the 1989 Christmas holidays, I had a lot of time on my hand,
so I decided to give it a try.  During the next year, while still
mostly working on it in my own time, Python was used in the Amoeba
project with increasing success, and the feedback from colleagues made
me add many early improvements.

- In February 1991, after just over a year of development, I decided
to post to USENET.  The rest is in the Misc/HISTORY file.


2. Python in the real world
===========================

2.1. Q. How many people are using Python?

A. I don't know, but the maximum number of simultaneous subscriptions
to the Python mailing list before it was gatewayed into the newsgroup
was about 180 (several of which were local redistribution lists).  I
believe that many active Python users don't bother to subscribe to the
list, and now that there's a newsgroup the mailing list subscription
is even less meaningful.  I see new names on the newsgroup all the
time and my best guess is that there are currently at least several
thousands of users.

Another statistic is the number of accesses to the Python WWW server.
Have a look at .

2.2. Q. Have any significant projects been done in Python?

A. Here at CWI (the home of Python), we have written a 20,000 line
authoring environment for transportable hypermedia presentations, a
5,000 line multimedia teleconferencing tool, as well as many many
smaller programs.

The University of Virginia uses Python to control a virtual reality
engine.  Contact: Matt Conway .

The ILU project at Xerox PARC can generate Python glue for ILU
interfaces.  See .

The University of California, Irvine uses a student administration
system called TELE-Vision written entirely in Python.  Contact: Ray
Price .

See also the next question.

If you have done a significant project in Python that you'd like to be
included in the list above, send me email!

2.3. Q. Are there any commercial projects going on using Python?

A. Several companies have revealed to me that they are planning or
considering use of Python in a future product.

Sunrise Software has a product out using Python -- they use Python
for a GUI management application and an SNMP network management
application.  Contact: .

Infoseek uses Python to implement their commercial WWW information
retrieval service .  Contact:
.

Paul Everitt of Connecting Minds is planning a Lotus Notes gateway.
Contact: .  Or see their WWW server
.

KaPRE in Boulder, CO is using Python for on-site customization of C++
applications, rapid-prototyping/development,
language-based-components, and possibly more.  This is pretty solid:
Python's being shipped with their tool-set now, to beta sites.
Contact:  (Mark Lutz).

Individuals at many other companies are using Python for internal
development or for as yet unannounced products (witness their
contributions to the Python mailing list or newsgroup).

SGI has advertised in the Python list looking for Python programmers
for a project involving interactive television.

See also the workshop minutes at
 -- in general the WWW server is
more up to date than the FAQ for these issues.

Python has also been elected as an extension language by MADE, a
consortium supported by the European Committee's ESPRIT program and
consisting of Bull, CWI and some other European companies.  Contact:
Ivan Herman .

If you'd like to be included in the list above, send me email!

2.4. Q. How stable is Python?

A. Very stable.  While the current version number would suggest it is
in the early stages of development, in fact new, stable releases
(numbered 0.9.x through 1.3) have been coming out roughly every 3 to
6 months for the past four years.

2.5. Q. What new developments are expected for Python in the future?

A. See my Work-In-Progress web page, currently at
, and the pages for the
Second Python Workshop (best reached via the Python home page,
).  Also follow the newsgroup discussions!

2.6. Q. Is it reasonable to propose incompatible changes to Python?

A. In general, no.  There are already millions of lines of Python code
around the world, so any changes in the language that invalidates more
than a very small fraction of existing programs has to be frowned
upon.  Even if you can provide a conversion program, there still is
the problem of updating all documentation.  Providing a gradual
upgrade path is the only way if a feature has to be changed.

2.7. Q. What is the future of Python?

A. If I knew, I'd be rich :-)

Seriously, the formation of the PSA (Pyton Software Activity, see
) ensures some kind of support even in
the (unlikely! event that I'd be hit by a bus (actually, here in the
US, a car accident would be more likely :-), were to join a nunnery,
or would be head-hunted.  A large number of Python users have become
experts at Python programming as well as maintenance of the
implementation, and would easily fill the vacuum created by my
disappearance.

In the mean time, I have no plans to disappear -- rather, I am
committed to improving Python, and my current benefactor, CNRI (see
) is just as committed to continue
its support of Python and the PSA.  In fact, we have great plans for
Python -- we just can't tell yet!

2.8. Q. What is the PSA, anyway?

A. The Python Software Activity  was
created by a number of Python aficionados who want Python to be more
than the product and responsibility of a single individual.  It has
found a home at CNRI .  Anybody who
wishes Python well should join the PSA.

2.9. Q. How do I join the PSA?

A. The full scoop is available on the web, see
.  Summary: send a check
of at least $50 to CNRI/PSA, 1895 Preston White Drive, Suite 100, in
Reston, VA 20191.  Full-time students pay $25.  Companies can join for
a mere $500.

2.10. Q. What are the benefits of joining the PSA?

A. Like National Public Radio, if not enough people join, Python will
wither.  Your name will be mentioned on the PSA's web server.
Workshops organized by the PSA 
are only accessible to PSA members (you can join at the door).  The
PSA is working on additional benefits, such as reduced prices for
books and software, and early access to beta versions of Python.


3. Building Python and Other Known Bugs
=======================================

3.1. Q. Is there a test set?

A. Yes, simply do "import testall" (or "import autotest" if you aren't
interested in the output).  The standard modules whose name begins
with "test" together comprise the test.  The test set doesn't test
*all* features of Python but it goes a long way to confirm that a new
port is actually working.  The Makefile contains an entry "make test"
which runs the autotest module.  NOTE: if "make test" fails, run the
tests manually ("import testall") to see what goes wrong before
reporting the error.

3.2. Q. When running the test set, I get complaints about floating point
operations, but when playing with floating point operations I cannot
find anything wrong with them.

A. The test set makes occasional unwarranted assumptions about the
semantics of C floating point operations.  Until someone donates a
better floating point test set, you will have to comment out the
offending floating point tests and execute similar tests manually.

3.3. Q. Link errors after rerunning the configure script.

A. It is generally necessary to run "make clean" after a configuration
change.

3.4. Q. The python interpreter complains about options passed to a
script (after the script name).

A. You are probably linking with GNU getopt, e.g. through -liberty.
Don't.  The reason for the complaint is that GNU getopt, unlike System
V getopt and other getopt implementations, doesn't consider a
non-option to be the end of the option list.  A quick (and compatible)
fix for scripts is to add "--" to the interpreter, like this:

Section 1 of 4 - Prev - Next
All sections - 1 - 2 - 3 - 4

Back to category python-faq - Use Smart Search
Home - Smart Search - About the project - Feedback

© allanswers.org | Terms of use

LiveInternet