Nowadays, the recommended way to launch other processes is to use the subprocess module.
It's relatively easy to do. Here's a simple way to apply it to your problem:
import subprocess import sys create = [sys.executable, 'createbid.py'] def question(ans): if ans == 'yes': subprocess.call(create) elif ans == 'no': quit() ask1 = raw_input('Create bid? ') question(ask1) print('done') Note: When createbid.py (or some other script) is executed this way,
__name__ == '__main__' will be True, unlike it would be if it had been imported.