Calling command line arguments in Python 3

前端 未结 1 430
被撕碎了的回忆
被撕碎了的回忆 2021-01-15 00:50

I am writing a program in Python 3 that will take data from a csv file, make adjustments to it and write the new data to a csv file that will be named by the user.

I

相关标签:
1条回答
  • 2021-01-15 01:39

    Command line options are stored in sys.argv. You may want to check this:

    http://docs.python.org/3/library/sys.html?highlight=argv#sys.argv

    Beside, if you need more complex command-line argument parsing and deciding your program logic based on that, you should try argparse

    0 讨论(0)
提交回复
热议问题