Error[8]: Undefined offset: 1, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

import os
#
dir = os.getcwd()
print(dir)  # 查看777.py在那个文件

# all = os.listdir(r'D:\kinggsoft')
# print(all) #查看文件里面有什么文件夹

# 创造文件夹
# r = os.mkdir(r'D:\kinggsoft\ppd')
# print(r)
# os.removedirs(r'D:\kinggsoft\ppd')  # 删除ppd文件夹

# 切换目录,把现在777.py的目录切换到r'D:\kinggsoft',然后再查看当前目录就变成r'D:\kinggsoft'了
# f = os.chdir(r'D:\kinggsoft')
# print(f)
# path = os.getcwd()
# print(path)
#
# path = os.path.abspath('aa.txt')
# print(path)

# 获得当前py文件的绝对路径D:2\pythonlesson[+++]7[+++]67.py
# path = os.path.abspath(__file__)
# print(path)
# #
# # # 当前目录绝对路径: D:2\pythonlesson[+++]7[+++]6
# path = os.getcwd()
# print(path)

# 分割获得777.py
# path = r'D:2\pythonlesson[+++]7[+++]67.py'
# result = os.path.split(path)
# print(result)
# print(result[1])
# # # 分割文件和扩展名
# result = os.path.splitext(path)
# print(result)

# 添加后缀'file', 'a', 'a1.jpg'
# result = os.path.join(os.getcwd(), 'file', 'a', 'a1.jpg')
# print(result)

# 删除ks文件夹
path = r'D:\kinggsoft\ppx\ks'
filelist = os.listdir(path)
for file in filelist:
    path1 = os.path.join(path, file)
    os.remove(path1)
else:
    os.rmdir(path)
print('删除成功')

# 把一个文件里面的内容复制到另外一个文件里面去,但是如果一个文件里面还有一个文件,就不能复制过去会报错
# src_path = r'D:\kinggsoft\ppx'
# target_path = r'D:\kinggsoft\ks'
# def copy(src, target):
#     if os.path.isdir(src) and os.path.isdir(target):
#         filelist = os.listdir(src)
#         for file in filelist:
#             path = os.path.join(src, file)
#             with open(path, 'rb') as rstream:
#                 container = rstream.read()
#                 path1 = os.path.join(target,file)
#                 with open(path1, 'wb') as wstream:
#                     wstream.write(container)
#         else:
#             print('复制完毕')
# copy(src_path, target_path)
# 
# 把一个文件里面的内容复制到另外一个文件里面去,也能复制文件夹加里面的内容
# src_path = r'D:\kinggsoft\ppx'
# target_path = r'D:\kinggsoft\ks'
# def copy(src_path, target_path):
#     filelist = os.listdir(src_path)
#     for file in filelist:
#         path = os.path.join(src_path, file)
#         if os.path.isdir(path):
#             target_path1 = os.path.join(target_path, file)  # 在复制过去的那边一个添加文件夹
#             os.mkdir(target_path1)  # 在复制过去的那边一个添加文件夹 这两行就可以
#             copy(path, target_path)
#         else:
#             with open(path, 'rb') as rstream:
#                 container = rstream.read()
#                 path1 = os.path.join(target_path, file)
#                 with open(path1, 'wb') as wstream:
#                     wstream.write(container)
#     else:
#         print('复制完毕')
# copy(src_path, target_path)
)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 165, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 2, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

import os
#
dir = os.getcwd()
print(dir)  # 查看777.py在那个文件

# all = os.listdir(r'D:\kinggsoft')
# print(all) #查看文件里面有什么文件夹

# 创造文件夹
# r = os.mkdir(r'D:\kinggsoft\ppd')
# print(r)
# os.removedirs(r'D:\kinggsoft\ppd')  # 删除ppd文件夹

