command line arguments PYTHON -
code
import sys def main() print(sys.argv) version - 3.3
file name pytest.py
running file syntax pytest.py aaa bbb ccc
but didn't print , not giving error also
you never call main().
python has no special main function run automatically, instead, can place code want run when file called command line special if block:
import sys def main(): print(sys.argv) if __name__ == '__main__': main()
Comments
Post a Comment