【发布时间】:2014-03-04 02:44:04
【问题描述】:
这是代码:
import sys
# Gather our code in a main() function
def main():
for arg in sys.argv:
print(arg)
# Standard boilerplate to call the main() function to begin
# the program.
if __name__ == '__main__':
main()
当我像a.py a&7 这样在cmd 中运行它时,它只打印a(&7 无法识别)。
如何将& 之类的字符发送到sys.argv[]?
【问题讨论】:
-
包含您已经尝试过的内容有时会有所帮助。
-
我只是不知道
t know how to solve this kind of problem,because google seems wont 识别特殊字符,例如'&'。
标签: python shell command-line-arguments