Skip to content

Latest commit

 

History

History
executable file
·
28 lines (22 loc) · 625 Bytes

File metadata and controls

executable file
·
28 lines (22 loc) · 625 Bytes

命令行模式

基本介绍

在计算机里运用的最多的两个命令行模式就是两种

  • Linux shell script
  • Python 命令行模式

本教程为Python3.X如果你想学习一下Python2.x,那么本教程无法满足这个需求。

[thomashuke@zziz]: Python3
# 进入到命令行模式下

跟用户交互

类似于shell中的read file,Python中也有一个跟用户进行交互的模式它是input()方法

>>> name = input()
>>> ThomasHuke
>>> name
>>> 'ThomasHuke'

所以在命令行这个地方比较常用的两个方法

  • input()
  • print()