python 显示当前路径 Windows

1.导入os模块

import os 

2.打印路径

print(os.getcwd())

 3.切换工作目录

 os.chdir('d:\360安全浏览器下载')

4.列出当前路径下的所有文件

os.listdir()

原文地址:https://www.cnblogs.com/MOMING95/p/12532090.html