本文实例讲述了pythonos模块简单应用。分享给大家供大家参考,具体如下: 举例中的目录形式如下所示: In [36]: pwd Out[36]: '/home/python/Desktop/code' In [37]: ls hello.py hello.txt test.py 文件夹01/ ...
#文件复制 import os src_path=r'E:\Pycharm\python100题\代码' target_path=r'E:\Pycharm\python100题\123' #封装成函数 def copy_function(src,target): if os.path.isdir(src) and os.path.isdir(target): ...