【说站】python命令行模式的使用流程
2023-06-13 09:13:21 时间
python命令行模式的使用流程
1、使用cmd打开命令行窗口。
2、在输入python时,进入python交互模式。
3、输入exit(),退出交互模式,在命令行模式下运行.py程序。
实例
C:\Users\86178>python
Python 3.8.3 (default, Jul 2 2020, 17:30:36) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> edit
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'edit' is not defined
>>> exit()
C:\Users\86178>python
Python 3.8.3 (default, Jul 2 2020, 17:30:36) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> hello.py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'hello' is not defined
>>> exit()
C:\Users\86178>python hello.pu
python: can't open file 'hello.pu': [Errno 2] No such file or directory
C:\Users\86178>python hello.py
python: can't open file 'hello.py': [Errno 2] No such file or directory
C:\Users\86178>cd /d
文件名、目录名或卷标语法不正确。
C:\Users\86178>cd /d D:
D:\>python hello.py
hello
D:\>python
Python 3.8.3 (default, Jul 2 2020, 17:30:36) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> hello.py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'hello' is not defined
>>>
以上就是python命令行模式的使用流程,希望对大家有所帮助。更多Python学习指路:python基础教程
本文教程操作环境:windows7系统、Python 3.9.1,DELL G3电脑。
相关文章
- python的安装教程_Python的安装
- pycharm打包python项目_Python怎么打包
- mt4 python_一个使用Python自动化交易外汇MT4脚本实现「建议收藏」
- python hashlib_Python hashlib模块实例使用详解
- Python字符串删除、截取,删除某个字符、片段[通俗易懂]
- Python中字符串的Format用法。
- 【说站】python访问元组的两种方法
- 【说站】python中pdb的使用流程
- 【说站】python线性规划问题的处理步骤
- 【说站】Python利用prettytable实现格式化输出内容
- Python实现自动回复_python 微信机器人
- 运维Python自动化之路:基础信息模块之psutil模块
- python lambda表达式举例_Python中lambda表达式[通俗易懂]
- python中encode和decode的区别_python lstrip
- python中if判断语句的用法_Python if判断语句的用法详细介绍[通俗易懂]
- python爬虫入门_在百度搜索手机归属地
- python简单使用grpc
- 【测试开发】python系列教程:Python数据类型转换
- 软件测试|Python的流程控制,你真的会了吗?(一)
- 使用Python执行Linux命令的方法(python调用linux命令)
- 掌握Python访问MySQL的新技能(python访问mysql)
- 开发Linux下Python编程:实现自己的开发梦想(linux下python)
- Python驱动Oracle数据库(python操作oracle)
- 在Linux上运行Python脚本的简单指南(linux运行python)
- 用Python仿写MSSQL 编程体验更有趣(python仿mssql)