blob: 3cdf8840d4d841818d699018f836a2709e5fa165 [file] [log] [blame]
Benjamin Petersonb9869df2016-03-21 22:31:02 -07001.TH PYTHON "1"
Andrew M. Kuchling3afe4f32004-10-07 12:30:54 +00002
Benjamin Peterson5f28b7b2009-03-26 21:49:58 +00003.\" To view this file while editing, run it through groff:
4.\" groff -Tascii -man python.man | less
Andrew M. Kuchling3afe4f32004-10-07 12:30:54 +00005
Guido van Rossuma7925f11994-01-26 10:20:16 +00006.SH NAME
7python \- an interpreted, interactive, object-oriented programming language
8.SH SYNOPSIS
9.B python
10[
Matthias Klosec8b16f82010-01-31 16:14:37 +000011.B \-B
12]
13[
Senthil Kumarance3dd0b2013-06-19 22:19:46 -050014.B \-b
15]
16[
Guido van Rossuma7925f11994-01-26 10:20:16 +000017.B \-d
18]
19[
Guido van Rossumb674baf2001-09-05 18:55:34 +000020.B \-E
21]
22[
23.B \-h
24]
25[
Guido van Rossuma7925f11994-01-26 10:20:16 +000026.B \-i
27]
28[
Christian Heimesad73a9c2013-08-10 16:36:18 +020029.B \-I
Andrew M. Kuchling166e6252004-10-07 12:04:50 +000030]
Guido van Rossumb674baf2001-09-05 18:55:34 +000031.br
32 [
Christian Heimesad73a9c2013-08-10 16:36:18 +020033.B \-m
34.I module-name
35]
36[
Senthil Kumarance3dd0b2013-06-19 22:19:46 -050037.B \-q
38]
39[
Matthias Klosec8b16f82010-01-31 16:14:37 +000040.B \-O
41]
42[
R David Murray9c4f09d2011-05-01 11:13:56 -040043.B \-OO
Matthias Klosec8b16f82010-01-31 16:14:37 +000044]
45[
Matthias Klosec8b16f82010-01-31 16:14:37 +000046.B \-s
47]
48[
Guido van Rossumb674baf2001-09-05 18:55:34 +000049.B \-S
Neil Schemenauer7d4bb9f2001-07-23 16:30:27 +000050]
51[
Guido van Rossumef5bca31994-05-03 14:15:32 +000052.B \-u
Guido van Rossuma7925f11994-01-26 10:20:16 +000053]
Guido van Rossumb674baf2001-09-05 18:55:34 +000054.br
55 [
Guido van Rossuma7925f11994-01-26 10:20:16 +000056.B \-v
57]
Guido van Rossum07c44c71998-04-10 19:46:00 +000058[
Barry Warsaw64569372000-09-15 18:39:09 +000059.B \-V
60]
Guido van Rossum1378c322000-12-19 03:21:54 +000061[
62.B \-W
63.I argument
64]
Guido van Rossumb674baf2001-09-05 18:55:34 +000065[
66.B \-x
67]
Matthias Klosec8b16f82010-01-31 16:14:37 +000068[
Senthil Kumarance3dd0b2013-06-19 22:19:46 -050069[
70.B \-X
71.I option
72]
Matthias Klosec8b16f82010-01-31 16:14:37 +000073.B \-?
74]
Guido van Rossum4cf4de51997-09-08 04:06:15 +000075.br
76 [
Benjamin Peterson42aa93b2017-12-09 10:26:52 -080077.B \--check-hash-based-pycs
78\'default\'|\'always\'|\'never\'
79]
80.br
81 [
Guido van Rossuma7925f11994-01-26 10:20:16 +000082.B \-c
83.I command
84|
85.I script
86|
87\-
88]
89[
90.I arguments
91]
92.SH DESCRIPTION
93Python is an interpreted, interactive, object-oriented programming
94language that combines remarkable power with very clear syntax.
Benjamin Petersonb0335ee2015-04-29 18:00:44 -040095For an introduction to programming in Python, see the Python Tutorial.
Guido van Rossuma7925f11994-01-26 10:20:16 +000096The Python Library Reference documents built-in and standard types,
97constants, functions and modules.
98Finally, the Python Reference Manual describes the syntax and
99semantics of the core language in (perhaps too) much detail.
Guido van Rossumf4a090d2000-09-01 20:36:34 +0000100(These documents may be located via the
101.B "INTERNET RESOURCES"
Fred Drake4c9be9d1999-08-20 13:10:20 +0000102below; they may be installed on your system as well.)
Guido van Rossuma7925f11994-01-26 10:20:16 +0000103.PP
104Python's basic power can be extended with your own modules written in
105C or C++.
Guido van Rossum74faed21996-07-30 19:27:05 +0000106On most systems such modules may be dynamically loaded.
Guido van Rossuma7925f11994-01-26 10:20:16 +0000107Python is also adaptable as an extension language for existing
108applications.
109See the internal documentation for hints.
Andrew M. Kuchling88717f42001-04-05 14:50:40 +0000110.PP
Brett Cannonf299abd2015-04-13 14:21:02 -0400111Documentation for installed Python modules and packages can be
112viewed by running the
Andrew M. Kuchling88717f42001-04-05 14:50:40 +0000113.B pydoc
Brett Cannonf299abd2015-04-13 14:21:02 -0400114program.
Guido van Rossuma7925f11994-01-26 10:20:16 +0000115.SH COMMAND LINE OPTIONS
116.TP
Matthias Klosec8b16f82010-01-31 16:14:37 +0000117.B \-B
118Don't write
Brett Cannon10a7dbd2016-10-21 12:15:14 -0700119.I .pyc
Matthias Klosec8b16f82010-01-31 16:14:37 +0000120files on import. See also PYTHONDONTWRITEBYTECODE.
121.TP
Senthil Kumarance3dd0b2013-06-19 22:19:46 -0500122.B \-b
123Issue warnings about str(bytes_instance), str(bytearray_instance)
124and comparing bytes/bytearray with str. (-bb: issue errors)
125.TP
Guido van Rossumb674baf2001-09-05 18:55:34 +0000126.BI "\-c " command
127Specify the command to execute (see next section).
128This terminates the option list (following options are passed as
129arguments to the command).
130.TP
Benjamin Peterson42aa93b2017-12-09 10:26:52 -0800131.BI "\-\-check-hash-based-pycs " mode
132Configure how Python evaluates the up-to-dateness of hash-based .pyc files.
133.TP
Guido van Rossuma7925f11994-01-26 10:20:16 +0000134.B \-d
Victor Stinner84c4b192017-11-24 22:30:27 +0100135Turn on parser debugging output (for expert only, depending on
Guido van Rossuma7925f11994-01-26 10:20:16 +0000136compilation options).
Guido van Rossum9f65ae01994-02-23 09:10:27 +0000137.TP
Guido van Rossumb674baf2001-09-05 18:55:34 +0000138.B \-E
139Ignore environment variables like PYTHONPATH and PYTHONHOME that modify
140the behavior of the interpreter.
141.TP
Matthias Klosec8b16f82010-01-31 16:14:37 +0000142.B \-h ", " \-? ", "\-\-help
Guido van Rossumb674baf2001-09-05 18:55:34 +0000143Prints the usage for the interpreter executable and exits.
144.TP
Guido van Rossuma7925f11994-01-26 10:20:16 +0000145.B \-i
146When a script is passed as first argument or the \fB\-c\fP option is
147used, enter interactive mode after executing the script or the
Guido van Rossum9f65ae01994-02-23 09:10:27 +0000148command. It does not read the $PYTHONSTARTUP file. This can be
149useful to inspect global variables or a stack trace when a script
150raises an exception.
Guido van Rossuma7925f11994-01-26 10:20:16 +0000151.TP
Christian Heimesad73a9c2013-08-10 16:36:18 +0200152.B \-I
Ned Deily64298ae2015-04-29 14:51:43 -0700153Run Python in isolated mode. This also implies \fB\-E\fP and \fB\-s\fP. In
Serhiy Storchaka225821c2015-12-18 13:05:04 +0200154isolated mode sys.path contains neither the script's directory nor the user's
Christian Heimesad73a9c2013-08-10 16:36:18 +0200155site-packages directory. All PYTHON* environment variables are ignored, too.
156Further restrictions may be imposed to prevent the user from injecting
157malicious code.
158.TP
Andrew M. Kuchling166e6252004-10-07 12:04:50 +0000159.BI "\-m " module-name
Brett Cannonf299abd2015-04-13 14:21:02 -0400160Searches
161.I sys.path
162for the named module and runs the corresponding
163.I .py
Andrew M. Kuchling166e6252004-10-07 12:04:50 +0000164file as a script.
165.TP
Guido van Rossum4cf4de51997-09-08 04:06:15 +0000166.B \-O
Cheryl Sabella186b6062018-02-24 22:04:40 -0500167Remove assert statements and any code conditional on the value of
168__debug__; augment the filename for compiled (bytecode) files by
169adding .opt-1 before the .pyc extension.
Guido van Rossum4cf4de51997-09-08 04:06:15 +0000170.TP
R David Murray9c4f09d2011-05-01 11:13:56 -0400171.B \-OO
Cheryl Sabella186b6062018-02-24 22:04:40 -0500172Do \fB-O\fP and also discard docstrings; change the filename for
173compiled (bytecode) files by adding .opt-2 before the .pyc extension.
Matthias Klosec8b16f82010-01-31 16:14:37 +0000174.TP
Georg Brandl9d871192010-12-04 10:47:18 +0000175.B \-q
Brett Cannonf299abd2015-04-13 14:21:02 -0400176Do not print the version and copyright messages. These messages are
Georg Brandl9d871192010-12-04 10:47:18 +0000177also suppressed in non-interactive mode.
178.TP
Matthias Klosec8b16f82010-01-31 16:14:37 +0000179.B \-s
180Don't add user site directory to sys.path.
181.TP
Guido van Rossum4cf4de51997-09-08 04:06:15 +0000182.B \-S
183Disable the import of the module
184.I site
185and the site-dependent manipulations of
186.I sys.path
Éric Araujoc09fca62011-03-23 02:06:24 +0100187that it entails. Also disable these manipulations if
188.I site
189is explicitly imported later.
Guido van Rossum4cf4de51997-09-08 04:06:15 +0000190.TP
Guido van Rossumef5bca31994-05-03 14:15:32 +0000191.B \-u
Berker Peksag7f580972017-10-13 15:16:31 +0300192Force the stdout and stderr streams to be unbuffered.
193This option has no effect on the stdin stream.
Guido van Rossuma7925f11994-01-26 10:20:16 +0000194.TP
195.B \-v
196Print a message each time a module is initialized, showing the place
Fred Drake4c9be9d1999-08-20 13:10:20 +0000197(filename or built-in module) from which it is loaded. When given
Brett Cannonf299abd2015-04-13 14:21:02 -0400198twice, print a message for each file that is checked for when
Fred Drake4c9be9d1999-08-20 13:10:20 +0000199searching for a module. Also provides information on module cleanup
200at exit.
Guido van Rossuma7925f11994-01-26 10:20:16 +0000201.TP
Matthias Klosec8b16f82010-01-31 16:14:37 +0000202.B \-V ", " \-\-version
INADA Naoki0e175a62016-11-21 20:57:14 +0900203Prints the Python version number of the executable and exits. When given
204twice, print more information about the build.
Barry Warsaw64569372000-09-15 18:39:09 +0000205.TP
Guido van Rossum1378c322000-12-19 03:21:54 +0000206.BI "\-W " argument
207Warning control. Python sometimes prints warning message to
208.IR sys.stderr .
209A typical warning message has the following form:
210.IB file ":" line ": " category ": " message.
211By default, each warning is printed once for each source line where it
212occurs. This option controls how often warnings are printed.
213Multiple
214.B \-W
215options may be given; when a warning matches more than one
216option, the action for the last matching option is performed.
217Invalid
218.B \-W
219options are ignored (a warning message is printed about invalid
220options when the first warning is issued). Warnings can also be
221controlled from within a Python program using the
222.I warnings
223module.
224
225The simplest form of
226.I argument
227is one of the following
228.I action
229strings (or a unique abbreviation):
230.B ignore
231to ignore all warnings;
232.B default
233to explicitly request the default behavior (printing each warning once
234per source line);
235.B all
236to print a warning each time it occurs (this may generate many
237messages if a warning is triggered repeatedly for the same source
Fred Drakebd2e3b02001-07-26 21:25:58 +0000238line, such as inside a loop);
Guido van Rossum1378c322000-12-19 03:21:54 +0000239.B module
Georg Brandleeb575f2009-06-24 06:42:05 +0000240to print each warning only the first time it occurs in each
Guido van Rossum1378c322000-12-19 03:21:54 +0000241module;
242.B once
243to print each warning only the first time it occurs in the program; or
244.B error
245to raise an exception instead of printing a warning message.
246
247The full form of
248.I argument
249is
250.IB action : message : category : module : line.
251Here,
252.I action
253is as explained above but only applies to messages that match the
254remaining fields. Empty fields match all values; trailing empty
255fields may be omitted. The
256.I message
257field matches the start of the warning message printed; this match is
258case-insensitive. The
259.I category
260field matches the warning category. This must be a class name; the
261match test whether the actual warning category of the message is a
262subclass of the specified warning category. The full class name must
263be given. The
264.I module
265field matches the (fully-qualified) module name; this match is
266case-sensitive. The
267.I line
268field matches the line number, where zero matches all line numbers and
269is thus equivalent to an omitted line number.
270.TP
Senthil Kumarance3dd0b2013-06-19 22:19:46 -0500271.BI "\-X " option
272Set implementation specific option.
273.TP
Guido van Rossumb674baf2001-09-05 18:55:34 +0000274.B \-x
275Skip the first line of the source. This is intended for a DOS
276specific hack only. Warning: the line numbers in error messages will
277be off by one!
Guido van Rossuma7925f11994-01-26 10:20:16 +0000278.SH INTERPRETER INTERFACE
279The interpreter interface resembles that of the UNIX shell: when
280called with standard input connected to a tty device, it prompts for
281commands and executes them until an EOF is read; when called with a
282file name argument or with a file as standard input, it reads and
283executes a
284.I script
285from that file;
286when called with
287.B \-c
doko@ubuntu.comd8623e82012-06-20 13:16:31 +0200288.IR command ,
Guido van Rossuma7925f11994-01-26 10:20:16 +0000289it executes the Python statement(s) given as
doko@ubuntu.comd8623e82012-06-20 13:16:31 +0200290.IR command .
Guido van Rossuma7925f11994-01-26 10:20:16 +0000291Here
292.I command
293may contain multiple statements separated by newlines.
294Leading whitespace is significant in Python statements!
Matthias Klose31a58df2005-03-20 14:16:03 +0000295In non-interactive mode, the entire input is parsed before it is
Guido van Rossuma7925f11994-01-26 10:20:16 +0000296executed.
297.PP
298If available, the script name and additional arguments thereafter are
299passed to the script in the Python variable
doko@ubuntu.comd8623e82012-06-20 13:16:31 +0200300.IR sys.argv ,
Guido van Rossuma7925f11994-01-26 10:20:16 +0000301which is a list of strings (you must first
302.I import sys
303to be able to access it).
304If no script name is given,
Guido van Rossumf4a090d2000-09-01 20:36:34 +0000305.I sys.argv[0]
306is an empty string; if
Guido van Rossuma7925f11994-01-26 10:20:16 +0000307.B \-c
308is used,
309.I sys.argv[0]
310contains the string
311.I '-c'.
Guido van Rossum74faed21996-07-30 19:27:05 +0000312Note that options interpreted by the Python interpreter itself
Guido van Rossuma7925f11994-01-26 10:20:16 +0000313are not placed in
doko@ubuntu.comd8623e82012-06-20 13:16:31 +0200314.IR sys.argv .
Guido van Rossuma7925f11994-01-26 10:20:16 +0000315.PP
316In interactive mode, the primary prompt is `>>>'; the second prompt
317(which appears when a command is not complete) is `...'.
318The prompts can be changed by assignment to
319.I sys.ps1
320or
doko@ubuntu.comd8623e82012-06-20 13:16:31 +0200321.IR sys.ps2 .
Guido van Rossuma7925f11994-01-26 10:20:16 +0000322The interpreter quits when it reads an EOF at a prompt.
323When an unhandled exception occurs, a stack trace is printed and
324control returns to the primary prompt; in non-interactive mode, the
325interpreter exits after printing the stack trace.
326The interrupt signal raises the
327.I Keyboard\%Interrupt
328exception; other UNIX signals are not caught (except that SIGPIPE is
329sometimes ignored, in favor of the
330.I IOError
331exception). Error messages are written to stderr.
332.SH FILES AND DIRECTORIES
333These are subject to difference depending on local installation
Fred Drake4c9be9d1999-08-20 13:10:20 +0000334conventions; ${prefix} and ${exec_prefix} are installation-dependent
335and should be interpreted as for GNU software; they may be the same.
336The default for both is \fI/usr/local\fP.
337.IP \fI${exec_prefix}/bin/python\fP
Guido van Rossuma7925f11994-01-26 10:20:16 +0000338Recommended location of the interpreter.
Fred Drake4c9be9d1999-08-20 13:10:20 +0000339.PP
340.I ${prefix}/lib/python<version>
341.br
342.I ${exec_prefix}/lib/python<version>
343.RS
344Recommended locations of the directories containing the standard
345modules.
346.RE
347.PP
348.I ${prefix}/include/python<version>
349.br
350.I ${exec_prefix}/include/python<version>
351.RS
352Recommended locations of the directories containing the include files
353needed for developing Python extensions and embedding the
354interpreter.
355.RE
Guido van Rossuma7925f11994-01-26 10:20:16 +0000356.SH ENVIRONMENT VARIABLES
Guido van Rossum4cf4de51997-09-08 04:06:15 +0000357.IP PYTHONHOME
358Change the location of the standard Python libraries. By default, the
Fred Drake4c9be9d1999-08-20 13:10:20 +0000359libraries are searched in ${prefix}/lib/python<version> and
360${exec_prefix}/lib/python<version>, where ${prefix} and ${exec_prefix}
Guido van Rossum4cf4de51997-09-08 04:06:15 +0000361are installation-dependent directories, both defaulting to
Fred Drake4c9be9d1999-08-20 13:10:20 +0000362\fI/usr/local\fP. When $PYTHONHOME is set to a single directory, its value
363replaces both ${prefix} and ${exec_prefix}. To specify different values
364for these, set $PYTHONHOME to ${prefix}:${exec_prefix}.
Guido van Rossuma7925f11994-01-26 10:20:16 +0000365.IP PYTHONPATH
366Augments the default search path for module files.
367The format is the same as the shell's $PATH: one or more directory
368pathnames separated by colons.
Matthias Klose31a58df2005-03-20 14:16:03 +0000369Non-existent directories are silently ignored.
Guido van Rossum4cf4de51997-09-08 04:06:15 +0000370The default search path is installation dependent, but generally
Fred Drake4c9be9d1999-08-20 13:10:20 +0000371begins with ${prefix}/lib/python<version> (see PYTHONHOME above).
Guido van Rossum4cf4de51997-09-08 04:06:15 +0000372The default search path is always appended to $PYTHONPATH.
Guido van Rossum74faed21996-07-30 19:27:05 +0000373If a script argument is given, the directory containing the script is
374inserted in the path in front of $PYTHONPATH.
Guido van Rossuma7925f11994-01-26 10:20:16 +0000375The search path can be manipulated from within a Python program as the
376variable
doko@ubuntu.comd8623e82012-06-20 13:16:31 +0200377.IR sys.path .
Guido van Rossuma7925f11994-01-26 10:20:16 +0000378.IP PYTHONSTARTUP
379If this is the name of a readable file, the Python commands in that
380file are executed before the first prompt is displayed in interactive
381mode.
382The file is executed in the same name space where interactive commands
383are executed so that objects defined or imported in it can be used
384without qualification in the interactive session.
385You can also change the prompts
386.I sys.ps1
387and
388.I sys.ps2
389in this file.
Guido van Rossum9abaf4d2001-10-12 22:17:56 +0000390.IP PYTHONOPTIMIZE
391If this is set to a non-empty string it is equivalent to specifying
392the \fB\-O\fP option. If set to an integer, it is equivalent to
393specifying \fB\-O\fP multiple times.
Guido van Rossuma7925f11994-01-26 10:20:16 +0000394.IP PYTHONDEBUG
395If this is set to a non-empty string it is equivalent to specifying
Guido van Rossum9abaf4d2001-10-12 22:17:56 +0000396the \fB\-d\fP option. If set to an integer, it is equivalent to
397specifying \fB\-d\fP multiple times.
Matthias Klosec8b16f82010-01-31 16:14:37 +0000398.IP PYTHONDONTWRITEBYTECODE
399If this is set to a non-empty string it is equivalent to specifying
400the \fB\-B\fP option (don't try to write
Brett Cannon10a7dbd2016-10-21 12:15:14 -0700401.I .pyc
Matthias Klosec8b16f82010-01-31 16:14:37 +0000402files).
Guido van Rossuma7925f11994-01-26 10:20:16 +0000403.IP PYTHONINSPECT
404If this is set to a non-empty string it is equivalent to specifying
405the \fB\-i\fP option.
Benjamin Petersonee85a1d2010-10-13 22:20:15 +0000406.IP PYTHONIOENCODING
407If this is set before running the interpreter, it overrides the encoding used
408for stdin/stdout/stderr, in the syntax
409.IB encodingname ":" errorhandler
410The
411.IB errorhandler
412part is optional and has the same meaning as in str.encode. For stderr, the
413.IB errorhandler
414 part is ignored; the handler will always be \'backslashreplace\'.
Matthias Klosec8b16f82010-01-31 16:14:37 +0000415.IP PYTHONNOUSERSITE
Benjamin Petersonee85a1d2010-10-13 22:20:15 +0000416If this is set to a non-empty string it is equivalent to specifying the
417\fB\-s\fP option (Don't add the user site directory to sys.path).
Guido van Rossumef5bca31994-05-03 14:15:32 +0000418.IP PYTHONUNBUFFERED
Guido van Rossuma7925f11994-01-26 10:20:16 +0000419If this is set to a non-empty string it is equivalent to specifying
Guido van Rossumef5bca31994-05-03 14:15:32 +0000420the \fB\-u\fP option.
Guido van Rossuma7925f11994-01-26 10:20:16 +0000421.IP PYTHONVERBOSE
422If this is set to a non-empty string it is equivalent to specifying
Guido van Rossum9abaf4d2001-10-12 22:17:56 +0000423the \fB\-v\fP option. If set to an integer, it is equivalent to
Brett Cannonf299abd2015-04-13 14:21:02 -0400424specifying \fB\-v\fP multiple times.
Philip Jenvey0805ca32010-04-07 04:04:10 +0000425.IP PYTHONWARNINGS
426If this is set to a comma-separated string it is equivalent to
427specifying the \fB\-W\fP option for each separate value.
Georg Brandl2daf6ae2012-02-20 19:54:16 +0100428.IP PYTHONHASHSEED
Benjamin Petersonc9f54cf2012-02-21 16:08:05 -0500429If this variable is set to "random", a random value is used to seed the hashes
430of str, bytes and datetime objects.
Georg Brandl2daf6ae2012-02-20 19:54:16 +0100431
432If PYTHONHASHSEED is set to an integer value, it is used as a fixed seed for
433generating the hash() of the types covered by the hash randomization. Its
434purpose is to allow repeatable hashing, such as for selftests for the
435interpreter itself, or to allow a cluster of python processes to share hash
436values.
437
438The integer must be a decimal number in the range [0,4294967295]. Specifying
Benjamin Petersonc9f54cf2012-02-21 16:08:05 -0500439the value 0 will disable hash randomization.
Berker Peksag9863de02018-07-09 22:17:54 +0300440.IP PYTHONMALLOC
441Set the Python memory allocators and/or install debug hooks. The available
442memory allocators are
443.IR malloc
444and
445.IR pymalloc .
446The available debug hooks are
447.IR debug ,
448.IR malloc_debug ,
449and
450.IR pymalloc_debug .
451.IP
452When Python is compiled in debug mode, the default is
453.IR pymalloc_debug
454and the debug hooks are automatically used. Otherwise, the default is
455.IR pymalloc .
456.IP PYTHONMALLOCSTATS
457If set to a non-empty string, Python will print statistics of the pymalloc
458memory allocator every time a new pymalloc object arena is created, and on
459shutdown.
460.IP
461This variable is ignored if the
462.RB $ PYTHONMALLOC
463environment variable is used to force the
464.BR malloc (3)
465allocator of the C library, or if Python is configured without pymalloc support.
466.IP PYTHONASYNCIODEBUG
467If this environment variable is set to a non-empty string, enable the debug
468mode of the asyncio module.
469.IP PYTHONTRACEMALLOC
470If this environment variable is set to a non-empty string, start tracing
471Python memory allocations using the tracemalloc module.
472.IP
473The value of the variable is the maximum number of frames stored in a
474traceback of a trace. For example,
475.IB PYTHONTRACEMALLOC=1
476stores only the most recent frame.
477.IP PYTHONFAULTHANDLER
478If this environment variable is set to a non-empty string,
479.IR faulthandler.enable()
480is called at startup: install a handler for SIGSEGV, SIGFPE, SIGABRT, SIGBUS
481and SIGILL signals to dump the Python traceback.
482.IP
483This is equivalent to the \fB-X faulthandler\fP option.
484.IP PYTHONEXECUTABLE
485If this environment variable is set,
486.IB sys.argv[0]
487will be set to its value instead of the value got through the C runtime. Only
488works on Mac OS X.
489.IP PYTHONUSERBASE
490Defines the user base directory, which is used to compute the path of the user
491.IR site-packages
492directory and Distutils installation paths for
493.IR "python setup\.py install \-\-user" .
494.IP PYTHONPROFILEIMPORTTIME
495If this environment variable is set to a non-empty string, Python will
496show how long each import takes. This is exactly equivalent to setting
497\fB\-X importtime\fP on the command line.
Stéphane Wirtelb7fd7382018-07-29 12:27:16 +0200498.IP PYTHONBREAKPOINT
499If this environment variable is set to 0, it disables the default debugger. It
500can be set to the callable of your debugger of choice.
Berker Peksag9863de02018-07-09 22:17:54 +0300501.SS Debug-mode variables
502Setting these variables only has an effect in a debug build of Python, that is,
503if Python was configured with the
504\fB\--with-pydebug\fP build option.
505.IP PYTHONTHREADDEBUG
506If this environment variable is set, Python will print threading debug info.
507.IP PYTHONDUMPREFS
508If this environment variable is set, Python will dump objects and reference
509counts still alive after shutting down the interpreter.
Guido van Rossuma7925f11994-01-26 10:20:16 +0000510.SH AUTHOR
Benjamin Peterson37c4f782015-05-10 21:19:18 -0400511The Python Software Foundation: https://www.python.org/psf/
Guido van Rossum74faed21996-07-30 19:27:05 +0000512.SH INTERNET RESOURCES
Benjamin Peterson755640b2015-04-30 17:37:11 -0400513Main website: https://www.python.org/
Guido van Rossum74faed21996-07-30 19:27:05 +0000514.br
Benjamin Peterson755640b2015-04-30 17:37:11 -0400515Documentation: https://docs.python.org/
Guido van Rossumf4a090d2000-09-01 20:36:34 +0000516.br
Lisa Hewus Fresh384899d2017-08-30 09:37:43 -0700517Developer resources: https://devguide.python.org/
Guido van Rossumf4a090d2000-09-01 20:36:34 +0000518.br
Benjamin Peterson755640b2015-04-30 17:37:11 -0400519Downloads: https://www.python.org/downloads/
Guido van Rossumf4a090d2000-09-01 20:36:34 +0000520.br
Ned Deily9d6d06e2018-06-11 00:45:50 -0400521Module repository: https://pypi.org/
Guido van Rossum74faed21996-07-30 19:27:05 +0000522.br
Fred Drakebd2e3b02001-07-26 21:25:58 +0000523Newsgroups: comp.lang.python, comp.lang.python.announce
Guido van Rossumf4a090d2000-09-01 20:36:34 +0000524.SH LICENSING
525Python is distributed under an Open Source license. See the file
526"LICENSE" in the Python source distribution for information on terms &
527conditions for accessing and otherwise using Python and for a
528DISCLAIMER OF ALL WARRANTIES.