本文整理匯總了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,