pyautogui的简单操作(2)-弹窗操作

import pyautogui as pg
b = pg.alert(text='hahh',title='test',button='ok')  #显示一个弹窗
print(b)#点击弹窗后返回button名

b1 = pg.confirm(text='testing',title='HAHHH',buttons=['ok','cancel'])#显示一个确认窗口
print(b1)#获取点击的值,如果'x'掉了窗口,则返回none
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200508143239192.png)


'''消息弹窗可以输入文字'''
b2 = pg.prompt(text='testing',title='HAHHH',default='')
print(b2)
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200508144030502.png)
b3 = pg.prompt(text='testing',title='HAHHH',default='dd')
print(b3)
![在这里插入图片描述](https://img-blog.csdnimg.cn/2020050814404787.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDUxNzg5MQ==,size_16,color_FFFFFF,t_70)

'''密码框'''
b4 = pg.password(text='testing',title='HAHHH',default='',mask='')#可以输入密码的密码框,密码框明文显示
b5 = pg.password(text='testing',title='HAHHH',default='',mask='*')#可以输入密码的密码框,密码框*显示
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200508144623773.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDUxNzg5MQ==,size_16,color_FFFFFF,t_70)

你可能感兴趣的:(pyautogui,python)