# 切换目录,把现在777.py的目录切换到r'D:\kinggsoft',然后再查看当前目录就变成r'D:\kinggsoft'了
# f = os.chdir(r'D:\kinggsoft')
# print(f)
# path = os.getcwd()
# print(path)
#
# path = os.path.abspath('aa.txt')
# print(path)

# 获得当前py文件的绝对路径D:2\pythonlesson7[+++]67.py
# path = os.path.abspath(__file__)
# print(path)
# #
# # # 当前目录绝对路径: D:2\pythonlesson[+++]7[+++]6
# path = os.getcwd()
# print(path)

# 分割获得777.py
# path = r'D:2\pythonlesson[+++]7[+++]67.py'
# result = os.path.split(path)
# print(result)
# print(result[1])
# # # 分割文件和扩展名
# result = os.path.splitext(path)
# print(result)

# 添加后缀'file', 'a', 'a1.jpg'
# result = os.path.join(os.getcwd(), 'file', 'a', 'a1.jpg')
# print(result)

# 删除ks文件夹
path = r'D:\kinggsoft\ppx\ks'
filelist = os.listdir(path)
for file in filelist:
    path1 = os.path.join(path, file)
    os.remove(path1)
else:
    os.rmdir(path)
print('删除成功')

# 把一个文件里面的内容复制到另外一个文件里面去,但是如果一个文件里面还有一个文件,就不能复制过去会报错
# src_path = r'D:\kinggsoft\ppx'
# target_path = r'D:\kinggsoft\ks'
# def copy(src, target):
#     if os.path.isdir(src) and os.path.isdir(target):
#         filelist = os.listdir(src)
#         for file in filelist:
#             path = os.path.join(src, file)
#             with open(path, 'rb') as rstream:
#                 container = rstream.read()
#                 path1 = os.path.join(target,file)
#                 with open(path1, 'wb') as wstream:
#                     wstream.write(container)
#         else:
#             print('复制完毕')
# copy(src_path, target_path)
# 
# 把一个文件里面的内容复制到另外一个文件里面去,也能复制文件夹加里面的内容
# src_path = r'D:\kinggsoft\ppx'
# target_path = r'D:\kinggsoft\ks'
# def copy(src_path, target_path):
#     filelist = os.listdir(src_path)
#     for file in filelist:
#         path = os.path.join(src_path, file)
#         if os.path.isdir(path):
#             target_path1 = os.path.join(target_path, file)  # 在复制过去的那边一个添加文件夹
#             os.mkdir(target_path1)  # 在复制过去的那边一个添加文件夹 这两行就可以
#             copy(path, target_path)
#         else:
#             with open(path, 'rb') as rstream:
#                 container = rstream.read()
#                 path1 = os.path.join(target_path, file)
#                 with open(path1, 'wb') as wstream:
#                     wstream.write(container)
#     else:
#         print('复制完毕')
# copy(src_path, target_path)
)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 165, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 3, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

import os
#
dir = os.getcwd()
print(dir)  # 查看777.py在那个文件

# all = os.listdir(r'D:\kinggsoft')
# print(all) #查看文件里面有什么文件夹

# 创造文件夹
# r = os.mkdir(r'D:\kinggsoft\ppd')
# print(r)
# os.removedirs(r'D:\kinggsoft\ppd')  # 删除ppd文件夹

# 切换目录,把现在777.py的目录切换到r'D:\kinggsoft',然后再查看当前目录就变成r'D:\kinggsoft'了
# f = os.chdir(r'D:\kinggsoft')
# print(f)
# path = os.getcwd()
# print(path)
#
# path = os.path.abspath('aa.txt')
# print(path)

# 获得当前py文件的绝对路径D:2\pythonlesson767.py
# path = os.path.abspath(__file__)
# print(path)
# #
# # # 当前目录绝对路径: D:2\pythonlesson[+++]7[+++]6
# path = os.getcwd()
# print(path)

