當前位置: 首頁>>代碼示例>>Python>>正文


Python DirectoryChooser.replace方法代碼示例

本文整理匯總了Python中ij.io.DirectoryChooser.replace方法的典型用法代碼示例。如果您正苦於以下問題:Python DirectoryChooser.replace方法的具體用法?Python DirectoryChooser.replace怎麽用?Python DirectoryChooser.replace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ij.io.DirectoryChooser的用法示例。


在下文中一共展示了DirectoryChooser.replace方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: run

# 需要導入模塊: from ij.io import DirectoryChooser [as 別名]
# 或者: from ij.io.DirectoryChooser import replace [as 別名]
def run():
	bPrintLog(' ', 0)
	bPrintLog('=====================================', 0)
	bPrintLog('Running bAlign_Batch_v7', 0)
	bPrintLog('=====================================', 0)

	if len(sys.argv) < 2:
		print "   We need a hard-drive folder with .tif stacks as input"
		print "	  Usage: ./fiji-macosx bALign_Batch_7 <full-path-to-folder>/"
		# Prompt user for a folder
		sourceFolder = DirectoryChooser("Please Choose A Directory Of .tif Files").getDirectory()
		if not sourceFolder:
			return 0
		strippedFolder = sourceFolder.replace(' ', '')
		if sourceFolder != strippedFolder:
			print 'found a space in specified path. Pease remove spaces and try again.'
			print 'path:', sourceFolder
			errorDialog = GenericDialog('Align Batch 7 Options')
			errorDialog.addMessage('bAlignBatch7 Error !!!')
			errorDialog.addMessage('There can not be any spaces in the path.')
			errorDialog.addMessage('Please remove spaces and try again.')
			errorDialog.addMessage('Offending path is:')
			errorDialog.addMessage(sourceFolder)
			errorDialog.showDialog()
			return 0
	else:
		sourceFolder = sys.argv[1] #assuming it ends in '/'
	
	if not os.path.isdir(sourceFolder):
		bPrintLog('\nERROR: run() did not find folder: ' + sourceFolder + '\n',0)
		return 0

	
	if (Options(sourceFolder)):
		runOneFolder(sourceFolder)

	bPrintLog('=====================================', 0)
	bPrintLog('Done bAlign_Batch_v7', 0)
	bPrintLog('=====================================', 0)
        bPrintLog(' ', 0)
開發者ID:cudmore,項目名稱:bob-fiji-plugins,代碼行數:42,代碼來源:bAlignBatch_v7_2.py


注:本文中的ij.io.DirectoryChooser.replace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。