本文整理匯總了Python中commopy.Bash.move方法的典型用法代碼示例。如果您正苦於以下問題:Python Bash.move方法的具體用法?Python Bash.move怎麽用?Python Bash.move使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類commopy.Bash
的用法示例。
在下文中一共展示了Bash.move方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: alt_incvm
# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import move [as 別名]
def alt_incvm(src, dst):
"""
CONW, ECLI を書き換えて出力する
"""
call("cat {0}/IN.CVM | sed 's/CONW=T/CONW=F/g' | "
"sed 's/ECLI=T/ECLI=F/g' > tmp".format(src), shell=True)
Bash.move('tmp', os.path.join(dst, "IN.CVM"))
示例2: find_cif_files
# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import move [as 別名]
def find_cif_files(path):
"""
This method find **.cif or **.cif.txt in path and path/cifs directory.
All cif files are moved in path/cifs/ dirctory
"""
cifs_dir = os.path.join(path, 'cifs')
Bash.mkdir(cifs_dir)
search_cif = glob.glob(os.path.join(path, "*.cif"))
search_ciftxt = glob.glob(os.path.join(path, "*.cif.txt"))
search_cwd = search_cif + search_ciftxt
for cif_file in search_cwd:
Bash.move(cif_file, cifs_dir)
search_cif = glob.glob(os.path.join(cifs_dir, "*.cif"))
search_ciftxt = glob.glob(os.path.join(cifs_dir, "*.cif.txt"))
search_cifs = search_cif + search_ciftxt
if len(search_cifs) == 0:
print('I cannot find any .cif file in {0} and {1}'
.format(path, cifs_dir))
exit()
return search_cifs