python 运行命令行的代码(python命令行模式的使用流程)
导读:1、使用cmd打开命令行窗口。...
1 、使用cmd打开命令行窗口 。
2 、在输入python时 ,进入python交互模式 。
3 、输入exit() ,退出交互模式 ,在命令行模式下运行.py程序 。
实例
C:\Users\86178>python Python3.8.3(default,Jul22020,17:30:36)[MSCv.191664bit(AMD64)]::Anaconda,Inc.onwin32 Type"help","copyright","credits"or"license"formoreinformation. >>>edit Traceback(mostrecentcalllast): File"<stdin>",line1,in<module> NameError:nameeditisnotdefined >>>exit() C:\Users\86178>python Python3.8.3(default,Jul22020,17:30:36)[MSCv.191664bit(AMD64)]::Anaconda,Inc.onwin32 Type"help","copyright","credits"or"license"formoreinformation. >>>hello.py Traceback(mostrecentcalllast): File"<stdin>",line1,in<module> NameError:namehelloisnotdefined >>>exit() C:\Users\86178>pythonhello.pu python:cantopenfilehello.pu:[Errno2]Nosuchfileordirectory C:\Users\86178>pythonhello.py python:cantopenfilehello.py:[Errno2]Nosuchfileordirectory C:\Users\86178>cd/d 文件名 、目录名或卷标语法不正确 。 C:\Users\86178>cd/dD: D:\>pythonhello.py hello D:\>python Python3.8.3(default,Jul22020,17:30:36)[MSCv.191664bit(AMD64)]::Anaconda,Inc.onwin32 Type"help","copyright","credits"or"license"formoreinformation. >>>hello.py Traceback(mostrecentcalllast): File"<stdin>",line1,in<module> NameError:namehelloisnotdefined >>>以上就是python命令行模式的使用流程 ,希望对大家有所帮助 。更多Python学习指路:Python基础教程
创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!