首页 > 编程 > Python > 正文

Python GUI编程 文本弹窗的实例

2019-11-25 12:47:01
字体:
来源:转载
供稿:网友

如下所示:

    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()

以上这篇Python GUI编程 文本弹窗的实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持武林网。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表