本文整理汇总了Python中sys.argv.pop方法的典型用法代码示例。如果您正苦于以下问题:Python argv.pop方法的具体用法?Python argv.pop怎么用?Python argv.pop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sys.argv
的用法示例。
在下文中一共展示了argv.pop方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mark_uploaded
# 需要导入模块: from sys import argv [as 别名]
# 或者: from sys.argv import pop [as 别名]
def mark_uploaded(cache_name):
with todo_file() as todo:
todo.pop(cache_name, None)
示例2: plotColumnsSimple
# 需要导入模块: from sys import argv [as 别名]
# 或者: from sys.argv import pop [as 别名]
def plotColumnsSimple(specs, outFile=None, rmsDiffFrom=None, floatFormat=None,
colors='bgrcmyk', markers='+x^svD<4>3', **options):
"""Plot olumns of numbers from one or more data files.
Each plot spec. contains a filename and a list of labelled columns:
e.g., ('file1', 'xlabel:1,ylabel1:4,ylabel2:2,ylabel3:13)
Bug: For the moment, only have 7 different colors and 10 different markers.
"""
ensureItems(options, {'legend': True})
ydataMaster = None
for spec in specs:
file, columns = spec # each spec is a (file, columnList) pair
columns = columns.split(',') # each columnList is a comma-separated list of named columns
# Each named column is a colon-separated pair or triple 'label:integer[:style]'
# Column indices are one-based.
# Styles are concatenated one-char flags like 'go' for green circles or
# 'kx-' for black X's with a line.
fields = N.array([map(floatOrMiss, line.split()) for line in open(file, 'r')])
xcol = columns.pop(0) # first column in list is the x axis
xlabel, xcol, xstyle = splitColumnSpec(xcol)
xdata = fields[:,xcol-1]
markIndex = 0
for ycol in columns:
ylabel, ycol, ystyle = splitColumnSpec(ycol)
if ystyle is None: ystyle = colors[markIndex] + markers[markIndex]
ydata = fields[:,ycol-1] # all other columns are multiple y plots
if rmsDiffFrom:
if ydataMaster is None:
ydataMaster = ydata # kludge: must be first ycol in first file
ylabelMaster = ylabel
else:
s = diffStats(ylabelMaster, ydataMaster, ylabel, ydata)
print >>sys.stderr, s.format(floatFormat)
n, mean, sigma, min, max, rms = s.calc()
ylabel = ylabel + ' ' + floatFormat % rms
M.plot(xdata, ydata, ystyle, label=ylabel)
markIndex += 1
evalKeywordCmds(options)
if outFile: M.savefig(outFile)
示例3: plotColumnsGrouped
# 需要导入模块: from sys import argv [as 别名]
# 或者: from sys.argv import pop [as 别名]
def plotColumnsGrouped(specs, groupBy, outFile=None, rmsDiffFrom=None, floatFormat=None,
colors='bgrcmyk', markers='+x^svD<4>3', **options):
"""Plot olumns of numbers from one or more data files.
Each plot spec. contains a filename and a list of labelled columns:
e.g., ('file1', 'xlabel:1,ylabel1:4,ylabel2:2,ylabel3:13)
Bug: For the moment, only have 7 different colors and 10 different markers.
"""
ensureItems(options, {'legend': True})
ydataMaster = None
for spec in specs:
file, columns = spec # each spec is a (file, columnList) pair
columns = columns.split(',') # each columnList is a comma-separated list of named columns
# Each named column is a colon-separated pair or triple 'label:integer[:style]'
# Column indices are one-based.
# Styles are concatenated one-char flags like 'go' for green circles or
# 'kx-' for black X's with a line.
fields = N.array([map(floatOrMiss, line.split()) for line in open(file, 'r')])
xcol = columns.pop(0) # first column in list is the x axis
xlabel, xcol, xstyle = splitColumnSpec(xcol)
xdata = fields[:,xcol-1]
markIndex = 0
for ycol in columns:
ylabel, ycol, ystyle = splitColumnSpec(ycol)
if ystyle is None: ystyle = colors[markIndex] + markers[markIndex]
ydata = fields[:,ycol-1] # all other columns are multiple y plots
if rmsDiffFrom:
if ydataMaster is None:
ydataMaster = ydata # kludge: must be first ycol in first file
ylabelMaster = ylabel
else:
s = diffStats(ylabelMaster, ydataMaster, ylabel, ydata)
print >>sys.stderr, s.format(floatFormat)
n, mean, sigma, min, max, rms = s.calc()
ylabel = ylabel + ' ' + floatFormat % rms
M.plot(xdata, ydata, ystyle, label=ylabel)
markIndex += 1
evalKeywordCmds(options)
if outFile: M.savefig(outFile)
示例4: plotVtecAndJasonTracks
# 需要导入模块: from sys import argv [as 别名]
# 或者: from sys.argv import pop [as 别名]
def plotVtecAndJasonTracks(gtcFiles, outFile=None, names=None, makeFigure=True, show=False, **options):
"""Plot GAIM climate and assim VTEC versus JASON using at least two 'gc' files.
First file is usually climate file, and rest are assim files.
"""
ensureItems(options, {'title': 'GAIM vs. JASON for '+gtcFiles[0], \
'xlabel': 'Geographic Latitude (deg)', 'ylabel': 'VTEC (TECU)'})
if 'show' in options:
show = True
del options['show']
M.subplot(211)
gtcFile = gtcFiles.pop(0)
name = 'clim_'
if names: name = names.pop(0)
specs = [(gtcFile, 'latitude:2,jason:6,gim__:8,%s:13,iri__:10' % name)]
name = 'assim'
for i, gtcFile in enumerate(gtcFiles):
label = name
if len(gtcFiles) > 1: label += str(i+1)
specs.append( (gtcFile, 'latitude:2,%s:13' % label) )
plotColumns(specs, rmsDiffFrom='jason', floatFormat='%5.1f', **options)
M.legend()
M.subplot(212)
options.update({'title': 'JASON Track Plot', 'xlabel': 'Longitude (deg)', 'ylabel': 'Latitude (deg)'})
fields = N.array([map(floatOrMiss, line.split()) for line in open(gtcFiles[0], 'r')])
lons = fields[:,2]; lats = fields[:,1]
marksOnMap(lons, lats, show=show, **options)
if outFile: M.savefig(outFile)