跳到主要内容

Python 解释器

调用和退出解释器:

# 启动
python

# 退出
quit()

获取命令行参数:

import sys
print(sys.argv)

Python 源码文件默认使用 UTF-8 编码。如果要使用其他编码,可以在文件开头写上特殊注释:

# -*- coding: encoding -*-

更多内容:

参考

Python 解释器 - python.org