Message92140
Currently, the runpy._run_module_as_main() function allows a launch
script to mimic Python's -m switch fairly well.
This RFE suggests making it possible to mimic other command line
behaviour of the CPython interpreter in a documented fashion:
run_module_as_main - document and make public the existing
_run_module_as_main function (exposes -m style functionality)
run_path_as_main - accept a filesystem path and execute it as per the
command line rules for executing named scripts, zipfiles and directories
(exposes normal script execution functionality)
run_file_as_main - accept a file-like object and execute it as per the
command line rules for executing stdin (exposes '-' style functionality)
run_code_as_main - accept a string or code object and execute it
(exposes -c style functionality)
The runpy module would also be updated to expose these via its command
line to ensure they achieve their stated goal of allowing a launch
script to mimic the native interpreter behaviour. Due to the legacy of
implementing -m style execution by default, the module command line will
expose filesystem path execution through a '-f' switch. |
|
Date |
User |
Action |
Args |
2009-09-01 10:56:39 | ncoghlan | set | recipients:
+ ncoghlan |
2009-09-01 10:56:39 | ncoghlan | set | messageid: <1251802599.29.0.539498266032.issue6816@psf.upfronthosting.co.za> |
2009-09-01 10:56:37 | ncoghlan | link | issue6816 messages |
2009-09-01 10:56:36 | ncoghlan | create | |
|