Skip to main content
Improved formatting and added note at end.
Source Link
martineau
  • 124.1k
  • 29
  • 181
  • 319

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.

Nowadays, the recommended way to launch other processes is to use the subprocess module. 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') 

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.

Source Link
martineau
  • 124.1k
  • 29
  • 181
  • 319

Nowadays, the recommended way to launch other processes is to use the subprocess module. 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')