python学习20200505 CMD命令口操作
print("hello word")
变量:存储信息,日后被调用、修改
加+ 减- 乘* 除/ 除求整(地板除)// 求余% 指数2**3 = 8
优先级只有小括号(),没有[] {}
window键加R---》运行 CMD---》出命令窗口
Microsoft Windows [版本 10.0.18363.720]
(c) 2019 Microsoft Corporation。保留所有权利。
(c) 2019 Microsoft Corporation。保留所有权利。
cd change directory 改变目录方法
格式:cd[盘符:][路径名][子目录名]
C:\Users\wangy>cd .. cd ..返回上一层
cd ../..返回两层
cd ../../..返回三层
cd ../..返回两层
cd ../../..返回三层
C:\Users>cd wangy cd w然后按Tab键自动补全回车进入C:\Users\wangy
C:\Users\wangy>cd c:/ 利用cd返回C盘根目录
c:\>d: C盘和D盘之间转换
D:\>c:
c:\>dir dir是directory缩写目录的意思
驱动器 C 中的卷是 Windows
卷的序列号是 4A25-4275
驱动器 C 中的卷是 Windows
卷的序列号是 4A25-4275
c:\ 的目录
2019/11/14 02:19 <DIR> 360Safe
2020/04/30 11:12 19 halloword.txt
2019/05/28 16:41 <DIR> Intel
2019/03/19 12:52 <DIR> PerfLogs
2020/03/16 16:08 <DIR> Program Files
2020/03/16 16:08 <DIR> Program Files (x86)
2020/03/16 16:11 <DIR> Users
2020/04/12 17:35 <DIR> Windows
2019/11/24 12:46 <DIR> 新建文件夹
1 个文件 19 字节
8 个目录 175,479,808,000 可用字节
2020/04/30 11:12 19 halloword.txt
2019/05/28 16:41 <DIR> Intel
2019/03/19 12:52 <DIR> PerfLogs
2020/03/16 16:08 <DIR> Program Files
2020/03/16 16:08 <DIR> Program Files (x86)
2020/03/16 16:11 <DIR> Users
2020/04/12 17:35 <DIR> Windows
2019/11/24 12:46 <DIR> 新建文件夹
1 个文件 19 字节
8 个目录 175,479,808,000 可用字节
c:\>d:\pythonanzhuangzaici\python.exe halloword.txt C盘下的halloword.txt用python打开
hallo word
hallo word
c:\>d: 想打开D盘下的halloword.txt文件先转到D盘下
D:\>dir
驱动器 D 中的卷是 新加卷
卷的序列号是 F239-8799
驱动器 D 中的卷是 新加卷
卷的序列号是 F239-8799
D:\ 的目录
2019/11/13 22:56 <DIR> 360Downloads
2020/04/17 07:54 <DIR> 3D Objects
2019/10/21 16:04 <DIR> baiduwangpananzhuangzaici
2019/12/24 20:02 <DIR> CAD
2020/02/11 08:46 19 DownLoadRecord.ini
2020/05/03 10:12 31 halloword.txt
2020/02/11 08:45 <DIR> Hlddz
2020/04/12 16:20 <DIR> PDFwenjian
2019/11/13 22:53 <DIR> Program Files (x86)
2020/04/30 11:36 <DIR> pythonanzhuangzaici
2020/02/05 10:07 <DIR> qqgameanzhuangzaici
2020/04/17 07:54 <DIR> 下载
2020/04/17 07:54 <DIR> 图片
2019/06/21 17:09 <DIR> 接收文件共享
2020/04/17 07:54 <DIR> 文档
2020/04/17 07:54 <DIR> 视频
2020/04/17 07:54 <DIR> 音乐
2 个文件 50 字节
15 个目录 97,412,431,872 可用字节
2020/04/17 07:54 <DIR> 3D Objects
2019/10/21 16:04 <DIR> baiduwangpananzhuangzaici
2019/12/24 20:02 <DIR> CAD
2020/02/11 08:46 19 DownLoadRecord.ini
2020/05/03 10:12 31 halloword.txt
2020/02/11 08:45 <DIR> Hlddz
2020/04/12 16:20 <DIR> PDFwenjian
2019/11/13 22:53 <DIR> Program Files (x86)
2020/04/30 11:36 <DIR> pythonanzhuangzaici
2020/02/05 10:07 <DIR> qqgameanzhuangzaici
2020/04/17 07:54 <DIR> 下载
2020/04/17 07:54 <DIR> 图片
2019/06/21 17:09 <DIR> 接收文件共享
2020/04/17 07:54 <DIR> 文档
2020/04/17 07:54 <DIR> 视频
2020/04/17 07:54 <DIR> 音乐
2 个文件 50 字节
15 个目录 97,412,431,872 可用字节
D:\>d:\pythonanzhuangzaici\python.exe halloword.txt #先找要执行文件位置,到了以后在>后找软件位置 空格 要执行文件
hallo word,王云鹏
hallo word,王云鹏
D:\>d:\pythonanzhuangzaici\python.exe halloword.txt
hallo word,王云鹏
hallo word,王云鹏
D:\>cd 文档\python\lianxiwenjian
D:\文档\python\lianxiwenjian>d:\pythonanzhuangzaici\python.exe halloword.txt
d:\pythonanzhuangzaici\python.exe: can't open file 'halloword.txt': [Errno 2] No such file or directory
d:\pythonanzhuangzaici\python.exe: can't open file 'halloword.txt': [Errno 2] No such file or directory
D:\文档\python\lianxiwenjian>d:\pythonanzhuangzaici\python.exe halloword.txt
hallo w
hallo w

浙公网安备 33010602011771号