当前位置: 首页>>代码示例>>Python>>正文


Python argv.remove函数代码示例

本文整理汇总了Python中sys.argv.remove函数的典型用法代码示例。如果您正苦于以下问题:Python remove函数的具体用法?Python remove怎么用?Python remove使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了remove函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: on_actionNewSession_triggered

 def on_actionNewSession_triggered(self, checked=False):
     try:
         if len(argv) > 1:
             argv.remove(argv[1])
         pid = spawnvp(P_NOWAIT, argv[0], argv)
     except (NameError, ):
         Popen('"%s" "%s"' % (executable, argv[0], ))
开发者ID:InfiniteAlpha,项目名称:profitpy,代码行数:7,代码来源:main.py

示例2: main

def main():
    if "--setuptools" in argv:
        argv.remove("--setuptools")
        from setuptools import setup
        use_setuptools = True
    else:
        from distutils.core import setup
        use_setuptools = False

    fusil = load_source("version", path.join("fusil", "version.py"))
    PACKAGES = {}
    for name in MODULES:
        PACKAGES[name] = name.replace(".", "/")

    long_description = open('README').read() + open('ChangeLog').read()

    install_options = {
        "name": fusil.PACKAGE,
        "version": fusil.VERSION,
        "url": fusil.WEBSITE,
        "download_url": fusil.WEBSITE,
        "author": "Victor Stinner",
        "description": "Fuzzing framework",
        "long_description": long_description,
        "classifiers": CLASSIFIERS,
        "license": fusil.LICENSE,
        "packages": PACKAGES.keys(),
        "package_dir": PACKAGES,
        "scripts": SCRIPTS,
    }
    if use_setuptools:
        install_options["install_requires"] = ["python-ptrace>=0.6"]
    setup(**install_options)
开发者ID:cherry-wb,项目名称:segvault,代码行数:33,代码来源:setup.py

示例3: main

def main():
    from imp import load_source
    from os import path
    from sys import argv

    if "--setuptools" in argv:
        argv.remove("--setuptools")
        from setuptools import setup, Extension
    else:
        from distutils.core import setup, Extension

    cptrace_ext = Extension('cptrace', sources=SOURCES)

    cptrace = load_source("version", path.join("cptrace", "version.py"))

    install_options = {
        "name": cptrace.PACKAGE,
        "version": cptrace.VERSION,
        "url": cptrace.WEBSITE,
        "download_url": cptrace.WEBSITE,
        "license": cptrace.LICENSE,
        "author": "Victor Stinner",
        "description": "python binding of ptrace written in C",
        "long_description": LONG_DESCRIPTION,
        "classifiers": CLASSIFIERS,
        "ext_modules": [cptrace_ext],
    }
    setup(**install_options)
开发者ID:ksparakis,项目名称:python-ptrace,代码行数:28,代码来源:setup_cptrace.py

示例4: main

def main():
    if "--setuptools" in argv:
        argv.remove("--setuptools")
        from setuptools import setup
        use_setuptools = True
    else:
        from distutils.core import setup
        use_setuptools = False

    ufwi_conf = load_source("version", path.join("ufwi_conf", "version.py"))

    long_description = open('README').read() + open('ChangeLog').read()

    install_options = {
        "name": ufwi_conf.PACKAGE,
        "version": ufwi_conf.VERSION,
        "url": ufwi_conf.WEBSITE,
        "download_url": ufwi_conf.WEBSITE,
        "license": ufwi_conf.LICENSE,
        "author": "Francois Toussenel, Michael Scherrer, Feth Arezki, Pierre-Louis Bonicoli",
        "description": "System configuration backend and frontend",
        "long_description": long_description,
        "classifiers": CLASSIFIERS,
        "packages": PACKAGES,
    }
    if use_setuptools:
        install_options["install_requires"] = ["IPy>=0.42"]
    setup(**install_options)
开发者ID:maximerobin,项目名称:Ufwi,代码行数:28,代码来源:setup_ufwi_conf_backend.py

示例5: main

def main():
    if "--setuptools" in argv:
        argv.remove("--setuptools")
        from setuptools import setup
    else:
        from distutils.core import setup

    fusil = load_source("version", path.join("fusil", "version.py"))
    PACKAGES = {}
    for name in MODULES:
        PACKAGES[name] = name.replace(".", "/")

    install_options = {
        "name": fusil.PACKAGE,
        "version": fusil.VERSION,
        "url": fusil.WEBSITE,
        "download_url": fusil.WEBSITE,
        "author": "Victor Stinner",
        "description": "Fuzzing framework",
        "long_description": open('README').read(),
        "classifiers": CLASSIFIERS,
        "license": fusil.LICENSE,
        "packages": PACKAGES.keys(),
        "package_dir": PACKAGES,
        "scripts": ("scripts/fusil",),
    }
    setup(**install_options)
