Program Report! In the concise python tutorial, we can see a short section. importsys is followed by "foriinsys. argv". Where does sys. argv come from? In addition, sys. argv [0] is "we", and sys. argv [1] is "are ". Where did this come from? Did you write it yourself? Where? All the teachers laughed at me! I can see a short section in the python concise tutorial. After the import sys, I wrote "for I in sys. argv". Where does sys. argv come from? In addition, sys. argv [0] is "we", and sys. argv [1] is "are ". Where did this come from? Did you write it yourself? Where? The teachers laughed at me... reply: sys is a "standard library" of Python, which is an official "module". It is short for "System" and encapsulates some System information and interfaces, official Document Stamp: 27.1. sys-System-specific parameters and functions
For details about the Chinese version, refer to [python] sys module.
I copied the source code in the Tutorial:
#!/usr/bin/python# Filename: using_sys.pyimport sysprint 'The command line arguments are:'for i in sys.argv: print iprint '\n\nThe PYTHONPATH is', sys.path, '\n'
How to run the python file *. py with parameters in IDLE to answer the question:
1. First open python_shell and the following screen appears.
2. Click File in the upper left corner to open the py File to be called.
3. A new dialog box is generated ,. Click run to view the result in shell. 3. A new dialog box is generated ,. Click run to view the result in shell.
4. Results:
Well, that's it. You should be careful enough.
Above.