import os import sys hashseed = os.getenv('PYTHONHASHSEED') if not hashseed: os.environ['PYTHONHASHSEED'] = '0' os.execv(sys.executable, [sys.executable] + sys.argv) [the rest of your program]