import threading def f(n): for i in range(n): t = threading.Thread(target=lambda: None) t.start() t.join() import sys f(int(sys.argv[1]))