函数使用(五)
目录管理(os)
-
system:执行系统命令
1
2# 执行系统命令
os.system('cls') -
name:获取操作系统名称
1
2# 操作系统的名称,nt代表Windows,posix代表Unix
print(os.name)
1 | # 执行系统命令 |
1 | # 操作系统的名称,nt代表Windows,posix代表Unix |
1 | from collections import Iterator |
1 | if True: |
1 | print:打印、输出 |
1 | hexo clean # 删除生成的文件和缓存 |