s1ightcrazed
August 25th, 2007, 12:27 PM
Here's the dilema:
I'm working on a curses app written in python, and I've been trying to work on modularizing the app. The idea is that from within a parent curses window you can select an item off a menu, and that item will actually be a separate curses program itself. If you exit the spawned program you should return to the original parent app.
What I've tried so far is an os.system call inside the parent:
os.system("python curses_app2.py")
and this works fine, spawning the 2nd program, although I do end up with 2 separate python processes. However, when I exit the second 'spawned' app, it does not return me to the original parent app. I just get dropped to a terminal - it's as if the first app never re-initializes.
Just curious if anyone has ever done this before. I *could* just make everything into one big standalone app, but I'd prefer not to. I really like the idea of having each separate part of the app be a different file, for organization and maintenance, if for nothing else.
I'm working on a curses app written in python, and I've been trying to work on modularizing the app. The idea is that from within a parent curses window you can select an item off a menu, and that item will actually be a separate curses program itself. If you exit the spawned program you should return to the original parent app.
What I've tried so far is an os.system call inside the parent:
os.system("python curses_app2.py")
and this works fine, spawning the 2nd program, although I do end up with 2 separate python processes. However, when I exit the second 'spawned' app, it does not return me to the original parent app. I just get dropped to a terminal - it's as if the first app never re-initializes.
Just curious if anyone has ever done this before. I *could* just make everything into one big standalone app, but I'd prefer not to. I really like the idea of having each separate part of the app be a different file, for organization and maintenance, if for nothing else.