First of all, your command status is wrong. If you want to run this py file, enter: python script1.py,而不是在命令窗口输入python之后进入python运行环境。 需要注意的是,命令行窗口和运行的文件要在同一文件夹下,或者,命令行通过cd命令要进入该文件的文件夹下。当然,你也可以在该文件的文件夹下,按住shift,右击空白处,就会有在此文件夹下打开命令窗口 in the command line window.
First of all, what you wrote is not a module, and importing it is useless. To import a module, you have to use import [xx] Secondly, you don’t have to do that to execute the script. You don’t need to enter the cli, just python [name.py].
First of all, your command status is wrong. If you want to run this py file, enter:
python script1.py
,而不是在命令窗口输入python
之后进入python运行环境。需要注意的是,命令行窗口和运行的文件要在同一文件夹下,或者,命令行通过cd命令要进入该文件的文件夹下。当然,你也可以在该文件的文件夹下,按住
shift
,右击空白处,就会有在此文件夹下打开命令窗口
in the command line window.PS: I need to read some basic books :)
You are teasing me, what you said on the first floor is good
First of all, what you wrote is not a module, and importing it is useless. To import a module, you have to use import [xx]
Secondly, you don’t have to do that to execute the script. You don’t need to enter the cli, just python [name.py].
Read More