Advanced Stopwatch in Python

preview_player
Показать описание
Today we learn how to build a simple but professional stopwatch in Python with a graphical user interface (GUI).

◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚

🌐 Social Media & Contact 🌐

Рекомендации по теме
Комментарии
Автор

Today we learn how to *NOT* build a stopwatch. 1. Widgets are not thread safe, directly updating them from an external thread is wrong and bound to fail sooner or later (starting with drawing artifacts and down to fatal program crash); the only proper way to communicate between a thread and the UI is by using QThread and custom signals; suggesting such approach is a *bad* suggestion. 2. Using a while loop like that is wrong, as it will make the CPU spike (check the system resources), so it should *at least* have a time.sleep at every iteration. 3. Considering the low time resolution of the label, such a heavy-working loop is pointless; just use QTimer with a 10ms interval and QElapsedTimer to get the elapsed time passed since it was started.

maurizioberti
Автор

how to make the result of lap continues go to below and we can scroll it, not continues to the right

azssdq
Автор

good work but for me the laps are running as minutes and seconds. Its not working properly.

codingworld-programmerslif