运维网's Archiver
论坛
›
Python
› Python注释和脚本参数
maxc1017
发表于 2018-8-15 09:21:57
Python注释和脚本参数
单行注释: #
多行注释:"""为开始,"""结束
捕获参数:import sys
sys.argv 表示argv功能在sys模块里边
Eg:hello.py
#_*_ coding: utf-8 _*_
import sys
print sys.argv
print '你好,世界!'
执行结果:
E:\>pythonhello.py localhost:8001
['hello.py','localhost:8001']
你好,世界!
页:
[1]
查看完整版本:
Python注释和脚本参数