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


Python UtilFunc.checkInputArgs方法代码示例

本文整理汇总了Python中UtilFunc.checkInputArgs方法的典型用法代码示例。如果您正苦于以下问题:Python UtilFunc.checkInputArgs方法的具体用法?Python UtilFunc.checkInputArgs怎么用?Python UtilFunc.checkInputArgs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UtilFunc的用法示例。


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

示例1: test_checkInputArgs_01

# 需要导入模块: import UtilFunc [as 别名]
# 或者: from UtilFunc import checkInputArgs [as 别名]
	def test_checkInputArgs_01(self):
		self.assertIsNone(UtilFunc.checkInputArgs(len(sys.argv)-1,['Failed if showing']))
开发者ID:cdslug,项目名称:ClassmateMemory,代码行数:4,代码来源:TestScript.py

示例2:

# 需要导入模块: import UtilFunc [as 别名]
# 或者: from UtilFunc import checkInputArgs [as 别名]
			lWork = l.replace('\r',',').replace('\n',',').split(',')
			for lw in lWork:
				lw = lw.strip()
				if lw != '':
					names.append(lw)
		for n in names:
			fOut.write('{}\n'.format(n))

	shutil.copy(inputFilePath,inputCompleteFilePath)
	os.remove(inputFilePath)
	return

########################
#####     MAIN     #####
########################
if __name__ == '__main__':
	usageDescription = ["inputFilePath: A full path to a .txt file that contains a list of full names separated by '\\n' or ','",
						'inputCompleteFilePath: ',
						'errorFilePath: ',
						'yearbookReferenceFilePath: A full path to a .csv file containing all expected classmates names along with their alphabetical index, among other details. See full documentation for extensive details',
						'outputFilePath: A full path to a .csv file']

	UtilFunc.checkInputArgs(5,usageDescription)

	inputFilePath = sys.argv[1]
	inputCompleteFilePath = sys.argv[2]
	errorFilePath = sys.argv[3]
	yearbookReferenceFilePath = sys.argv[4]
	outputFilePath = sys.argv[5]

	fixRawList(inputFilePath,inputCompleteFilePath, errorFilePath, yearbookReferenceFilePath,outputFilePath)
开发者ID:cdslug,项目名称:ClassmateMemory,代码行数:33,代码来源:FixRawList.py

示例3: writeToFile

# 需要导入模块: import UtilFunc [as 别名]
# 或者: from UtilFunc import checkInputArgs [as 别名]
					'YearbookLast':ln,
					'YearbookFirst':fn}
		groupDataWithNames.append(entry)

	return groupDataWithNames

def writeToFile(data, fileOutput):
	with open(fileOutput,'w') as fOut:
		fOut.write('GroupNumber,GroupScore,AlphaIndex,YearbookLast,YearbookFirst\n')
		for entry in data:
			fOut.write('{},{},{},{},{}\n'.format(	entry['GroupNumber'],
				   								entry['GroupScore'],
				   								entry['AlphaIndex'],
				   								entry['YearbookLast'],
				   								entry['YearbookFirst']))

########################
#####     MAIN     #####
########################
usageDescription = ['fileInput: A full path to a .csv file containing nXn pair scores',
					'yearbookNamesFile: A full path to a .csv file containing all expected classmates names along with their alphabetical index, among other details. See full documentation for extensive details',
					'fileOutput: A full path to a .csv file']
UtilFunc.checkInputArgs(3)

fileInput = sys.argv[1]
yearbookNamesFile = sys.argv[2]
fileOutput = sys.argv[3]

groupData = buildGroups(fileInput)
groupDataWithNames = attachNames(groupData,yearbookNamesFile)
writeToFile(groupDataWithNames, fileOutput)
开发者ID:cdslug,项目名称:ClassmateMemory,代码行数:33,代码来源:BuildGroupsFromPairs.py


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