当前位置: 首页>>代码示例>>Python>>正文


Python Bash.execute方法代码示例

本文整理汇总了Python中commopy.Bash.execute方法的典型用法代码示例。如果您正苦于以下问题:Python Bash.execute方法的具体用法?Python Bash.execute怎么用?Python Bash.execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在commopy.Bash的用法示例。


在下文中一共展示了Bash.execute方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: view_osz

# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import execute [as 别名]
    def view_osz(self):
        path = '.'
        if self.value.value == 'EV curve':
            path = glob.glob('voldep/volume_*')[0]
        print(path)

        Bash.execute("emacs {0}/OSZICAR".format(path))
开发者ID:hackberie,项目名称:00_workSpace,代码行数:9,代码来源:enshu_vasp.py

示例2: conv2poscar

# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import execute [as 别名]
 def conv2poscar(cif_file, out_path):
     """
     A cif file convert to POSCAR
     """
     cif_file = os.path.normpath(cif_file)
     cmd = 'cif2cell -p vasp -f {0} -o {1}/POSCAR --no-reduce \
     --vasp-print-species --vasp-cartesian-lattice-vectors \
     --vasp-format=5'.format(cif_file, out_path)
     Bash.execute(cmd)
开发者ID:buriedwood,项目名称:00_workSpace,代码行数:11,代码来源:cifpy.py

示例3: execute

# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import execute [as 别名]
 def execute(self):
     if self.value == 'EV curve':
         Bash.execute("batch_run.sh 100")
     else:
         Bash.execute("qsub run.sh")
     top = tk.Toplevel()
     f = tk.Frame(top)
     f.pack()
     label = tk.Label(f, text="{0} calculation started !".format(self.value))
     label.pack()
     btn = tk.Button(f, text="OK", command=top.destroy)
     btn.pack()
开发者ID:hackberie,项目名称:00_workSpace,代码行数:14,代码来源:enshu_vasp.py

示例4: relax

# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import execute [as 别名]
def relax(path, num, vaspcmd):
    """
    judgeの結果がTrueの場合終了
    それ以外はOSZICAR, OUTCARを保管してVASPを再実行
    """
    for i in range(0, num):
        judge = judge_oszicar(path)
        if judge:
            break
        else:
            shutil.copyfile('OUTCAR', "out.relax.{0}".format(i))
            shutil.copyfile('OSZICAR', "osz.relax.{0}".format(i))
            shutil.copyfile('CONTCAR', 'POSCAR')
            print("Start re-calculation.")
            Bash.execute(vaspcmd)
开发者ID:buriedwood,项目名称:00_workSpace,代码行数:17,代码来源:judgeRX.py

示例5: set_single

# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import execute [as 别名]
 def set_single(self):
     Bash.execute("vaspy prep_all")
     Bash.execute("sed -e 's/ISPIN = 2/ISPIN = 1/g' INCAR_static > INCAR")
     Bash.execute("sed -i 's/LCHARG = .FALSE./LCHAG = .TRUE./g' INCAR")
     shutil.copyfile('KPOINTS_relax', 'KPOINTS')
     shutil.copyfile('Calc/run_std.sh', 'run.sh')
     self.value = "single"
     self.label.configure(text=self.getText())
开发者ID:hackberie,项目名称:00_workSpace,代码行数:10,代码来源:enshu_vasp.py

示例6: set_EV

# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import execute [as 别名]
    def set_EV(self, vrange):
        # Bash.execute("rm -r voldep")
        Bash.execute("vaspy prep_all")
        Bash.execute("rm list_run")
        Bash.execute(
            "vasp_voldep.py range_percent --range_list {0[0]} {0[1]} {0[2]}".format(vrange))
        shutil.copyfile('Calc/run_voldep_enshu.sh', 'run_voldep.sh')
        self.value = "EV curve"
        self.label.configure(text=self.getText())

        top = tk.Toplevel()
        f = tk.Frame(top)
        f.pack()
        label = tk.Label(f, text="Series of calculations were prepared !")
        label.pack()
        btn = tk.Button(f, text="OK", command=top.destroy)
        btn.pack()
开发者ID:hackberie,项目名称:00_workSpace,代码行数:19,代码来源:enshu_vasp.py

示例7: plot_voldep

# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import execute [as 别名]
 def plot_voldep(self):
     # Bash.execute("calc_murnaghan.py get --fig")
     Bash.execute('calc_murnaghan.py get --fig --show --wo_mag')
开发者ID:hackberie,项目名称:00_workSpace,代码行数:5,代码来源:enshu_vasp.py

示例8: draw_band

# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import execute [as 别名]
 def draw_band(self):
     Bash.execute("vasp_plot.py band_nonmag --save")
开发者ID:hackberie,项目名称:00_workSpace,代码行数:4,代码来源:enshu_vasp.py

示例9: view_bz

# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import execute [as 别名]
 def view_bz(self):
     Bash.execute("vasp_kpoints.py view_bz")
开发者ID:hackberie,项目名称:00_workSpace,代码行数:4,代码来源:enshu_vasp.py

示例10: set_band

# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import execute [as 别名]
 def set_band(self):
     Bash.execute("vaspy prep_all")
     Bash.execute("sed -e 's/ISPIN = 2/ISPIN = 1/g' INCAR_dos > INCAR")
     self.value = "band"
     shutil.copyfile('Calc/run_band_enshu.sh', 'run.sh')
     self.label.configure(text=self.getText())
开发者ID:hackberie,项目名称:00_workSpace,代码行数:8,代码来源:enshu_vasp.py

示例11: edit_incar

# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import execute [as 别名]
 def edit_incar(self):
     Bash.execute("emacs INCAR")
开发者ID:hackberie,项目名称:00_workSpace,代码行数:4,代码来源:enshu_vasp.py

示例12: vesta

# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import execute [as 别名]
 def vesta(self):
     Bash.execute("VESTA POSCAR")
开发者ID:hackberie,项目名称:00_workSpace,代码行数:4,代码来源:enshu_vasp.py

示例13: edit_poscar

# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import execute [as 别名]
 def edit_poscar(self):
     Bash.execute("emacs POSCAR")
开发者ID:hackberie,项目名称:00_workSpace,代码行数:4,代码来源:enshu_vasp.py


注:本文中的commopy.Bash.execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。