runpy

Python IDLE: Run main?

I'm in IDLE: >>> import mymodule >>> # ??? After importing a module with: if __name__ == '__main__': doStuff() How do I actually call main from IDLE? ...

nightmare with relative imports, how does pep 366 work?

I have a "canonical file structure" like that (I'm giving sensible names to ease the reading): mainpack/ __main__.py __init__.py - helpers/ __init__.py path.py - network/ __init__.py clientlib.py server.py - gui/ __init__.py mainwindow.py controllers.py In this structure, for exam...

How to execute another python script from your script and be able to debug?

You have wrapper python script that is calling another python script, currently using os.system('python another.py some-params'). You want to be able to debug both scripts and if you use os.system() you'll loose the debugger, so it does make sense to load the second script using the same interpretor instead of starting another one. imp...