首页
学习
活动
专区
圈层
工具
发布

Python Script for Extracting ZPE from Gaussian Output

I'm excited to share a helpful tool I've developed: a Python script designed to extract zero point energy (ZPE) and free energy data from Gaussian output files.

With this script, you can easily access and utilize essential energy information from your Gaussian calculations.

Below, you'll find the script for your convenience:

import os

import sys

# Function to process the file

def process_file(filename):

  norm_term_counter = 0

      with open(filename, 'r+') as logfile:

          for line in logfile:

              if 'Sum of electronic and zero-point Energies' in line:

                  L1 = line.split()

                  print("Sum of electronic and zero-point Energies:" + L1[-1])

              if 'Sum of electronic and thermal Free Energies' in line:

                  L2 = line.split()

                  print("Sum of electronic and thermal Free Energies:" + L2[-1])

# Function to wait for user input

def wait_for_input():

  input("Press Enter to exit...")

# Main code

if __name__ == "__main__":

  # Ask user for file name

  filename = input("Enter the filename: ")

  # Process the file

  process_file(filename)

  # Wait for user input to exit

  wait_for_input()

  • 发表于:
  • 原文链接https://page.om.qq.com/page/OZYWxAHyXT9rRMppGwQigG_A0
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。
领券