2. Python

2.1.

Python /usr/local/bin/python3.15 /usr/local/bin Unix shell

python3.15

Python [1] Python /usr/local/python

Windows Microsoft Store Python python3.15 py.exe launcher py Python Python

end-of-file Unix Control-D Windows Control-Z (zero exit status) quit()

Python Control-b ^[[D ^B backspace

Unix shell tty stdin

python -c command [arg] ... command shell -c Python shell command

Python python -m module [arg] ... module

-i

2.1.1.

list sys argv import sys sys.argv[0] '-' sys.argv[0] '-' -c command sys.argv[0] '-c' -m module sys.argv[0] -c command -m module Python sys.argv command module

2.1.2.

(tty) interactive mode>>>...

$ python3.15
Python 3.15 (default, May 7 2025, 15:46:04)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

if

>>> the_world_is_flat = True
>>> if the_world_is_flat:
...     print("Be careful not to fall off!")
...
Be careful not to fall off!

2.2.

2.2.1. (encoding)

Python UTF-8 (identifier) --- ASCII portable UTF-8

# -*- coding: encoding -*-

encoding Python codecs

Windows-1252

# -*- coding: cp1252 -*-

UNIX "shebang" line

#!/usr/bin/env python3
# -*- coding: cp1252 -*-

[1]

Unix Python 3.x python Python 2.x