本文整理匯總了Python中ParmedTools.ParmedActions.netcharge方法的典型用法代碼示例。如果您正苦於以下問題:Python ParmedActions.netcharge方法的具體用法?Python ParmedActions.netcharge怎麽用?Python ParmedActions.netcharge使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ParmedTools.ParmedActions
的用法示例。
在下文中一共展示了ParmedActions.netcharge方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: netcharge
# 需要導入模塊: from ParmedTools import ParmedActions [as 別名]
# 或者: from ParmedTools.ParmedActions import netcharge [as 別名]
def netcharge(root, amber_prmtop, messages):
""" Calculates the net charge and shows its value """
mask = StringVar()
cmd_window = Toplevel(root)
mask_entry = _guiwidgets.MaskEntry(cmd_window, amber_prmtop,
'Mask from which to calculate charge', mask, cmd_window)
mask_entry.config(pady=10)
mask_entry.grid(row=0, column=0, sticky=N+E+S+W)
button = Button(cmd_window, text='OK / Quit', command=cmd_window.destroy)
button.grid(row=1, column=0, sticky=N+E+S+W)
cmd_window.wait_window()
if not mask.get(): return
action = ParmedActions.netcharge(amber_prmtop, ArgumentList(mask.get()))
chg = action.execute()
showinfo('Net Charge', 'The net charge of [%s] is %.4f' % (mask.get(), chg))