本文整理汇总了Python中sys.argv.remove函数的典型用法代码示例。如果您正苦于以下问题:Python remove函数的具体用法?Python remove怎么用?Python remove使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了remove函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: detect_igraph_library_dirs
def detect_igraph_library_dirs(default=LIBIGRAPH_FALLBACK_LIBRARY_DIRS):
"""Tries to detect the igraph library directory"""
line, exit_code = get_output("pkg-config igraph --libs")
if exit_code > 0 or len(line) == 0:
return default
opts = line.split()
return [opt[2:] for opt in opts if opt[0:2] == "-L"]
sources = glob.glob(os.path.join("src", "*.c"))
include_dirs = []
library_dirs = []
libraries = []
if "--no-pkg-config" in argv:
argv.remove("--no-pkg-config")
libraries.append("igraph")
else:
line, exit_code = get_output("pkg-config igraph")
if exit_code > 0:
print("Using default include and library paths for compilation")
print("If the compilation fails, please edit the LIBIGRAPH_FALLBACK_*")
print("variables in setup.py or include_dirs and library_dirs in ")
print("setup.cfg to point to the correct directories and libraries")
print("where the C core of igraph is installed")
print("")
include_dirs.extend(detect_igraph_include_dirs())
library_dirs.extend(detect_igraph_library_dirs())
libraries.extend(detect_igraph_libraries())
开发者ID:janschulz,项目名称:igraph,代码行数:30,代码来源:setup.py
示例17: exit
try:
import nose
except ImportError:
print >> stderr, """\
Requires Nose. Try:
$ sudo easy_install nose
Exiting. """
exit(1)
if "--with-coverage" in argv:
try:
import coverage
except ImportError:
print >> stderr, "No coverage module found, skipping code coverage."
argv.remove("--with-coverage")
else:
NOSE_ARGS += COVERAGE_EXTRA_ARGS
if True not in [a.startswith("-a") or a.startswith("--attr=") for a in argv]:
argv.append("--attr=" + ",".join(DEFAULT_ATTRS))
if not [a for a in argv[1:] if not a.startswith("-")]:
argv += DEFAULT_DIRS # since nose doesn't look here by default..
finalArgs = argv + NOSE_ARGS
print "Running nose with:", " ".join(finalArgs[1:])
nose.run_exit(argv=finalArgs)
开发者ID:alcides,项目名称:rdflib,代码行数:29,代码来源:run_tests.py
示例18: setup
def setup(path, ext_modules=None):
ext_modules = ext_modules or []
config = get_config()
package_root = config.get_value('package_root')
# Guess environment
if "--development" in argv:
environment = 'development'
argv.remove("--development")
else:
environment = 'production'
# Build
if any(x in argv for x in ('build', 'install', 'sdist', 'egg_info')):
version = build(path, config, environment)
else:
version = get_package_version(package_root)
# Initialize variables
package_name = config.get_value('package_name')
if package_name is None:
package_name = config.get_value('name')
packages = [package_name]
package_data = {package_name: []}
# The sub-packages
if config.has_value('packages'):
subpackages = config.get_value('packages')
for subpackage_name in subpackages:
packages.append('%s.%s' % (package_name, subpackage_name))
else:
subpackages = []
# Python files are included by default
filenames = [ x.strip() for x in open(path + 'MANIFEST').readlines() ]
filenames = [ x for x in filenames if not x.endswith('.py') ]
# The data files
prefix = '' if package_root == '.' else package_root + '/'
prefix_n = len(prefix)
for line in filenames:
if not line.startswith(prefix):
continue
line = line[prefix_n:]
path = line.split('/')
if path[0] in subpackages:
subpackage = '%s.%s' % (package_name, path[0])
files = package_data.setdefault(subpackage, [])
files.append(join_path(*path[1:]))
elif path[0] not in ('archive', 'docs', 'scripts', 'test'):
package_data[package_name].append(line)
# The scripts
if config.has_value('scripts'):
scripts = config.get_value('scripts')
scripts = [ join_path(*['scripts', x]) for x in scripts ]
else:
scripts = []
# Long description
if exists('README.rst'):
with codecs.open('README.rst', 'r', 'utf-8') as readme:
long_description = readme.read()
else:
long_description = config.get_value('description')
author_name = config.get_value('author_name')
# Requires
install_requires = []
if exists('requirements.txt'):
install_requires = parse_requirements(
'requirements.txt', session=PipSession())
install_requires = [str(ir.req) for ir in install_requires]
# XXX Workaround buggy distutils ("sdist" don't likes unicode strings,
# and "register" don't likes normal strings).
if 'register' in argv:
author_name = unicode(author_name, 'utf-8')
classifiers = [ x for x in config.get_value('classifiers') if x ]
core.setup(name = package_name,
version = version,
# Metadata
author = author_name,
author_email = config.get_value('author_email'),
license = config.get_value('license'),
url = config.get_value('url'),
description = config.get_value('title'),
long_description = long_description,
classifiers = classifiers,
# Packages
package_dir = {package_name: package_root},
packages = packages,
package_data = package_data,
# Requires / Provides
install_requires=install_requires,
# Scripts
scripts = scripts,
cmdclass = {'build_ext': OptionalBuildExt},
# C extensions
ext_modules=ext_modules)
开发者ID:hforge,项目名称:itools,代码行数:98,代码来源:utils.py
示例19: mode
#!/usr/bin/env python
import re
from sys import argv, stdout, stderr, exit, modules
from optparse import OptionParser
# import ROOT with a fix to get batch mode (http://root.cern.ch/phpBB3/viewtopic.php?t=3198)
argv.append("-b-")
import ROOT
ROOT.gROOT.SetBatch(True)
argv.remove("-b-")
from HiggsAnalysis.CombinedLimit.DatacardParser import *
from HiggsAnalysis.CombinedLimit.ModelTools import *
from HiggsAnalysis.CombinedLimit.ShapeTools import *
from HiggsAnalysis.CombinedLimit.PhysicsModel import *
parser = OptionParser(usage="usage: %prog [options] datacard.txt -o output \nrun with --help to get list of options")
addDatacardParserOptions(parser)
parser.add_option(
"-P",
"--physics-model",
dest="physModel",
default="HiggsAnalysis.CombinedLimit.PhysicsModel:defaultModel",
type="string",
help="Physics model to use. It should be in the form (module name):(object name)",
)
parser.add_option(
"--PO",
"--physics-option",
dest="physOpt",
开发者ID:bispinck,项目名称:HiggsAnalysis-CombinedLimit,代码行数:31,代码来源:text2workspace.py
示例20: setup
def setup(add_etc=True, **kwargs):
"""
Setup dedicated to canolibs projects.
:param add_etc: add automatically etc files (default True)
:type add_etc: bool
:param kwargs: enrich setuptools.setup method
"""
# get setup path which corresponds to first python argument
filename = argv[0]
_path = dirname(abspath(expanduser(filename)))
name = basename(_path)
# add path to python path
path.append(_path)
# extend canopsis path with new sub modules and packages
# canopsis.__path__ = extend_path(canopsis.__path__, canopsis.__name__)
# get package
package = lookup("canopsis.{0}".format(name))
# set default parameters if not setted
kwargs.setdefault('name', package.__name__)
kwargs.setdefault('author', AUTHOR)
kwargs.setdefault('author_email', AUTHOR_EMAIL)
kwargs.setdefault('license', LICENSE)
kwargs.setdefault('zip_safe', ZIP_SAFE)
kwargs.setdefault('url', URL)
kwargs.setdefault('package_dir', {'': _path})
kwargs.setdefault('keywords', kwargs.get('keywords', '') + KEYWORDS)
# set version
version = getattr(package, '__version__', DEFAULT_VERSION)
if version is not None:
kwargs.setdefault('version', version)
if '--no-conf' not in argv:
# add etc content if exist and if --no-conf
if add_etc:
etc_path = join(_path, 'etc')
if exists(etc_path):
data_files = kwargs.get('data_files', [])
target = getenv('CPS_PREFIX', join(sys_prefix, 'etc'))
for root, dirs, files in walk(etc_path):
files_to_copy = [join(root, _file) for _file in files]
final_target = join(target, root[len(etc_path) + 1:])
data_files.append((final_target, files_to_copy))
kwargs['data_files'] = data_files
else:
argv.remove('--no-conf')
# add scripts if exist
if 'scripts' not in kwargs:
scripts_path = join(_path, 'scripts')
if exists(scripts_path):
scripts = []
for root, dirs, files in walk(scripts_path):
for _file in files:
scripts.append(join(root, _file))
kwargs['scripts'] = scripts
# add packages
if 'packages' not in kwargs:
packages = find_packages(where=_path, exclude=TEST_FOLDERS)
kwargs['packages'] = packages
# add description
if 'long_description' not in kwargs:
readme_path = join(_path, 'README')
if exists(readme_path):
with open(join(_path, 'README')) as f:
kwargs['long_description'] = f.read()
# add test
if 'test_suite' not in kwargs:
test_folders = \
[folder for folder in TEST_FOLDERS if exists(join(_path, folder))]
if test_folders:
for test_folder in test_folders:
kwargs['test_suite'] = test_folder
break
_setup(**kwargs)
开发者ID:crudbug,项目名称:canopsis,代码行数:91,代码来源:setup.py
注:本文中的sys.argv.remove函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论