Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
The ONE Campaign to make poverty history

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 94 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here




       python [ -d ] [ -E ] [ -h ] [ -i ] [ -O ]
              [ -Q argument ] [ -S ] [ -t ] [ -u ]
              [ -v ] [ -V ] [ -W argument ] [ -x ]
              [ -c command | script | - ] [ arguments ]


       Python is  an  interpreted,  interactive,  object-oriented
       programming  language  that combines remarkable power with
       very clear syntax.  For an introduction to programming  in
       Python  you  are  referred  to  the  Python Tutorial.  The
       Python Library Reference documents built-in  and  standard
       types,  constants,  functions  and  modules.  Finally, the
       Python Reference Manual describes the syntax and semantics
       of the core language in (perhaps too) much detail.  (These
       documents may be located via the INTERNET RESOURCES below;
       they may be installed on your system as well.)

       Python's basic power can be extended with your own modules
       written in C or C++.  On most systems such modules may  be
       dynamically loaded.  Python is also adaptable as an exten­
       sion language for existing applications.  See the internal
       documentation for hints.

       Documentation  for  installed  Python modules and packages
       can be viewed by running the pydoc program.


       -c command
              Specify the command to execute (see next  section).
              This  terminates the option list (following options
              are passed as arguments to the command).

       -d     Turn on parser debugging output (for wizards  only,
              depending on compilation options).

       -E     Ignore  environment  variables  like PYTHONPATH and
              PYTHONHOME that modify the behavior of  the  inter­

       -h     Prints the usage for the interpreter executable and

       -i     When a script is passed as first argument or the -c
              option  is  used, enter interactive mode after exe­
              cuting the script or the command.  It does not read
              the  $PYTHONSTARTUP  file.   This  can be useful to
              inspect global variables or a stack  trace  when  a
              script raises an exception.

       -O     Turn  on  basic  optimizations.   This  changes the

       -S     Disable the import of the module site and the site-
              dependent   manipulations   of   sys.path  that  it

       -t     Issue a warning when a source file mixes  tabs  and
              spaces  for  indentation  in  a  way  that makes it
              depend on the worth of a tab expressed  in  spaces.
              Issue an error when the option is given twice.

       -u     Force  stdin,  stdout  and  stderr  to  be  totally
              unbuffered.  On systems where it matters, also  put
              stdin, stdout and stderr in binary mode.  Note that
              there is internal buffering in xreadlines(),  read­
              lines()  and  file-object  iterators  ("for line in
              sys.stdin") which is not influenced by this option.
              To   work   around  this,  you  will  want  to  use
              "sys.stdin.readline()" inside a "while 1:" loop.

       -v     Print a message each time a module is  initialized,
              showing  the  place  (filename  or built-in module)
              from which it is loaded.  When given twice, print a
              message  for  each  file  that  is checked for when
              searching for a module.  Also provides  information
              on module cleanup at exit.

       -V     Prints  the Python version number of the executable
              and exits.

       -W argument
              Warning control.  Python sometimes  prints  warning
              message  to  sys.stderr.  A typical warning message
              has the following form: file:line:  category:  mes­
              sage.  By default, each warning is printed once for
              each source line where it occurs.  This option con­
              trols  how often warnings are printed.  Multiple -W
              options may be given; when a warning  matches  more
              than  one  option, the action for the last matching
              option  is  performed.   Invalid  -W  options   are
              ignored (a warning message is printed about invalid
              options when the first warning is  issued).   Warn­
              ings  can  also  be controlled from within a Python
              program using the warnings module.

              The simplest form of argument is one of the follow­
              ing  action  strings  (or  a  unique abbreviation):
              ignore to ignore all warnings; default  to  explic­
              itly  request  the  default behavior (printing each
              warning once per source line); all to print a warn­
              ing  each  time  it  occurs (this may generate many
              messages if a warning is triggered  repeatedly  for
              the  same source line, such as inside a loop); mod­
              ing category.  This must be a class name; the match
              test  whether  the  actual  warning category of the
              message is a subclass of the specified warning cat­
              egory.   The  full  class  name must be given.  The
              module field matches the  (fully-qualified)  module
              name; this match is case-sensitive.  The line field
              matches the line number,  where  zero  matches  all
              line  numbers  and is thus equivalent to an omitted
              line number.

       -x     Skip  the  first  line  of  the  source.   This  is
              intended  for  a  DOS specific hack only.  Warning:
              the line numbers in error messages will be  off  by


       The  interpreter  interface  resembles  that  of  the UNIX
       shell: when called with standard input connected to a  tty
       device, it prompts for commands and executes them until an
       EOF is read; when called with a file name argument or with
       a  file  as standard input, it reads and executes a script
       from that file; when called with -c command,  it  executes
       the  Python  statement(s)  given as command.  Here command
       may contain multiple  statements  separated  by  newlines.
       Leading  whitespace  is  significant in Python statements!
       In  non-interactive  mode,  the  entire  input  is  parsed
       befored it is executed.

       If  available,  the  script  name and additional arguments
       thereafter are passed to the script in the Python variable
       sys.argv  ,  which  is  a  list of strings (you must first
       import sys to be able to access it).  If no script name is
       given,  sys.argv[0]  is  an  empty  string; if -c is used,
       sys.argv[0] contains the string '-c'.  Note  that  options
       interpreted  by  the  Python  interpreter  itself  are not
       placed in sys.argv.

       In interactive mode, the primary prompt is `>>>'; the sec­
       ond  prompt (which appears when a command is not complete)
       is `...'.  The prompts can be  changed  by  assignment  to
       sys.ps1  or  sys.ps2.  The interpreter quits when it reads
       an EOF at a prompt.  When an unhandled exception occurs, a
       stack  trace is printed and control returns to the primary
       prompt; in non-interactive  mode,  the  interpreter  exits
       after  printing  the  stack  trace.   The interrupt signal
       raises the KeyboardInterrupt exception; other UNIX signals
       are  not caught (except that SIGPIPE is sometimes ignored,
       in favor of the IOError exception).   Error  messages  are
       written to stderr.


       These are subject to difference depending on local instal­
              Recommended locations of the directories containing
              the  include  files  needed  for  developing Python
              extensions and embedding the interpreter.

              User-specific initialization  file  loaded  by  the
              user  module; not used by default or by most appli­


              Change  the  location  of   the   standard   Python
              libraries.   By default, the libraries are searched
              in  ${prefix}/lib/python<version>  and  ${exec_pre­
              fix}/lib/python<version>,   where   ${prefix}   and
              ${exec_prefix} are installation-dependent  directo­
              ries, both defaulting to /usr/local.  When $PYTHON­
              HOME is  set  to  a  single  directory,  its  value
              replaces  both  ${prefix}  and  ${exec_prefix}.  To
              specify different values for these, set $PYTHONHOME
              to ${prefix}:${exec_prefix}.

              Augments  the default search path for module files.
              The format is the same as the shell's $PATH: one or
              more directory pathnames separated by colons.  Non-
              existant directories  are  silently  ignored.   The
              default  search path is installation dependent, but
              generally begins with ${prefix}/lib/python<version>
              (see PYTHONHOME above).  The default search path is
              always appended to $PYTHONPATH.  If a script  argu­
              ment  is given, the directory containing the script
              is inserted in the path in  front  of  $PYTHONPATH.
              The  search  path  can be manipulated from within a
              Python program as the variable sys.path .

              If this is the name of a readable file, the  Python
              commands in that file are executed before the first
              prompt is displayed in interactive mode.  The  file
              is  executed  in the same name space where interac­
              tive commands are executed so that objects  defined
              or imported in it can be used without qualification
              in the interactive session.  You  can  also  change
              the prompts sys.ps1 and sys.ps2 in this file.

              Set  this  to  a non-empty string to cause the time
              module to require dates  specified  as  strings  to
              include  4-digit years, otherwise 2-digit years are
              converted based on rules described in the time mod­

              If  this is set to a non-empty string it is equiva­
              lent to specifying the -i option.

              If this is set to a non-empty string it is  equiva­
              lent to specifying the -u option.

              If  this is set to a non-empty string it is equiva­
              lent to specifying the -v  option.  If  set  to  an
              integer, it is equivalent to specifying -v multiple


       Guido van Rossum

       E-mail: guido@python.org

       And a cast of thousands.


       Main website:  http://www.python.org/
       Documentation:  http://www.python.org/doc/
       Community website:  http://starship.python.net/
       Developer     resources:       http://sourceforge.net/pro­
       FTP:  ftp://ftp.python.org/pub/python/
       Module repository:  http://www.vex.net/parnassus/
       Newsgroups:  comp.lang.python, comp.lang.python.announce


       Python  is  distributed under an Open Source license.  See
       the file "LICENSE" in the Python source  distribution  for
       information on terms & conditions for accessing and other­
       wise using Python and for a DISCLAIMER OF ALL  WARRANTIES.

                   $Date: 2003/05/26 05:15:35 $         PYTHON(1)
Help us cut cost by not downloading the whole site!
Use of automated download sofware ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and therefore is expressedly prohibited. For more details on this, take a look here



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
You can get all the latest Site and Linux news by checking out our news page.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.10 Seconds