网络编程
位置:首页>> 网络编程>> Python编程>> Python GUI编程 文本弹窗的实例

Python GUI编程 文本弹窗的实例

作者:傲娇的喵酱  发布时间:2022-08-24 02:07:48 

标签:Python,GUI,文本,弹窗

如下所示:


   out = subprocess.getstatusoutput('adb shell pm list packages')

top = tk.Toplevel()
   top.title('包名列表')

top.geometry('%dx%d' % (400, 1200)) # 设置窗口大小

t = Text(top, width=400, height=900)
   t.insert('1.0', "{}".format(out[1]))
   # 插入文本,用引号引起来“1.0” 这个是插入文本的坐标,且1与0之间为点,而不是逗号,切记

# wraplength: 指定多少单位后开始换行
   # justify: 指定多行的对齐方式
   # 例子: Label(top, text='查看当前手机上所有包名: ',wraplength = 80,justify = 'left').grid(row=1,stick=W, pady=10)
   t.pack()
   top.mainloop()

来源:https://blog.csdn.net/qq_39208536/article/details/83795562

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com