Let's code a STOPWATCH in Python! ⏱

  Рет қаралды 7,835

Bro Code

Bro Code

Күн бұрын

Пікірлер: 36
@BroCodez
@BroCodez 3 ай бұрын
# Python PyQt5 Stopwatch import sys from PyQt5.QtWidgets import (QApplication, QWidget, QLabel, QPushButton, QVBoxLayout, QHBoxLayout) from PyQt5.QtCore import QTimer, QTime, Qt class Stopwatch(QWidget): def __init__(self): super().__init__() self.time = QTime(0, 0, 0, 0) self.time_label = QLabel("00:00:00.00", self) self.start_button = QPushButton("Start", self) self.stop_button = QPushButton("Stop", self) self.reset_button = QPushButton("Reset", self) self.timer = QTimer(self) self.initUI() def initUI(self): self.setWindowTitle("Stopwatch") vbox = QVBoxLayout() vbox.addWidget(self.time_label) self.setLayout(vbox) self.time_label.setAlignment(Qt.AlignCenter) hbox = QHBoxLayout() hbox.addWidget(self.start_button) hbox.addWidget(self.stop_button) hbox.addWidget(self.reset_button) vbox.addLayout(hbox) self.setStyleSheet(""" QPushButton, QLabel{ padding: 20px; font-weight: bold; font-family: calibri; } QPushButton{ font-size: 50px; } QLabel{ font-size: 120px; background-color: hsl(200, 100%, 85%); border-radius: 20px; } """) self.start_button.clicked.connect(self.start) self.stop_button.clicked.connect(self.stop) self.reset_button.clicked.connect(self.reset) self.timer.timeout.connect(self.update_display) def start(self): self.timer.start(10) def stop(self): self.timer.stop() def reset(self): self.timer.stop() self.time = QTime(0, 0, 0, 0) self.time_label.setText(self.format_time(self.time)) def format_time(self, time): hours = time.hour() minutes = time.minute() seconds = time.second() milliseconds = time.msec() // 10 return f"{hours:02}:{minutes:02}:{seconds:02}.{milliseconds:02}" def update_display(self): self.time = self.time.addMSecs(10) self.time_label.setText(self.format_time(self.time)) if ___name___ == "__main__": app = QApplication(sys.argv) stopwatch = Stopwatch() stopwatch.show() sys.exit(app.exec_())
@itsme2012-p3f
@itsme2012-p3f 3 ай бұрын
Bro plz rust full course 🦀
@chhaylihour
@chhaylihour 3 ай бұрын
Dear @BroCodez I was your fan for 2 year. I want you teach Node JS and Express JS for Backend and Build API too, Thanks
@sav4942
@sav4942 3 ай бұрын
hey man your videos are great and have inspired me to work on a free course, but I have a question, why did you say no to the money? Is the point of the course for education? a better resume? I'm just contemplating between open source or monetized.
@madhuras1762
@madhuras1762 3 ай бұрын
Heyyy sir thank you for all your videos we all love the way u teach us and we will always support you!!
@goesbygambino6606
@goesbygambino6606 3 ай бұрын
Thank you for always teaching us how to code ❤ You are my goat forever you are the best thing to come to the internet 🎉
@Chariyaa533
@Chariyaa533 3 ай бұрын
I have suggestion sir...It will be very valuable If you can do a tutorial for MERN stack..plz consider about this suggestion.
@noir66146
@noir66146 12 күн бұрын
brilliant. there's a lot of pay-walls on these "free project idea" tutorials. this is way more helpful.
@MaxPersia-p1t
@MaxPersia-p1t 3 ай бұрын
look who's back again
@muhammadkausar2842
@muhammadkausar2842 3 ай бұрын
Sir i have see other full Course for Kotlin but your teaching style is awesome, please make a full course on Kotlin, thank you
@EmilioAt77
@EmilioAt77 2 ай бұрын
You rule, Bro!
@invincibleHunter
@invincibleHunter 3 ай бұрын
It would be amazing if you did a Machine Learning full course.
@jeffreyliwanag827
@jeffreyliwanag827 3 ай бұрын
hey Bro Thank you for all the videos, may we request Data Structures and Algorithms in Python? Thank you.
@gingadotech
@gingadotech 3 ай бұрын
good shit bro
@RajeshLohar-p2m
@RajeshLohar-p2m 3 ай бұрын
Bro which program did you use for coding
@Doanything69
@Doanything69 3 ай бұрын
Please do a NextJS workshop videos.
@HoonV9
@HoonV9 3 ай бұрын
Can you create for lua?
@tarindell187
@tarindell187 3 ай бұрын
Can you talk about qthreads there is very little info about it out there. Thanks for the vids
@sanjithrathinavelan4081
@sanjithrathinavelan4081 3 ай бұрын
Bro pls upload flutter tutorial
@rajushah8748
@rajushah8748 3 ай бұрын
love
@MehejabinLabiba8010
@MehejabinLabiba8010 3 ай бұрын
BroCode please continue the react js course please
@MohammadHammad-e4n
@MohammadHammad-e4n 3 ай бұрын
Hi, any content coming soon related to Java ?
@EbukaEzenwoye
@EbukaEzenwoye 2 ай бұрын
no sorry
@woodsjuggler7364
@woodsjuggler7364 3 ай бұрын
Bro pls explain about the panda dataframes in python too
@BishanTamang-hl3pn
@BishanTamang-hl3pn 3 ай бұрын
hello brother make a DSA with python it helps many people
@ayushmaansingh6884
@ayushmaansingh6884 3 ай бұрын
please teach spring boot java framework
@Timeless.3k
@Timeless.3k 3 ай бұрын
Bro I request create playlist for html,css, javascript projects
@faiza4769
@faiza4769 2 ай бұрын
Bro can you do pytorch tutorial
@ResearchDhamala
@ResearchDhamala 3 ай бұрын
bro please make a new video on react.
@DaDiDu_OS
@DaDiDu_OS 3 ай бұрын
first
@African_Blade
@African_Blade 3 ай бұрын
hey i want to make a trading ai bot that can to talk to me and can grow, can think of strategies etc and has a personality and also can connect to the internet. so far i haven't seen a KZbin video explaining how I can do that. please if possible can anyone tell me what I should search and understand. note i will be coding in python because I heard it's easier to learn.
@ashimsarkar662
@ashimsarkar662 3 ай бұрын
If you are new to python than first learn the basics and than sql or nosql language. AFTER that you can start learning machine learing and their libs and deep learing and computer vison mathematics later on. The easy way see a tutorial on chatgpt api and gain some python intermiadate skills to start building your ai with you can watch free code camp videos or programming witg mish and bro code
@DrunkSober-n2h
@DrunkSober-n2h 3 ай бұрын
Bro code how is ur comment 20h ago but video is 10 minutes ago😮
@vijayanandh3441
@vijayanandh3441 3 ай бұрын
The video maybe unlisted and made public again
@gregabits
@gregabits 3 ай бұрын
Aha! That might explain why many of us don’t get notifications. If he is delaying release on every video, that could explain it.
Let's code a WEATHER APP in Python! ☀️
54:28
Bro Code
Рет қаралды 13 М.
Functions in Python are easy 📞
10:38
Bro Code
Рет қаралды 549 М.
Players vs Pitch 🤯
00:26
LE FOOT EN VIDÉO
Рет қаралды 122 МЛН
小路飞还不知道他把路飞给擦没有了 #路飞#海贼王
00:32
路飞与唐舞桐
Рет қаралды 76 МЛН
PRANK😂 rate Mark’s kick 1-10 🤕
00:14
Diana Belitskay
Рет қаралды 8 МЛН
2 Python Developers VS $1000
15:04
PolyMars
Рет қаралды 1,8 МЛН
This Is Why Python Data Classes Are Awesome
22:19
ArjanCodes
Рет қаралды 813 М.
10 weird algorithms
9:06
Fireship
Рет қаралды 1,3 МЛН
Bro Code (Part 1) | Anwar Jibawi
4:32
Anwar Jibawi
Рет қаралды 22 МЛН
Running "Hello World!" in 10 FORBIDDEN Programming Languages
18:07
Let's code a beginner's Python SLOT MACHINE 🎰
20:11
Bro Code
Рет қаралды 27 М.
5 Useful Dunder Methods In Python
16:10
Indently
Рет қаралды 63 М.
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 324 М.
Coding Adventure: Rendering Text
1:10:54
Sebastian Lague
Рет қаралды 737 М.