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 <>
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\\', 'a', '-2']
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: <>
2015-04-16 08:09:52terry.reedylinkissue5680 messages
2015-04-16 08:09:52terry.reedycreate