This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients Saimadhav.Heblikar, asvetlov, ggenellina, gpolo, mrabarnett, rhettinger, terry.reedy
Date 2015-04-16.08:09:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429171792.74.0.798879494364.issue5680@psf.upfronthosting.co.za>
In-reply-to
Content
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']
History
Date User Action Args
2015-04-16 08:09:52terry.reedysetrecipients: + terry.reedy, rhettinger, ggenellina, gpolo, mrabarnett, asvetlov, Saimadhav.Heblikar
2015-04-16 08:09:52terry.reedysetmessageid: <1429171792.74.0.798879494364.issue5680@psf.upfronthosting.co.za>
2015-04-16 08:09:52terry.reedylinkissue5680 messages
2015-04-16 08:09:52terry.reedycreate