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