Đọc Tkinter : Tkinter is the standard GUI library for Python. Python when combined with Tkinter provides a fast and easy way to
create GUI applications. Tkinter provides a powerful object-oriented interface to the Tk GUI toolkit. It’s very easy to get started with Tkinter, here are some sample codes to get your hands on Tkinter in python.
Python3
Bàn luận
Bài viết này tập trung vào việc tạo một chiếc đồng hồ bấm giờ bằng Tkinter trong Python & NBSP; Tkinter: Tkinter là thư viện GUI tiêu chuẩn cho Python. Python khi kết hợp với Tkinter cung cấp một cách nhanh chóng và dễ dàng để tạo các ứng dụng GUI. Tkinter cung cấp một giao diện hướng đối tượng mạnh mẽ cho bộ công cụ GUI TK. Nó rất dễ bắt đầu với Tkinter, đây là một số mã mẫu để có được Tkinter trong Python. & NBSP; & NBSP;
top.mainloop()
Output:
importtkinter
top =tkinter.Tk() A stopwatch is a handheld timepiece designed to measure the amount of time elapsed from a particular time when
it is activated to the time when the piece is deactivated. A large digital version of a stopwatch designed for viewing at a distance, as in a sports stadium, is called a stop clock. In manual timing, the clock is started and stopped by a person pressing a button. In fully automatic time, both starting and stopping are triggered automatically, by sensors. Required Modules: We are only going to use Tkinter for creating GUI and no other libraries will be used in this
program. Source Code:
Python3
Tạo đồng hồ bấm giờ bằng tkinter
Bây giờ chúng ta hãy cố gắng tạo một chương trình bằng mô -đun Tkinter để tạo đồng hồ bấm giờ. & NBSP; Đồng hồ bấm giờ là đồng hồ cầm tay được thiết kế để đo lượng thời gian trôi qua từ một thời điểm cụ thể khi nó được kích hoạt đến thời điểm mà mảnh bị hủy kích hoạt. Một phiên bản kỹ thuật số lớn của đồng hồ bấm giờ được thiết kế để xem từ xa, như trong một sân vận động thể thao, được gọi là đồng hồ dừng. Trong thời gian thủ công, đồng hồ được bắt đầu và dừng lại bởi một người nhấn nút. Trong thời gian hoàn toàn tự động, cả bắt đầu và dừng đều được kích hoạt tự động, bởi các cảm biến. & NBSP; Các mô -đun bắt buộc: Chúng tôi sẽ chỉ sử dụng tkinter để tạo GUI và không có thư viện nào khác được sử dụng trong chương trình này. Mã nguồn này: & nbsp; & nbsp;
importtkinter as Tkinter
fromdatetime importtkinter1
tkinter2=tkinter4
tkinter5=tkinter7
tkinter8 tkinter9
top 0tkinter8 top 2
top 3top 4 top 5
=6=7==9
top 6tkinter.Tk()1tkinter.Tk()2
top 6top 7 top 8
top 6top 4 top 8==tkinter4=5
=6=7=top.mainloop()6
top 6top.mainloop()8top.mainloop()9import0=import2
CácSubhajit Saha. If you like GeeksforGeeks and would like to contribute,
you can also write an article using write.geeksforgeeks.org or mail your article to . See your article appearing on the GeeksforGeeks main page and help other Geeks. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.