text = raw_input("prompt") # Python 2
text = input("prompt") # Python 3
命令行输入位于sys.argv。在你的脚本中尝试一下:
import sys
print (sys.argv)
There are two modules for parsing command line options: optparse https://docs.python.org/dev/library/optparse.html (deprecated since Python 2.7, use argparse https://docs.python.org/dev/library/argparse.html instead) and getopt https://docs.python.org/dev/library/getopt.html. If you just want to input files to your script, behold the power of fileinput https://docs.python.org/dev/library/fileinput.html.
The Python 库参考 https://docs.python.org/dev/library/是你的朋友。