Debian Codegraph @

upstream/debian-unstable/man1/python3.14.1

raw
1 .TH PYTHON "1"
2
3 .\" To view this file while editing, run it through groff:
4 .\" groff -Tascii -man python.man | less
5
6 .SH NAME
7 python \- an interpreted, interactive, object-oriented programming language
8 .SH SYNOPSIS
9 .B python
10 [
11 .B \-B
12 ]
13 [
14 .B \-b
15 ]
16 [
17 .B \-d
18 ]
19 [
20 .B \-E
21 ]
22 [
23 .B \-h
24 ]
25 [
26 .B \-i
27 ]
28 [
29 .B \-I
30 ]
31 .br
32 [
33 .B \-m
34 .I module-name
35 ]
36 [
37 .B \-q
38 ]
39 [
40 .B \-R
41 ]
42 [
43 .B \-O
44 ]
45 [
46 .B \-OO
47 ]
48 [
49 .B \-P
50 ]
51 [
52 .B \-s
53 ]
54 [
55 .B \-S
56 ]
57 [
58 .B \-u
59 ]
60 .br
61 [
62 .B \-v
63 ]
64 [
65 .B \-V
66 ]
67 [
68 .B \-W
69 .I argument
70 ]
71 [
72 .B \-x
73 ]
74 [
75 .B \-X
76 .I option
77 ]
78 [
79 .B \-?
80 ]
81 .br
82 [
83 .B \-\-check-hash-based-pycs
84 .I default
85 |
86 .I always
87 |
88 .I never
89 ]
90 .br
91 [
92 .B \-\-help
93 ]
94 [
95 .B \-\-help\-env
96 ]
97 [
98 .B \-\-help\-xoptions
99 ]
100 [
101 .B \-\-help\-all
102 ]
103 .br
104 [
105 .B \-c
106 .I command
107 |
108 .I script
109 |
110 \-
111 ]
112 [
113 .I arguments
114 ]
115 .SH DESCRIPTION
116 Python is an interpreted, interactive, object-oriented programming
117 language that combines remarkable power with very clear syntax.
118 For an introduction to programming in Python, see the Python Tutorial.
119 The Python Library Reference documents built-in and standard types,
120 constants, functions and modules.
121 Finally, the Python Reference Manual describes the syntax and
122 semantics of the core language in (perhaps too) much detail.
123 (These documents may be located via the
124 .B "INTERNET RESOURCES"
125 below; they may be installed on your system as well.)
126 .PP
127 Python's basic power can be extended with your own modules written in
128 C or C++.
129 On most systems such modules may be dynamically loaded.
130 Python is also adaptable as an extension language for existing
131 applications.
132 See the internal documentation for hints.
133 .PP
134 Documentation for installed Python modules and packages can be
135 viewed by running the
136 .B pydoc
137 program.
138 .SH COMMAND LINE OPTIONS
139 .TP
140 .B \-B
141 Don't write
142 .I .pyc
143 files on import. See also PYTHONDONTWRITEBYTECODE.
144 .TP
145 .B \-b
146 Issue warnings about str(bytes_instance), str(bytearray_instance)
147 and comparing bytes/bytearray with str. (\-bb: issue errors)
148 .TP
149 .BI "\-c " command
150 Specify the command to execute (see next section).
151 This terminates the option list (following options are passed as
152 arguments to the command).
153 .TP
154 .BI "\-\-check\-hash\-based\-pycs " mode
155 Configure how Python evaluates the up-to-dateness of hash-based .pyc files.
156 .TP
157 .B \-d
158 Turn on parser debugging output (for expert only, depending on
159 compilation options).
160 .TP
161 .B \-E
162 Ignore environment variables like PYTHONPATH and PYTHONHOME that modify
163 the behavior of the interpreter.
164 .TP
165 .BR \-h ", " \-? ", " \-\-help
166 Prints the usage for the interpreter executable and exits.
167 .TP
168 .B "\-\-help\-env"
169 Prints help about Python-specific environment variables and exits.
170 .TP
171 .B "\-\-help\-xoptions"
172 Prints help about implementation-specific \fB\-X\fP options and exits.
173 .TP
174 .B "\-\-help\-all"
175 Prints complete usage information and exits.
176 .TP
177 .B \-i
178 When a script is passed as first argument or the \fB\-c\fP option is
179 used, enter interactive mode after executing the script or the
180 command. It does not read the $PYTHONSTARTUP file. This can be
181 useful to inspect global variables or a stack trace when a script
182 raises an exception.
183 .TP
184 .B \-I
185 Run Python in isolated mode. This also implies \fB\-E\fP, \fB\-P\fP and \fB\-s\fP. In
186 isolated mode sys.path contains neither the script's directory nor the user's
187 site\-packages directory. All PYTHON* environment variables are ignored, too.
188 Further restrictions may be imposed to prevent the user from injecting
189 malicious code.
190 .TP
191 .BI "\-m " module-name
192 Searches
193 .I sys.path
194 for the named module and runs the corresponding
195 .I .py
196 file as a script. This terminates the option list (following options
197 are passed as arguments to the module).
198 .TP
199 .B \-O
200 Remove assert statements and any code conditional on the value of
201 __debug__; augment the filename for compiled (bytecode) files by
202 adding .opt-1 before the .pyc extension.
203 .TP
204 .B \-OO
205 Do \fB\-O\fP and also discard docstrings; change the filename for
206 compiled (bytecode) files by adding .opt-2 before the .pyc extension.
207 .TP
208 .B \-P
209 Don't automatically prepend a potentially unsafe path to \fBsys.path\fP such
210 as the current directory, the script's directory or an empty string. See also the
211 \fBPYTHONSAFEPATH\fP environment variable.
212 .TP
213 .B \-q
214 Do not print the version and copyright messages. These messages are
215 also suppressed in non-interactive mode.
216 .TP
217 .B \-R
218 Turn on hash randomization. This option only has an effect if the
219 \fBPYTHONHASHSEED\fR environment variable is set to \fB0\fR, since hash
220 randomization is enabled by default.
221 .TP
222 .B \-s
223 Don't add user site directory to sys.path.
224 .TP
225 .B \-S
226 Disable the import of the module
227 .I site
228 and the site-dependent manipulations of
229 .I sys.path
230 that it entails. Also disable these manipulations if
231 .I site
232 is explicitly imported later.
233 .TP
234 .B \-u
235 Force the stdout and stderr streams to be unbuffered.
236 This option has no effect on the stdin stream.
237 .TP
238 .B \-v
239 Print a message each time a module is initialized, showing the place
240 (filename or built-in module) from which it is loaded. When given
241 twice, print a message for each file that is checked for when
242 searching for a module. Also provides information on module cleanup
243 at exit.
244 .TP
245 .BR \-V ", " \-\-version
246 Prints the Python version number of the executable and exits. When given
247 twice, print more information about the build.
248
249 .TP
250 .BI "\-W " argument
251 Warning control. Python's warning machinery by default prints warning messages
252 to
253 .IR sys.stderr .
254
255 The simplest settings apply a particular action unconditionally to all warnings
256 emitted by a process (even those that are otherwise ignored by default):
257
258 .nf
259 \-Wdefault # Warn once per call location
260 \-Werror # Convert to exceptions
261 \-Walways # Warn every time
262 \-Wall # Same as \-Walways
263 \-Wmodule # Warn once per calling module
264 \-Wonce # Warn once per Python process
265 \-Wignore # Never warn
266 .fi
267
268 The action names can be abbreviated as desired and the interpreter will resolve
269 them to the appropriate action name. For example,
270 .B \-Wi
271 is the same as
272 .BR \-Wignore .
273
274 The full form of argument is:
275 .IB action : message : category : module : lineno
276
277 Empty fields match all values; trailing empty fields may be omitted. For
278 example
279 .B \-W ignore::DeprecationWarning
280 ignores all DeprecationWarning warnings.
281
282 The
283 .I action
284 field is as explained above but only applies to warnings that match
285 the remaining fields.
286
287 The
288 .I message
289 field must match the whole printed warning message; this match is
290 case-insensitive.
291
292 The
293 .I category
294 field matches the warning category (ex: "DeprecationWarning"). This must be a
295 class name; the match test whether the actual warning category of the message
296 is a subclass of the specified warning category.
297
298 The
299 .I module
300 field matches the (fully-qualified) module name; this match is case-sensitive.
301
302 The
303 .I lineno
304 field matches the line number, where zero matches all line numbers and is thus
305 equivalent to an omitted line number.
306
307 Multiple
308 .B \-W
309 options can be given; when a warning matches more than one option, the action
310 for the last matching option is performed. Invalid
311 .B \-W
312 options are ignored (though, a warning message is printed about invalid options
313 when the first warning is issued).
314
315 Warnings can also be controlled using the
316 .B PYTHONWARNINGS
317 environment variable and from within a Python program using the warnings
318 module. For example, the warnings.filterwarnings() function can be used to use
319 a regular expression on the warning message.
320
321 .TP
322 .BI "\-X " option
323 Set implementation-specific option. The following options are available:
324 .RS
325 .TP
326 \fB\-X cpu_count=\fIN\fR
327 Override the return value of \fIos.cpu_count()\fR.
328 \fB\-X cpu_count=default\fR cancels overriding.
329 See also \fBPYTHON_CPU_COUNT\fR.
330 .TP
331 \fB\-X dev\fR
332 Enable CPython's "development mode", introducing additional
333 runtime checks which are too expensive to be enabled by default. It
334 will not be more verbose than the default if the code is correct: new
335 warnings are only emitted when an issue is detected. Effect of the
336 developer mode:
337 .RS
338 .IP \(bu 2
339 Add default warning filter, as \fB\-W default\fR.
340 .IP \(bu 2
341 Install debug hooks on memory allocators: see the
342 PyMem_SetupDebugHooks() C function.
343 .IP \(bu 2
344 Enable the faulthandler module to dump the Python traceback on a crash.
345 .IP \(bu 2
346 Enable asyncio debug mode.
347 .IP \(bu 2
348 Set the dev_mode attribute of sys.flags to True.
349 .IP \(bu 2
350 io.IOBase destructor logs close() exceptions.
351 .RE
352 .TP
353 \fB\-X importtime\fR
354 Show how long each import takes. It shows module name,
355 cumulative time (including nested imports) and self time (excluding
356 nested imports). Note that its output may be broken in multi-threaded
357 application. Typical usage is
358 \fBpython3 \-X importtime \-c 'import asyncio'\fR.
359 .IP
360 \fB\-X importtime=2\fR enables additional output that indicates when an
361 imported module has already been loaded. In such cases, the string
362 \fBcached\fR will be printed in both time columns.
363 .TP
364 \fB\-X faulthandler\fR
365 Enable faulthandler.
366 .TP
367 \fB\-X frozen_modules=\fR[\fBon\fR|\fBoff\fR]
368 Whether or not frozen modules should be used.
369 The default is "on" (or "off" if you are running a local build).
370 .TP
371 \fB\-X gil=\fR[\fB0\fR|\fB1\fR]
372 Enable (1) or disable (0) the GIL. See also \fBPYTHON_GIL\fR.
373 Only available in builds configured with \fB\-\-disable\-gil\fR.
374 .TP
375 \fB\-X int_max_str_digits=\fInumber\fR
376 Limit the size of int<->str conversions.
377 This helps avoid denial of service attacks when parsing untrusted data.
378 The default is sys.int_info.default_max_str_digits. 0 disables.
379 .TP
380 \fB\-X no_debug_ranges\fR
381 Disable the inclusion of the tables mapping extra
382 location information (end line, start column offset and end column
383 offset) to every instruction in code objects. This is useful when
384 smaller code objects and pyc files are desired as well as suppressing
385 the extra visual location indicators when the interpreter displays
386 tracebacks.
387 .TP
388 \fB\-X perf\fR
389 Support the Linux "perf" profiler. See also \fBPYTHONPERFSUPPORT=1\fR.
390 .TP
391 \fB\-X perf_jit\fR
392 Support the Linux "perf" profiler with DWARF support.
393 See also \fBPYTHON_PERF_JIT_SUPPORT=1\fR.
394 .TP
395 \fB\-X presite=\fIMOD\fR
396 Import this module before site. See also \fBPYTHON_PRESITE\fR.
397 This only works on debug builds.
398 .TP
399 \fB\-X pycache_prefix=\fIPATH\fR
400 Enable writing .pyc files to a parallel
401 tree rooted at the given directory instead of to the code tree.
402 .TP
403 \fB\-X showrefcount\fR
404 Output the total reference count and number of used
405 memory blocks when the program finishes or after each statement in the
406 interactive interpreter. This only works on debug builds.
407 .TP
408 \fB\-X tracemalloc\fR
409 Start tracing Python memory allocations using the
410 tracemalloc module. By default, only the most recent frame is stored in a
411 traceback of a trace. Use \fB\-X tracemalloc=\fINFRAME\fR to start tracing with a
412 traceback limit of NFRAME frames.
413 .TP
414 \fB\-X utf8\fR
415 Enable UTF-8 mode for operating system interfaces,
416 overriding the default locale-aware mode. \fB\-X utf8=0\fR explicitly
417 disables UTF-8 mode (even when it would otherwise activate
418 automatically). See \fBPYTHONUTF8\fR for more details.
419 .TP
420 \fB\-X warn_default_encoding\fR
421 Enable opt-in EncodingWarning for 'encoding=None'.
422 .RE
423 .TP
424 .B \-x
425 Skip the first line of the source. This is intended for a DOS
426 specific hack only. Warning: the line numbers in error messages will
427 be off by one!
428 .SH INTERPRETER INTERFACE
429 The interpreter interface resembles that of the UNIX shell: when
430 called with standard input connected to a tty device, it prompts for
431 commands and executes them until an EOF is read; when called with a
432 file name argument or with a file as standard input, it reads and
433 executes a
434 .I script
435 from that file;
436 when called with
437 .B \-c
438 .IR command ,
439 it executes the Python statement(s) given as
440 .IR command .
441 Here
442 .I command
443 may contain multiple statements separated by newlines.
444 Leading whitespace is significant in Python statements!
445 In non-interactive mode, the entire input is parsed before it is
446 executed.
447 .PP
448 If available, the script name and additional arguments thereafter are
449 passed to the script in the Python variable
450 .IR sys.argv ,
451 which is a list of strings (you must first
452 .I import sys
453 to be able to access it).
454 If no script name is given,
455 .I sys.argv[0]
456 is an empty string; if
457 .B \-c
458 is used,
459 .I sys.argv[0]
460 contains the string
461 .RI ' \-c "' ."
462 Note that options interpreted by the Python interpreter itself
463 are not placed in
464 .IR sys.argv .
465 .PP
466 In interactive mode, the primary prompt is `>>>'; the second prompt
467 (which appears when a command is not complete) is `...'.
468 The prompts can be changed by assignment to
469 .I sys.ps1
470 or
471 .IR sys.ps2 .
472 The interpreter quits when it reads an EOF at a prompt.
473 When an unhandled exception occurs, a stack trace is printed and
474 control returns to the primary prompt; in non-interactive mode, the
475 interpreter exits after printing the stack trace.
476 The interrupt signal raises the
477 .I Keyboard\%Interrupt
478 exception; other UNIX signals are not caught (except that SIGPIPE is
479 sometimes ignored, in favor of the
480 .I IOError
481 exception). Error messages are written to stderr.
482 .SH FILES AND DIRECTORIES
483 These are subject to difference depending on local installation
484 conventions; ${prefix} and ${exec_prefix} are installation-dependent
485 and should be interpreted as for GNU software; they may be the same.
486 On Debian GNU/{Hurd,Linux} the default for both is \fI/usr\fP.
487 .IP \fI${exec_prefix}/bin/python\fP
488 Recommended location of the interpreter.
489 .PP
490 .I ${prefix}/lib/python<version>
491 .br
492 .I ${exec_prefix}/lib/python<version>
493 .RS
494 Recommended locations of the directories containing the standard
495 modules.
496 .RE
497 .PP
498 .I ${prefix}/include/python<version>
499 .br
500 .I ${exec_prefix}/include/python<version>
501 .RS
502 Recommended locations of the directories containing the include files
503 needed for developing Python extensions and embedding the
504 interpreter.
505 .RE
506 .SH ENVIRONMENT VARIABLES
507 .IP PYTHONASYNCIODEBUG
508 If this environment variable is set to a non-empty string, enable the debug
509 mode of the asyncio module.
510 .IP PYTHON_BASIC_REPL
511 If this variable is set to any value, the interpreter will not attempt to
512 load the Python-based REPL that requires curses and readline, and will instead
513 use the traditional parser-based REPL.
514 .IP PYTHONBREAKPOINT
515 If this environment variable is set to 0, it disables the default debugger. It
516 can be set to the callable of your debugger of choice.
517 .IP PYTHONCOERCECLOCALE
518 If set to the value 0, causes the main Python command line application to skip
519 coercing the legacy ASCII-based C and POSIX locales to a more capable UTF-8
520 based alternative.
521 .IP PYTHON_COLORS
522 If this variable is set to 1, the interpreter will colorize various kinds of
523 output. Setting it to 0 deactivates this behavior.
524 .IP PYTHON_CPU_COUNT
525 If this variable is set to a positive integer, it overrides the return
526 values of \fIos.cpu_count\fR and \fIos.process_cpu_count\fR.
527 .IP
528 See also the \fB\-X cpu_count\fR option.
529 .IP PYTHONDEBUG
530 If this is set to a non-empty string it is equivalent to specifying
531 the \fB\-d\fP option. If set to an integer, it is equivalent to
532 specifying \fB\-d\fP multiple times.
533 .IP PYTHONEXECUTABLE
534 If this environment variable is set,
535 .IB sys.argv[0]
536 will be set to its value instead of the value got through the C runtime. Only
537 works on Mac OS X.
538 .IP PYTHONFAULTHANDLER
539 If this environment variable is set to a non-empty string,
540 .IR faulthandler.enable()
541 is called at startup: install a handler for SIGSEGV, SIGFPE, SIGABRT, SIGBUS
542 and SIGILL signals to dump the Python traceback.
543 .IP
544 This is equivalent to the \fB\-X faulthandler\fP option.
545 .IP PYTHON_FROZEN_MODULES
546 If this variable is set to \fBon\fR or \fBoff\fR, it determines whether or not
547 frozen modules are ignored by the import machinery. A value of \fBon\fR means
548 they get imported and \fBoff\fR means they are ignored. The default is \fBon\fR
549 for non-debug builds (the normal case) and \fBoff\fR for debug builds.
550 .IP
551 See also the \fB\-X frozen_modules\fR option.
552 .IP PYTHON_GIL
553 If this variable is set to 1, the global interpreter lock (GIL) will be forced
554 on. Setting it to 0 forces the GIL off. Only available in builds configured
555 with \fB\-\-disable\-gil\fP.
556 .IP
557 This is equivalent to the \fB\-X gil\fR option.
558 .IP PYTHON_HISTORY
559 This environment variable can be used to set the location of a history file
560 (on Unix, it is \fI~/.python_history\fP by default).
561 .IP PYTHONNODEBUGRANGES
562 If this variable is set, it disables the inclusion of the tables mapping
563 extra location information (end line, start column offset and end column
564 offset) to every instruction in code objects. This is useful when smaller code
565 objects and pyc files are desired as well as suppressing the extra visual
566 location indicators when the interpreter displays tracebacks.
567 .IP PYTHONDONTWRITEBYTECODE
568 If this is set to a non-empty string it is equivalent to specifying
569 the \fB\-B\fP option (don't try to write
570 .I .pyc
571 files).
572 .IP PYTHONDEVMODE
573 If this environment variable is set to a non-empty string, enable Python's
574 "development mode", introducing additional runtime checks that are too
575 expensive to be enabled by default.
576 .IP
577 This is equivalent to the \fB\-X dev\fR option.
578 .IP PYTHONHASHSEED
579 If this variable is set to "random", a random value is used to seed the hashes
580 of str and bytes objects.
581
582 If PYTHONHASHSEED is set to an integer value, it is used as a fixed seed for
583 generating the hash() of the types covered by the hash randomization. Its
584 purpose is to allow repeatable hashing, such as for selftests for the
585 interpreter itself, or to allow a cluster of python processes to share hash
586 values.
587
588 The integer must be a decimal number in the range [0,4\|294\|967\|295].
589 Specifying the value 0 will disable hash randomization.
590 .IP PYTHONHOME
591 Change the location of the standard Python libraries. By default, the
592 libraries are searched in ${prefix}/lib/python<version> and
593 ${exec_prefix}/lib/python<version>, where ${prefix} and ${exec_prefix}
594 are installation-dependent directories, both defaulting to
595 \fI/usr/local\fP. When $PYTHONHOME is set to a single directory, its value
596 replaces both ${prefix} and ${exec_prefix}. To specify different values
597 for these, set $PYTHONHOME to ${prefix}:${exec_prefix}.
598 .IP PYTHONINSPECT
599 If this is set to a non-empty string it is equivalent to specifying
600 the \fB\-i\fP option.
601 .IP PYTHONINTMAXSTRDIGITS
602 Limit the maximum digit characters in an int value
603 when converting from a string and when converting an int back to a str.
604 A value of 0 disables the limit. Conversions to or from bases 2, 4, 8,
605 16, and 32 are never limited.
606 .IP
607 This is equivalent to the \fB\-X int_max_str_digits=\fINUMBER\fR option.
608 .IP PYTHONIOENCODING
609 If this is set before running the interpreter, it overrides the encoding used
610 for stdin/stdout/stderr, in the syntax
611 .IB encodingname : errorhandler
612 The
613 .IB errorhandler
614 part is optional and has the same meaning as in str.encode. For stderr, the
615 .IB errorhandler
616 part is ignored; the handler will always be \'backslashreplace\'.
617 .IP PYTHONMALLOC
618 Set the Python memory allocators and/or install debug hooks. The available
619 memory allocators are
620 .IR malloc
621 and
622 .IR pymalloc .
623 The available debug hooks are
624 .IR debug ,
625 .IR malloc_debug ,
626 and
627 .IR pymalloc_debug .
628 .IP
629 When Python is compiled in debug mode, the default is
630 .IR pymalloc_debug
631 and the debug hooks are automatically used. Otherwise, the default is
632 .IR pymalloc .
633 .IP PYTHONMALLOCSTATS
634 If set to a non-empty string, Python will print statistics of the pymalloc
635 memory allocator every time a new pymalloc object arena is created, and on
636 shutdown.
637 .IP
638 This variable is ignored if the
639 .RB $ PYTHONMALLOC
640 environment variable is used to force the
641 .BR malloc (3)
642 allocator of the C library, or if Python is configured without pymalloc support.
643 .IP PYTHONNOUSERSITE
644 If this is set to a non-empty string it is equivalent to specifying the
645 \fB\-s\fP option (Don't add the user site directory to sys.path).
646 .IP PYTHONOPTIMIZE
647 If this is set to a non-empty string it is equivalent to specifying
648 the \fB\-O\fP option. If set to an integer, it is equivalent to
649 specifying \fB\-O\fP multiple times.
650 .IP PYTHONPATH
651 Augments the default search path for module files.
652 The format is the same as the shell's $PATH: one or more directory
653 pathnames separated by colons.
654 Non-existent directories are silently ignored.
655 The default search path is installation dependent, but generally
656 begins with ${prefix}/lib/python<version> (see PYTHONHOME above).
657 The default search path is always appended to $PYTHONPATH.
658 If a script argument is given, the directory containing the script is
659 inserted in the path in front of $PYTHONPATH.
660 The search path can be manipulated from within a Python program as the
661 variable
662 .IR sys.path .
663 .IP PYTHON_PERF_JIT_SUPPORT
664 If this variable is set to a nonzero value, it enables support for
665 the Linux perf profiler so Python calls can be detected by it using DWARF
666 information.
667 Setting to 0 disables.
668 .IP
669 See also the \fB\-X perf_jit\fR option.
670 .IP PYTHONPERFSUPPORT
671 If this variable is set to a nonzero value, it enables support for
672 the Linux perf profiler so Python calls can be detected by it.
673 Setting to 0 disables.
674 .IP
675 See also the \fB\-X perf\fR option.
676 .IP PYTHONPLATLIBDIR
677 Override sys.platlibdir.
678 .IP PYTHONPROFILEIMPORTTIME
679 If this environment variable is set to \fB1\fR, Python will show
680 how long each import takes. If set to \fB2\fR, Python will include output for
681 imported modules that have already been loaded.
682 This is exactly equivalent to setting \fB\-X importtime\fP on the command line.
683 .IP PYTHONPYCACHEPREFIX
684 If this is set, Python will write \fB.pyc\fR files in a mirror directory tree
685 at this path, instead of in \fB__pycache__\fR directories within the source
686 tree.
687 .IP
688 This is equivalent to specifying the \fB\-X pycache_prefix=\fIPATH\fR option.
689 .IP PYTHONSAFEPATH
690 If this is set to a non-empty string, don't automatically prepend a potentially
691 unsafe path to \fBsys.path\fP such as the current directory, the script's
692 directory or an empty string. See also the \fB\-P\fP option.
693 .IP PYTHONSTARTUP
694 If this is the name of a readable file, the Python commands in that
695 file are executed before the first prompt is displayed in interactive
696 mode.
697 The file is executed in the same name space where interactive commands
698 are executed so that objects defined or imported in it can be used
699 without qualification in the interactive session.
700 You can also change the prompts
701 .I sys.ps1
702 and
703 .I sys.ps2
704 in this file.
705 .IP PYTHONTRACEMALLOC
706 If this environment variable is set to a non-empty string, start tracing
707 Python memory allocations using the tracemalloc module.
708 .IP
709 The value of the variable is the maximum number of frames stored in a
710 traceback of a trace. For example,
711 .IB PYTHONTRACEMALLOC=1
712 stores only the most recent frame.
713 .IP PYTHONUNBUFFERED
714 If this is set to a non-empty string it is equivalent to specifying
715 the \fB\-u\fP option.
716 .IP PYTHONUSERBASE
717 Defines the user base directory, which is used to compute the path of the user
718 .IR site\-packages
719 directory and installation paths for
720 .IR "python \-m pip install \-\-user" .
721 .IP PYTHONUTF8
722 If set to 1, enable the Python "UTF-8 Mode". Setting to 0 disables.
723 .IP PYTHONVERBOSE
724 If this is set to a non-empty string it is equivalent to specifying
725 the \fB\-v\fP option. If set to an integer, it is equivalent to
726 specifying \fB\-v\fP multiple times.
727 .IP PYTHONWARNDEFAULTENCODING
728 If this environment variable is set to a non-empty string, issue a
729 \fIEncodingWarning\fR when the locale-specific default encoding is used.
730 .IP PYTHONWARNINGS
731 If this is set to a comma-separated string it is equivalent to
732 specifying the \fB\-W\fP option for each separate value.
733 .SS Debug-mode variables
734 Setting these variables only has an effect in a debug build of Python, that is,
735 if Python was configured with the
736 \fB\-\-with\-pydebug\fP build option.
737 .IP PYTHONDUMPREFS
738 If this environment variable is set, Python will dump objects and reference
739 counts still alive after shutting down the interpreter.
740 .IP PYTHONDUMPREFSFILE
741 If set, Python will dump objects and reference counts still alive after
742 shutting down the interpreter into a file under the path given as the value to
743 this environment variable.
744 .IP PYTHON_PRESITE
745 If this variable is set to a module, that module will be imported
746 early in the interpreter lifecycle, before the \fIsite\fR module is
747 executed, and before the \fI__main__\fR module is created.
748 This only works on debug builds.
749 .IP
750 This is equivalent to the \fB\-X presite=\fImodule\fR option.
751 .SH AUTHOR
752 The Python Software Foundation: https://www.python.org/psf/
753 .SH INTERNET RESOURCES
754 Main website: https://www.python.org/
755 .br
756 Documentation: https://docs.python.org/
757 .br
758 Developer resources: https://devguide.python.org/
759 .br
760 Downloads: https://www.python.org/downloads/
761 .br
762 Module repository: https://pypi.org/
763 .br
764 Newsgroups: comp.lang.python, comp.lang.python.announce
765 .SH LICENSING
766 Python is distributed under an Open Source license. See the file
767 "LICENSE" in the Python source distribution for information on terms &
768 conditions for accessing and otherwise using Python and for a
769 DISCLAIMER OF ALL WARRANTIES.