อยากให้ไฟล์แสดงบนหน้าจอของ Tkinter ค่ะ
Moderator: mindphp, ผู้ดูแลกระดาน
-
- PHP Newbie
- โพสต์: 5
- ลงทะเบียนเมื่อ: 16/09/2019 4:55 am
อยากให้ไฟล์แสดงบนหน้าจอของ Tkinter ค่ะ
มีโค้ดที่ทำให้ไฟล์ .txt แสดงบนหน้าจอ tkinter ได้ไหมคะ
- mindphp
- ผู้ดูแลระบบ MindPHP
- โพสต์: 41131
- ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
- ติดต่อ:
Re: อยากให้ไฟล์แสดงบนหน้าจอของ Tkinter ค่ะ
พอมีตัวอย่างที่ต้องการไหมครับ
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
-
- PHP Newbie
- โพสต์: 5
- ลงทะเบียนเมื่อ: 16/09/2019 4:55 am
Re: อยากให้ไฟล์แสดงบนหน้าจอของ Tkinter ค่ะ
ข้อมูลที่บันทึกลงในไฟล์เป็นข้อมูลสินค้าค่ะ อยากให้เวลาคลิกปุ่ม OK แล้วแสดงข้อมูลออกมาค่ะmindphp เขียน:พอมีตัวอย่างที่ต้องการไหมครับ
- mindphp
- ผู้ดูแลระบบ MindPHP
- โพสต์: 41131
- ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
- ติดต่อ:
Re: อยากให้ไฟล์แสดงบนหน้าจอของ Tkinter ค่ะ
อ่านค่า text จากไฟล์ มาให้ตัวแปลไว้ แล้ว สั่งให้แสดงเหมือน ข้อความที่เป็น default
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
- mindphp
- ผู้ดูแลระบบ MindPHP
- โพสต์: 41131
- ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
- ติดต่อ:
Re: อยากให้ไฟล์แสดงบนหน้าจอของ Tkinter ค่ะ
โค้ด: เลือกทั้งหมด
try:
from tkinter import * # Python 3.x
except Import Error:
from Tkinter import * # Python 2.x
str = open('text_for_read.txt', 'r').read()
root = Tk()
e = Entry(root)
e.insert(END, str)
e.pack()
root.mainloop()
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
-
- Similar Topics
- ตอบกลับ
- แสดง
- โพสต์ล่าสุด
-
-
โพสต์ใหม่ การใช้งาน Python GUI (Tkinter) : Tkinter hide widgets (การซ่อน วิตเจ็ต)
โดย Jom07 » 20/03/2018 6:19 pm » ใน Python Knowledge - 2 ตอบกลับ
- 17132 แสดง
-
โพสต์ล่าสุด โดย ubuseo
21/03/2018 10:33 am
-
-
-
โพสต์ใหม่ การใช้งาน Python GUI (Tkinter) : Tkinter widget (Cursors)การแสดงผลตัวชี้เมาส์บน
โดย ธวัชชัย แสนหาญ » 13/02/2019 6:48 pm » ใน Python Knowledge - 0 ตอบกลับ
- 3321 แสดง
-
โพสต์ล่าสุด โดย ธวัชชัย แสนหาญ
13/02/2019 6:48 pm
-
-
-
โพสต์ใหม่ การใช้งาน Python GUI (Tkinter) : Tkinter widget (Anchors)การควบคุมตําแหน่ง
โดย ธวัชชัย แสนหาญ » 12/02/2019 4:57 pm » ใน Python Knowledge - 0 ตอบกลับ
- 4824 แสดง
-
โพสต์ล่าสุด โดย ธวัชชัย แสนหาญ
12/02/2019 4:57 pm
-
-
-
โพสต์ใหม่ การใช้งาน Python GUI (Tkinter) : Tkinter Relief styles (การสร้างมิติกรอบเครื่องมือ)
โดย Jom07 » 26/03/2018 6:34 pm » ใน Python Knowledge - 0 ตอบกลับ
- 3720 แสดง
-
โพสต์ล่าสุด โดย Jom07
26/03/2018 6:34 pm
-
-
-
โพสต์ใหม่ การใช้งาน Python GUI (Tkinter) : Tkinter widget (การแจ้งเตือนด้วย messagebox)
โดย ธวัชชัย แสนหาญ » 14/02/2019 6:40 pm » ใน Python Knowledge - 0 ตอบกลับ
- 4377 แสดง
-
โพสต์ล่าสุด โดย ธวัชชัย แสนหาญ
14/02/2019 6:40 pm
-
-
-
โพสต์ใหม่ การใช้งาน Python GUI (Tkinter) : Tkinter PanedWindow (วิดเจ็ตผู้จัดการรูปทรงเรขาคณิต)
โดย Jom07 » 14/03/2018 5:08 pm » ใน Python Knowledge - 0 ตอบกลับ
- 1544 แสดง
-
โพสต์ล่าสุด โดย Jom07
14/03/2018 5:08 pm
-
-
-
โพสต์ใหม่ การใช้งาน Python GUI (Tkinter) : Tkinter Frame (วิตเจ็ตเฟรม)
โดย Jom07 » 09/03/2018 5:07 pm » ใน Python Knowledge - 0 ตอบกลับ
- 4119 แสดง
-
โพสต์ล่าสุด โดย Jom07
09/03/2018 5:07 pm
-
-
-
โพสต์ใหม่ การใช้งาน Python GUI (Tkinter) : Tkinter Binds (การผูกฟังก์ชัน)
โดย Jom07 » 15/03/2018 5:56 pm » ใน Python Knowledge - 0 ตอบกลับ
- 2417 แสดง
-
โพสต์ล่าสุด โดย Jom07
15/03/2018 5:56 pm
-
ผู้ใช้งานขณะนี้
สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 35