zoukankan      html  css  js  c++  java
  • 命令行模式和python交互模式

    一、命令行模式

    1、是什么

    1)Windows系统的cmd

    2)Linux系统的terminal

    2、作用

    运行.py文件

    3、格式

    解释器+文件名.py

    4、工具

    1)Windows系统

    VScode、Sublime Text、notepad++

    2)Linux系统

    Vim文本编辑器

    二、python交互模式

    1、作用

    运行python命令

    2、优缺点

    1)优点

    每输入一行就执行一行

    2)缺点

    命令保存到内存,不能保存到硬盘,命令关闭既消失

    3、进入

    命令行模式->python交互模式

    命令:python

    C:Windowssystem32>python
    Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>

    3、退出

    python交互模式->命令行模式

    命令:exit()

    C:Windowssystem32>python
    Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> exit()
    
    C:Windowssystem32>

     三、总结

    1、命令行模式用于执行.py文件

    2、python交互模式用于执行命令

  • 相关阅读:
    1.28
    1.27
    1.26
    如果给你以下功能怎么测试
    测试面试题
    对h5页面的测试方式
    完美解决linux下Django报错Error: That port is already in use.
    KeyError:使用Python的Appium中的“ touchAction” 错误码
    Appium自动化测试
    selenium IDE使用
  • 原文地址:https://www.cnblogs.com/wt7018/p/10732421.html
Copyright © 2011-2022 走看看