This commit is contained in:
2022-03-16 19:37:32 +08:00
parent 3f91ca3bdd
commit 27cafcd10c
9 changed files with 111 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
import os
os.getcwd() # 获取路径
if os.path.exists('new_dir') == False: # 判断路径是否存在
os.makedirs('new_dir') # 新建文件夹
os.chdir('new_dir') # 切换到该文件夹
print(os.walk('/')) # 游走目录