Source code for RiskQuantLib.Tool.GUITool
#!/usr/bin/python
#coding = utf-8
import easygui
#<import>
#</import>
[docs]def guiAlert(tipString:str):
"""
This function will alert some information.
"""
easygui.msgbox(msg=tipString, title="Alert Window", ok_button="OK")
[docs]def guiConfirm(tipString:str,doubtfulValueString:str):
"""
This function will ask confirmation of some information, if rejected, it will ask user to input a new one.
"""
choice = easygui.ynbox(msg=tipString, title="Data Confirm Window", choices=["Yes", "No"])
result = doubtfulValueString if choice else guiInput("Input the value you want:")
return result
[docs]def guiSelect(tipString:str,doubtfulValueList:list):
"""
This function will give some options to user to choose.
"""
choice = easygui.choicebox(tipString, title="Choice Select Window", choices=doubtfulValueList)
return "" if choice is None else choice
#<guiTool>
#</guiTool>