# 分割获得777.py
# path = r'D:2\pythonlesson[+++]7[+++]67.py'
# result = os.path.split(path)
# print(result)
# print(result[1])
# # # 分割文件和扩展名
# result = os.path.splitext(path)
# print(result)

# 添加后缀'file', 'a', 'a1.jpg'
# result = os.path.join(os.getcwd(), 'file', 'a', 'a1.jpg')
# print(result)

# 删除ks文件夹
path = r'D:\kinggsoft\ppx\ks'
filelist = os.listdir(path)
for file in filelist:
    path1 = os.path.join(path, file)
    os.remove(path1)
else:
    os.rmdir(path)
print('删除成功')

# 把一个文件里面的内容复制到另外一个文件里面去,但是如果一个文件里面还有一个文件,就不能复制过去会报错
# src_path = r'D:\kinggsoft\ppx'
# target_path = r'D:\kinggsoft\ks'
# def copy(src, target):
#     if os.path.isdir(src) and os.path.isdir(target):
#         filelist = os.listdir(src)
#         for file in filelist:
#             path = os.path.join(src, file)
#             with open(path, 'rb') as rstream:
#                 container = rstream.read()
#                 path1 = os.path.join(target,file)
#                 with open(path1, 'wb') as wstream:
#                     wstream.write(container)
#         else:
#             print('复制完毕')
# copy(src_path, target_path)
# 
# 把一个文件里面的内容复制到另外一个文件里面去,也能复制文件夹加里面的内容
# src_path = r'D:\kinggsoft\ppx'
# target_path = r'D:\kinggsoft\ks'
# def copy(src_path, target_path):
#     filelist = os.listdir(src_path)
#     for file in filelist:
#         path = os.path.join(src_path, file)
#         if os.path.isdir(path):
#             target_path1 = os.path.join(target_path, file)  # 在复制过去的那边一个添加文件夹
#             os.mkdir(target_path1)  # 在复制过去的那边一个添加文件夹 这两行就可以
#             copy(path, target_path)
#         else:
#             with open(path, 'rb') as rstream:
#                 container = rstream.read()
#                 path1 = os.path.join(target_path, file)
#                 with open(path1, 'wb') as wstream:
#                     wstream.write(container)
#     else:
#         print('复制完毕')
# copy(src_path, target_path)
)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 165, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 4, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

import os
#
dir = os.getcwd()
print(dir)  # 查看777.py在那个文件

# all = os.listdir(r'D:\kinggsoft')
# print(all) #查看文件里面有什么文件夹

# 创造文件夹
# r = os.mkdir(r'D:\kinggsoft\ppd')
# print(r)
# os.removedirs(r'D:\kinggsoft\ppd')  # 删除ppd文件夹

# 切换目录,把现在777.py的目录切换到r'D:\kinggsoft',然后再查看当前目录就变成r'D:\kinggsoft'了
# f = os.chdir(r'D:\kinggsoft')
# print(f)
# path = os.getcwd()
# print(path)
#
# path = os.path.abspath('aa.txt')
# print(path)

# 获得当前py文件的绝对路径D:2\pythonlesson767.py
# path = os.path.abspath(__file__)
# print(path)
# #
# # # 当前目录绝对路径: D:2\pythonlesson7[+++]6
# path = os.getcwd()
# print(path)

# 分割获得777.py
# path = r'D:2\pythonlesson[+++]7[+++]67.py'
# result = os.path.split(path)
# print(result)
# print(result[1])
# # # 分割文件和扩展名
# result = os.path.splitext(path)
# print(result)

# 添加后缀'file', 'a', 'a1.jpg'
# result = os.path.join(os.getcwd(), 'file', 'a', 'a1.jpg')
# print(result)

# 删除ks文件夹
path = r'D:\kinggsoft\ppx\ks'
filelist = os.listdir(path)
for file in filelist:
    path1 = os.path.join(path, file)
    os.remove(path1)
else:
    os.rmdir(path)
print('删除成功')

