使用for循环即可实现:
for name in range(1,11): desktop_path=‘C://Users/Lenovo/Desktop/‘ full_path=desktop_path+str(name)+‘.txt‘ file=open(full_path,‘w‘) file.close()
原文地址:https://www.cnblogs.com/wyhluckdog/p/10745827.html
时间: 2024-10-17 08:05:24
使用for循环即可实现:
for name in range(1,11): desktop_path=‘C://Users/Lenovo/Desktop/‘ full_path=desktop_path+str(name)+‘.txt‘ file=open(full_path,‘w‘) file.close()
原文地址:https://www.cnblogs.com/wyhluckdog/p/10745827.html