()
return args
Return a list of command-line arguments reproducing the current
    settings in sys.flags, sys.warnoptions and sys._xoptions.
Return a list of command-line arguments reproducing the current
    settings in sys.flags, sys.warnoptions and sys._xoptions.
Return a list of command - line arguments reproducing the current settings in sys . flags sys . warnoptions and sys . _xoptions .
def _args_from_interpreter_flags():
    """Return a list of command-line arguments reproducing the current
    settings in sys.flags, sys.warnoptions and sys._xoptions."""
    flag_opt_map = {
        'debug': 'd',
        # 'inspect': 'i',
        # 'interactive': 'i',
        'dont_write_bytecode': 'B',
        'no_site': 'S',
        'verbose': 'v',
        'bytes_warning': 'b',
        'quiet': 'q',
        # -O is handled in _optim_args_from_interpreter_flags()
    }
    args = _optim_args_from_interpreter_flags()
    for flag, opt in flag_opt_map.items():
        v = getattr(sys.flags, flag)
        if v > 0:
            args.append('-' + opt * v)

    if sys.flags.isolated:
        args.append('-I')
    else:
        if sys.flags.ignore_environment:
            args.append('-E')
        if sys.flags.no_user_site:
            args.append('-s')

    # -W options
    warnopts = sys.warnoptions[:]
    bytes_warning = sys.flags.bytes_warning
    xoptions = getattr(sys, '_xoptions', {})
    dev_mode = ('dev' in xoptions)

    if bytes_warning > 1:
        warnopts.remove("error::BytesWarning")
    elif bytes_warning:
        warnopts.remove("default::BytesWarning")
    if dev_mode:
        warnopts.remove('default')
    for opt in warnopts:
        args.append('-W' + opt)

    # -X options
    if dev_mode:
        args.extend(('-X', 'dev'))
    for opt in ('faulthandler', 'tracemalloc', 'importtime',
                'showrefcount', 'utf8'):
        if opt in xoptions:
            value = xoptions[opt]
            if value is True:
                arg = opt
            else:
                arg = '%s=%s' % (opt, value)
            args.extend(('-X', arg))

    return args
def _args_from_interpreter_flags ( ) : flag_opt_map = { 'debug' : 'd' , # 'inspect': 'i', # 'interactive': 'i', 'dont_write_bytecode' : 'B' , 'no_site' : 'S' , 'verbose' : 'v' , 'bytes_warning' : 'b' , 'quiet' : 'q' , # -O is handled in _optim_args_from_interpreter_flags() } args = _optim_args_from_interpreter_flags ( ) for flag , opt in flag_opt_map . items ( ) : v = getattr ( sys . flags , flag ) if v > 0 : args . append ( '-' + opt * v ) if sys . flags . isolated : args . append ( '-I' ) else : if sys . flags . ignore_environment : args . append ( '-E' ) if sys . flags . no_user_site : args . append ( '-s' ) # -W options warnopts = sys . warnoptions [ : ] bytes_warning = sys . flags . bytes_warning xoptions = getattr ( sys , '_xoptions' , { } ) dev_mode = ( 'dev' in xoptions ) if bytes_warning > 1 : warnopts . remove ( "error::BytesWarning" ) elif bytes_warning : warnopts . remove ( "default::BytesWarning" ) if dev_mode : warnopts . remove ( 'default' ) for opt in warnopts : args . append ( '-W' + opt ) # -X options if dev_mode : args . extend ( ( '-X' , 'dev' ) ) for opt in ( 'faulthandler' , 'tracemalloc' , 'importtime' , 'showrefcount' , 'utf8' ) : if opt in xoptions : value = xoptions [ opt ] if value is True : arg = opt else : arg = '%s=%s' % ( opt , value ) args . extend ( ( '-X' , arg ) ) return args