# 把一个文件里面的内容复制到另外一个文件里面去,但是如果一个文件里面还有一个文件,就不能复制过去会报错
# src_path = r'D:\kinggsoft\ppx'
# target_path = r'D:\kinggsoft\ks'
# def copy(src, target):
#     if os.path.isdir(src) and os.path.isdir(target):
#         filelist = os.listdir(src)
#         for file in filelist:
#             path = os.path.join(src, file)
#             with open(path, 'rb') as rstream:
#                 container = rstream.read()
#                 path1 = os.path.join(target,file)
#                 with open(path1, 'wb') as wstream:
#                     wstream.write(container)
#         else:
#             print('复制完毕')
# copy(src_path, target_path)
# 
# 把一个文件里面的内容复制到另外一个文件里面去,也能复制文件夹加里面的内容
# src_path = r'D:\kinggsoft\ppx'
# target_path = r'D:\kinggsoft\ks'
# def copy(src_path, target_path):
#     filelist = os.listdir(src_path)
#     for file in filelist:
#         path = os.path.join(src_path, file)
#         if os.path.isdir(path):
#             target_path1 = os.path.join(target_path, file)  # 在复制过去的那边一个添加文件夹
#             os.mkdir(target_path1)  # 在复制过去的那边一个添加文件夹 这两行就可以
#             copy(path, target_path)
#         else:
#             with open(path, 'rb') as rstream:
#                 container = rstream.read()
#                 path1 = os.path.join(target_path, file)
#                 with open(path1, 'wb') as wstream:
#                     wstream.write(container)
#     else:
#         print('复制完毕')
# copy(src_path, target_path)
)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 165, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 5, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

import os
#
dir = os.getcwd()
print(dir)  # 查看777.py在那个文件

# all = os.listdir(r'D:\kinggsoft')
# print(all) #查看文件里面有什么文件夹

# 创造文件夹
# r = os.mkdir(r'D:\kinggsoft\ppd')
# print(r)
# os.removedirs(r'D:\kinggsoft\ppd')  # 删除ppd文件夹

# 切换目录,把现在777.py的目录切换到r'D:\kinggsoft',然后再查看当前目录就变成r'D:\kinggsoft'了
# f = os.chdir(r'D:\kinggsoft')
# print(f)
# path = os.getcwd()
# print(path)
#
# path = os.path.abspath('aa.txt')
# print(path)

# 获得当前py文件的绝对路径D:2\pythonlesson767.py
# path = os.path.abspath(__file__)
# print(path)
# #
# # # 当前目录绝对路径: D:2\pythonlesson76
# path = os.getcwd()
# print(path)

# 分割获得777.py
# path = r'D:2\pythonlesson[+++]7[+++]67.py'
# result = os.path.split(path)
# print(result)
# print(result[1])
# # # 分割文件和扩展名
# result = os.path.splitext(path)
# print(result)

# 添加后缀'file', 'a', 'a1.jpg'
# result = os.path.join(os.getcwd(), 'file', 'a', 'a1.jpg')
# print(result)

# 删除ks文件夹
path = r'D:\kinggsoft\ppx\ks'
filelist = os.listdir(path)
for file in filelist:
    path1 = os.path.join(path, file)
    os.remove(path1)
else:
    os.rmdir(path)
print('删除成功')