开发者ID:tuwid,项目名称:darkc0de-old-stuff,代码行数:27,代码来源:setup.py

示例6: main

def main():
    if "--setuptools" in argv:
        argv.remove("--setuptools")
        from setuptools import setup
        use_setuptools = True
    else:
        from distutils.core import setup
        use_setuptools = False

    ufwi_ruleset = load_source("version", path.join("ufwi_ruleset", "version.py"))

    long_description = open('README').read() + open('ChangeLog').read()

    install_options = {
        "name": "ufwi_rulesetqt",
        "version": ufwi_ruleset.VERSION,
        "url": ufwi_ruleset.WEBSITE,
        "download_url": ufwi_ruleset.WEBSITE,
        "license": ufwi_ruleset.LICENSE,
        "author": "Victor Stinner",
        "description": "Netfilter configuration backend",
        "long_description": long_description,
        "classifiers": CLASSIFIERS,
        "packages": PACKAGES,
        "scripts": ("ufwi_ruleset_qt",),
    }
    if use_setuptools:
        install_options["install_requires"] = ["ufwi_ruleset>=3.0", "PyQt4>=4.4"]
    setup(**install_options)
开发者ID:maximerobin,项目名称:Ufwi,代码行数:29,代码来源:setup_ufwi_rulesetqt.py

示例7: main

def main():
    from imp import load_source
    from os import path
    from sys import argv

    if "--setuptools" in argv:
        argv.remove("--setuptools")
        from setuptools import setup
    else:
        from distutils.core import setup

    ptrace = load_source("version", path.join("ptrace", "version.py"))
    PACKAGES = {}
    for name in MODULES:
        PACKAGES[name] = name.replace(".", "/")

    install_options = {
        "name": ptrace.PACKAGE,
        "version": ptrace.VERSION,
        "url": ptrace.WEBSITE,
        "download_url": ptrace.WEBSITE,
        "author": "Victor Stinner",
        "description": "python binding of ptrace",
        "long_description": LONG_DESCRIPTION,
        "classifiers": CLASSIFIERS,
        "license": ptrace.LICENSE,
        "packages": PACKAGES.keys(),
        "package_dir": PACKAGES,
        "scripts": SCRIPTS,
    }
    setup(**install_options)
开发者ID:cherry-wb,项目名称:segvault,代码行数:31,代码来源:setup.py

示例8: main

def main():
    printSolutions = "-p" in argv
    bfsSearch = "-bfs" in argv
    if printSolutions:
        argv.remove("-p")
    if bfsSearch:
        argv.remove("-bfs")
    if len(argv) != 3:
        print "Usage:\t rushhour.py [-p] [-bfs] inputFile outputFile"
        print "\t -p \t print solution to stdout"
        print "\t -bfs \t do a depth-first search"
        exit()
    inPath = argv[1]
    outPath = argv[2]
            
    g = Grid(6, 6, 3)
    loadToGrid(inPath, g)
    g.printGrid()
    Solver = Search(g)
    Solver.useBFS(bfsSearch)
    moves = Solver.aStarSearch()
    if moves != []:
        print ("Solved in %i moves" % len(moves))
        if printSolutions:
            Solver.printSolution(moves)
        writeToFile(outPath, moves)
    else:
        print "No Solution Found"
开发者ID:petertsoi,项目名称:Rush-Hour,代码行数:28,代码来源:rushhour.py

示例9: main

def main():
    if "--setuptools" in argv:
        argv.remove("--setuptools")
        from setuptools import setup
        use_setuptools = True
    else:
        from distutils.core import setup
        use_setuptools = False

    long_description = "Edenwall multisite interface"

    install_options = {
        "name": "ew4-multisite-qt",
        "version": "1.0",
        "url": "http://inl.fr/",
        "download_url": "",
        "license": "License",
        "author": "Laurent Defert",
        "description": "Edenwall multisite interface",
        "long_description": long_description,
        "classifiers": CLASSIFIERS,
        "packages": PACKAGES,
        "scripts": ("ew4-multisite-qt",),
    }
    if use_setuptools:
        install_options["install_requires"] = ["nufaceqt>=3.0", "PyQt4>=4.4"]
    setup(**install_options)
开发者ID:maximerobin,项目名称:Ufwi,代码行数:27,代码来源:setup.py

示例10: popoption

def popoption(ident, argv=None):
    if argv is None:
        from sys import argv
    if len(ident) == 1:
        ident = "-" + ident
    else:
        ident = "--" + ident
    found = ident in argv
    if found:
        argv.remove(ident)
    return found
开发者ID:pkgw,项目名称:pwpy,代码行数:11,代码来源:calmodels.py

示例11: parse_args

def parse_args():
    global _arguments
    if _arguments is None:
        _arguments = _parser.parse_args()
        app_args = ['--bs-name', '--bs-key', '--app-username', '--app-password', '--config', '--host']

        for name in _arguments.__dict__:
            if name != 'tests' and name != 'xunit_file':
                value = getattr(_arguments, name)
                if value in argv:
                    argv.remove(value)

        for name in app_args:
            if name in argv:
                argv.remove(name)
