一、代碼
import pymsgbox
pymsgbox.alert(text='', title='', button='OK')
pymsgbox.confirm(text='', title='', buttons=['OK', 'Cancel'])
pymsgbox.prompt(text='', title='' , default='')
pymsgbox.password(text='', title='', default='', mask='*')
# 彈窗確認框
pymsgbox.alert('This is an alert.', 'Alert!')
# 選擇確認框
pymsgbox.confirm('你是否要查看以下內容?', '查看確認', ["確定", '取消'])
# 密碼輸入框,mask指定密碼代替符號
res=pymsgbox.password('Enter your password.',mask='$')
print(res)
# 默認輸入框
pymsgbox.prompt('What does the fox say?', default='This reference dates this example.')
# 選擇確認框,設置時間后自動消失
pymsgbox.confirm('你是否要查看以下內容?', '查看確認', ["確定", '取消'], timeout=2000)