本文整理汇总了Python中UtilFunc.appendNumberToFileName方法的典型用法代码示例。如果您正苦于以下问题:Python UtilFunc.appendNumberToFileName方法的具体用法?Python UtilFunc.appendNumberToFileName怎么用?Python UtilFunc.appendNumberToFileName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UtilFunc
的用法示例。
在下文中一共展示了UtilFunc.appendNumberToFileName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_appendNumberToFileName_02
# 需要导入模块: import UtilFunc [as 别名]
# 或者: from UtilFunc import appendNumberToFileName [as 别名]
def test_appendNumberToFileName_02(self):
self.assertEqual( UtilFunc.appendNumberToFileName('parentPath/Word_Input_LastFirst.py','3') , 'parentPath/Word_Input_LastFirst_3.py' )
示例2: test_appendNumberToFileName_04
# 需要导入模块: import UtilFunc [as 别名]
# 或者: from UtilFunc import appendNumberToFileName [as 别名]
def test_appendNumberToFileName_04(self):
self.skipTest('Decide if needed')
self.assertEqual( UtilFunc.appendNumberToFileName('parentPath/Word_Input_LastFirst.py',3) , 'parentPath/Word_Input_LastFirst_3.py' )
示例3: str
# 需要导入模块: import UtilFunc [as 别名]
# 或者: from UtilFunc import appendNumberToFileName [as 别名]
fileListing = [os.path.join(inputPath,f) for f in os.listdir(inputPath)]
# print 'mf1 {}'.format(fileListing)
for fileName in fileListing:
# print 'name\t{}]'.format(fileListing)
#sometimes there are hidden files that break the script
if fileName.split('/')[-1][0] == '.':
continue
name = UtilFunc.parseNameFromFile(fileName)
number = UtilFunc.parseNumberFromFile(fileName)
# print '### fileName: {0}'.format(fileName)
# print '### name: {}, number: {}'.format(name, number)
#TODO: decide if this should be done as a prep step
if number == '':
number = str(getNumberFromNameInFile(name, yearbookReferenceFilePath))
# print '### Numer: {0}'.format(number)
fileNameWithNumber = UtilFunc.appendNumberToFileName(fileName,number)
shutil.copy(fileName,fileNameWithNumber)
os.remove(fileName)
fileName = fileNameWithNumber
# print 'Parsing: name = {0}\t number = {1}'.format(name,number)
outputFilePathPrevious = ''
for mf2 in moduleFunctions[moduleIndex1:]:
inputFilePath = '{0}/Input/{1}_Input_{2}_{3}.csv'.format( mf2['ModulePath'],
mf2['ModuleName'],
name,
number)
inputCompleteFilePath = '{0}/InputComplete/{1}_Input_{2}_{3}.csv'.format( mf2['ModulePath'],
mf2['ModuleName'],
name,