开发者ID:dragonfly-science,项目名称:lavender,代码行数:15,代码来源:call_arguments.py

示例12: mainMenu

    def mainMenu(self):
        # COMMAND LINE ARGUMENTS (ARGV[0] IS FILENAME).
        if len(argv) > 1:
            if "--quiet" in argv:
                argv.remove("--quiet")
                Write().get(" ".join(argv[1:]), quiet=True)     # p.w. only
            else:
                Write().get(" ".join(argv[1:]))                 # full info
        print("""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 random p.a.s.s.w.o.r.d. manager
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[1] make
[2] enter yourself
[3] quick
~~~~~~~~~~~~~~~~~~
[4] get
[5] edit
[6] delete
~~~~~~~~~~~~~~~~~~
[7] print all
[8] change all
~~~~~~~~~~~~~~~~~~
[9] options
[0] quit
~~~~~~~~~~~~~~~~~~
""")
        menu = {
            "1": "Write().make()",                                  # ==> make.
            "2": "Write().make(rand=False)",              # ==> enter yourself.
            "3": "print(Write().quick())",                         # ==> quick.
            "4": "Write().get()",                                    # ==> get.
            "5": "Write().edit()",                                  # ==> edit.
            "6": "Write().delete()",                              # ==> delete.
            "7": "self.printAll()",               # ==> print all to text file.
            "8": "Write().changeAll()",                       # ==> change all.
            "9": "Options().optionsMenu()",                      # ==> options.
            "0": "self.quit()"                                      # ==> quit.
        }
        i = input()
        if i in menu:
            eval(menu[i])
            input("[enter] ...")              # pause before looping main menu.
        self.mainMenu()                    # loop main menu until [quit] given.
开发者ID:rodrev,项目名称:random-password-manager,代码行数:44,代码来源:rpm.py

示例13: popoption

def popoption (ident, argv=None):
##<
## A lame routine for grabbing command-line arguments. Returns a
## boolean indicating whether the option was present. If it was, it's
## removed from the argument string. Because of the lame behavior,
## options can't be combined, and non-boolean options aren't
## supported. Operates on sys.argv by default.
##
## Note that this will proceed merrily if argv[0] matches your option.
##>
    if argv is None:
        from sys import argv
    if len (ident) == 1:
        ident = '-' + ident
    else:
        ident = '--' + ident
    found = ident in argv
    if found:
        argv.remove (ident)
    return found
开发者ID:aimran,项目名称:pwpy,代码行数:20,代码来源:popoption.py

示例14: main

def main():
    from domainmodeller import settings
    
    # Parse command line arguments
    from sys import argv

    verbose = '-v' in argv
    if verbose: argv.remove('-v')

    log_level = logging.DEBUG if '-vv' in argv else logging.INFO
    if log_level==logging.DEBUG: argv.remove('-vv')
    
    if '-D' in argv:
        loc = argv.index('-D')
        del argv[loc]
        database = argv[loc]
        del argv[loc]
    else:
        database = settings.DATABASE

    from domainmodeller.storage import Storage
    storage = Storage.init_storage(database, **settings.BACKEND)
    run(storage, argv[1:], log_console=verbose, log_level=log_level)
开发者ID:insight-unlp,项目名称:domainmodeller,代码行数:23,代码来源:main.py

示例15: main

def main():
    if "--setuptools" in argv:
        argv.remove("--setuptools")
        from setuptools import setup
        use_setuptools = True
    else:
        from distutils.core import setup
        use_setuptools = False


    hachoir_parser = load_source("version", path.join("hachoir_parser", "version.py"))
    PACKAGES = {"hachoir_parser": "hachoir_parser"}
    for name in MODULES:
        PACKAGES["hachoir_parser." + name] = "hachoir_parser/" + name

    readme = open('README')
    long_description = readme.read()
    readme.close()

    install_options = {
        "name": hachoir_parser.PACKAGE,
        "version": hachoir_parser.__version__,
        "url": hachoir_parser.WEBSITE,
        "download_url": hachoir_parser.WEBSITE,
        "author": "Hachoir team (see AUTHORS file)",
        "description": "Package of Hachoir parsers used to open binary files",
        "long_description": long_description,
        "classifiers": CLASSIFIERS,
        "license": hachoir_parser.LICENSE,
        "packages": PACKAGES.keys(),
        "package_dir": PACKAGES,
    }
    if use_setuptools:
        install_options["install_requires"] = "hachoir-core>=1.3"
        install_options["zip_safe"] = True
    setup(**install_options)
开发者ID:Woerd88,项目名称:hachoir,代码行数:36,代码来源:setup.py


注:本文中的sys.argv.remove函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。