本文整理汇总了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