# 把一个文件里面的内容复制到另外一个文件里面去,但是如果一个文件里面还有一个文件,就不能复制过去会报错
# src_path = r'D:\kinggsoft\ppx'
# target_path = r'D:\kinggsoft\ks'
# def copy(src, target):
#     if os.path.isdir(src) and os.path.isdir(target):
#         filelist = os.listdir(src)
#         for file in filelist:
#             path = os.path.join(src, file)
#             with open(path, 'rb') as rstream:
#                 container = rstream.read()
#                 path1 = os.path.join(target,file)
#                 with open(path1, 'wb') as wstream:
#                     wstream.write(container)
#         else:
#             print('复制完毕')
# copy(src_path, target_path)
# 
# 把一个文件里面的内容复制到另外一个文件里面去,也能复制文件夹加里面的内容
# src_path = r'D:\kinggsoft\ppx'
# target_path = r'D:\kinggsoft\ks'
# def copy(src_path, target_path):
#     filelist = os.listdir(src_path)
#     for file in filelist:
#         path = os.path.join(src_path, file)
#         if os.path.isdir(path):
#             target_path1 = os.path.join(target_path, file)  # 在复制过去的那边一个添加文件夹
#             os.mkdir(target_path1)  # 在复制过去的那边一个添加文件夹 这两行就可以
#             copy(path, target_path)
#         else:
#             with open(path, 'rb') as rstream:
#                 container = rstream.read()
#                 path1 = os.path.join(target_path, file)
#                 with open(path1, 'wb') as wstream:
#                     wstream.write(container)
#     else:
#         print('复制完毕')
# copy(src_path, target_path)
)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 165, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 6, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

import os
#
dir = os.getcwd()
print(dir)  # 查看777.py在那个文件

# all = os.listdir(r'D:\kinggsoft')
# print(all) #查看文件里面有什么文件夹

# 创造文件夹
# r = os.mkdir(r'D:\kinggsoft\ppd')
# print(r)
# os.removedirs(r'D:\kinggsoft\ppd')  # 删除ppd文件夹

# 切换目录,把现在777.py的目录切换到r'D:\kinggsoft',然后再查看当前目录就变成r'D:\kinggsoft'了
# f = os.chdir(r'D:\kinggsoft')
# print(f)
# path = os.getcwd()
# print(path)
#
# path = os.path.abspath('aa.txt')
# print(path)

# 获得当前py文件的绝对路径D:2\pythonlesson767.py
# path = os.path.abspath(__file__)
# print(path)
# #
# # # 当前目录绝对路径: D:2\pythonlesson76
# path = os.getcwd()
# print(path)

# 分割获得777.py
# path = r'D:2\pythonlesson7[+++]67.py'
# result = os.path.split(path)
# print(result)
# print(result[1])
# # # 分割文件和扩展名
# result = os.path.splitext(path)
# print(result)

# 添加后缀'file', 'a', 'a1.jpg'
# result = os.path.join(os.getcwd(), 'file', 'a', 'a1.jpg')
# print(result)

# 删除ks文件夹
path = r'D:\kinggsoft\ppx\ks'
filelist = os.listdir(path)
for file in filelist:
    path1 = os.path.join(path, file)
    os.remove(path1)
else:
    os.rmdir(path)
print('删除成功')

# 把一个文件里面的内容复制到另外一个文件里面去,但是如果一个文件里面还有一个文件,就不能复制过去会报错
# src_path = r'D:\kinggsoft\ppx'
# target_path = r'D:\kinggsoft\ks'
# def copy(src, target):
#     if os.path.isdir(src) and os.path.isdir(target):
#         filelist = os.listdir(src)
#         for file in filelist:
#             path = os.path.join(src, file)
#             with open(path, 'rb') as rstream:
#                 container = rstream.read()
#                 path1 = os.path.join(target,file)
#                 with open(path1, 'wb') as wstream:
#                     wstream.write(container)
#         else:
#             print('复制完毕')
# copy(src_path, target_path)
# 
# 把一个文件里面的内容复制到另外一个文件里面去,也能复制文件夹加里面的内容
# src_path = r'D:\kinggsoft\ppx'
# target_path = r'D:\kinggsoft\ks'
# def copy(src_path, target_path):
#     filelist = os.listdir(src_path)
#     for file in filelist:
#         path = os.path.join(src_path, file)
#         if os.path.isdir(path):
#             target_path1 = os.path.join(target_path, file)  # 在复制过去的那边一个添加文件夹
#             os.mkdir(target_path1)  # 在复制过去的那边一个添加文件夹 这两行就可以
#             copy(path, target_path)
#         else:
#             with open(path, 'rb') as rstream:
#                 container = rstream.read()
#                 path1 = os.path.join(target_path, file)
#                 with open(path1, 'wb') as wstream:
#                     wstream.write(container)
#     else:
#         print('复制完毕')
# copy(src_path, target_path)
)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 165, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
import.os 文件 *** 作_python_内存溢出

