Message241206
Pending application of a patch, the following will work to only add args to sys.argv when running from an Idle editor.
import sys
# ...
if __name__ == '__main__':
if 'idlelib.PyShell' in sys.modules:
sys.argv.extend(('a', '-2')) # add your argments here.
print(sys.argv) # in use, parse sys.argv after extending it
# ['C:\\Programs\\python34\\tem.py', 'a', '-2'] |
|
Date |
User |
Action |
Args |
2015-04-16 08:09:52 | terry.reedy | set | recipients:
+ terry.reedy, rhettinger, ggenellina, gpolo, mrabarnett, asvetlov, Saimadhav.Heblikar |
2015-04-16 08:09:52 | terry.reedy | set | messageid: <1429171792.74.0.798879494364.issue5680@psf.upfronthosting.co.za> |
2015-04-16 08:09:52 | terry.reedy | link | issue5680 messages |
2015-04-16 08:09:52 | terry.reedy | create | |
|