import os
import shutil
root_path = ‘D:/pycharm/’
for name in names:
if not os.path.exists(root_path+’%s/’%name):
os.mkdir(root_path+’%s/’%name)
shutil.move(root_path+’%s邀请函.txt’%name,root_path+’%s/%s邀请函.txt’%(name,name))
path = ‘D:\pycharm\丁一\丁一邀请函.txt’
file = open(path,encoding=‘gbk’)
print(file)
print(file.read())