import.os 文件 *** 作

import.os 文件 *** 作,第1张

import os
#
dir = os.getcwd()
print(dir)  # 查看777.py在那个文件

# all = os.listdir(r'D:\kinggsoft')
# print(all) #查看文件里面有什么文件夹

# 创造文件夹
# r = os.mkdir(r'D:\kinggsoft\ppd')
# print(r)
# os.removedirs(r'D:\kinggsoft\ppd')  # 删除ppd文件夹

# 切换目录,把现在777.py的目录切换到r'D:\kinggsoft',然后再查看当前目录就变成r'D:\kinggsoft'了
# f = os.chdir(r'D:\kinggsoft')
# print(f)
# path = os.getcwd()
# print(path)
#
# path = os.path.abspath('aa.txt')
# print(path)

# 获得当前py文件的绝对路径D:2\pythonlesson767.py
# path = os.path.abspath(__file__)
# print(path)
# #
# # # 当前目录绝对路径: D:2\pythonlesson76
# path = os.getcwd()
# print(path)

# 分割获得777.py
# path = r'D:2\pythonlesson767.py'
# result = os.path.split(path)
# print(result)
# print(result[1])
# # # 分割文件和扩展名
# result = os.path.splitext(path)
# print(result)

# 添加后缀'file', 'a', 'a1.jpg'
# result = os.path.join(os.getcwd(), 'file', 'a', 'a1.jpg')
# print(result)

# 删除ks文件夹
path = r'D:\kinggsoft\ppx\ks'
filelist = os.listdir(path)
for file in filelist:
    path1 = os.path.join(path, file)
    os.remove(path1)
else:
    os.rmdir(path)
print('删除成功')

# 把一个文件里面的内容复制到另外一个文件里面去,但是如果一个文件里面还有一个文件,就不能复制过去会报错
# src_path = r'D:\kinggsoft\ppx'
# target_path = r'D:\kinggsoft\ks'
# def copy(src, target):
#     if os.path.isdir(src) and os.path.isdir(target):
#         filelist = os.listdir(src)
#         for file in filelist:
#             path = os.path.join(src, file)
#             with open(path, 'rb') as rstream:
#                 container = rstream.read()
#                 path1 = os.path.join(target,file)
#                 with open(path1, 'wb') as wstream:
#                     wstream.write(container)
#         else:
#             print('复制完毕')
# copy(src_path, target_path)
# 
# 把一个文件里面的内容复制到另外一个文件里面去,也能复制文件夹加里面的内容
# src_path = r'D:\kinggsoft\ppx'
# target_path = r'D:\kinggsoft\ks'
# def copy(src_path, target_path):
#     filelist = os.listdir(src_path)
#     for file in filelist:
#         path = os.path.join(src_path, file)
#         if os.path.isdir(path):
#             target_path1 = os.path.join(target_path, file)  # 在复制过去的那边一个添加文件夹
#             os.mkdir(target_path1)  # 在复制过去的那边一个添加文件夹 这两行就可以
#             copy(path, target_path)
#         else:
#             with open(path, 'rb') as rstream:
#                 container = rstream.read()
#                 path1 = os.path.join(target_path, file)
#                 with open(path1, 'wb') as wstream:
#                     wstream.write(container)
#     else:
#         print('复制完毕')
# copy(src_path, target_path)

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/875252.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-13
下一篇 2022-05-13

发表评论

登录后才能评论

评论列表(0条)

保存