Introduction to GUIs in Python with PyQt5

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024

Комментарии • 84

  • @forcerous_5127
    @forcerous_5127 3 года назад +92

    HOW TF IS THIS DUDE NOT KNOWN? THIS DUDE HAS AMAZING TRANSITION ANIMATIONS LIKE WTF???? DUDE. THIS TUTORIAL IS AMAZING. AND VERY VERY CLEAR.

    • @karthigeyanj7508
      @karthigeyanj7508 3 года назад +2

      bruh
      its clear cause its clear code

    • @hampten23
      @hampten23 2 года назад

      Why are the letters so small. I can't read

    • @lewyathan
      @lewyathan 2 года назад

      A FREAKING LEGENDDD

  • @KushG420
    @KushG420 3 года назад +27

    Finally after a long time, came across one of those --Criminally underrated channels

  • @Milano606
    @Milano606 3 года назад +6

    Awesome tutorial. Really clear. Not too basic. Explains the necessary concepts like an expert. It was just what I was looking for to get a better grasp on this framework, thanks.

  • @thingsiplay
    @thingsiplay 4 года назад +3

    I just watched Alan's tutorials and now yours are the next. It makes so perfect sense that you take his approach of abbreviating and reference to him. The world makes so much sense now, everything is connected!!!
    Seriously, this is a very good tutorial and probably a bit easier to understand.

  • @aimenbarigoudz
    @aimenbarigoudz 3 года назад +2

    Your tutorials are so good, best ive found, so clear and just fast enough for beginners and amateurs and you actually explain how everything works in detail

  • @alessandrocasol9499
    @alessandrocasol9499 3 года назад +9

    Disliked the misleading thumbnail but you're a good teacher and is always great to have someone who share's knowledge for free. Just use a thumbnail with the project you're teaching please

  • @mileswhitehead684
    @mileswhitehead684 2 месяца назад

    I really recommend you guys try and figure out how to fix all of the bugs! It really tested my problem solving skills. The main ones are
    1. Enter crashes the program
    2. Divide by zero crashes the program
    3. Inputting multiple "*" or "/" without a number in front or pressing enter with "*" or "/" at the start or end crashes the program
    Remember to implement your solutions while still allowing the minus sign to be put before all numbers!

  • @stefanb.2575
    @stefanb.2575 3 года назад +1

    Came to this video because i finally found someone with a good design for their app. Watched 10secs „and this is what we are going to build“ 😭 (tutorial might still be good for the programming part)

  • @sauceontoes3457
    @sauceontoes3457 3 года назад +3

    i sacrificed my eyes for this
    jokes aside, this tutorial is very good how tf is this underrated

  • @fashizlecartman
    @fashizlecartman 3 года назад

    Thank you sir, you saved me 4 hours of stack overflow today. With love from America. Amazing videos. Subscribed.

  • @hfe1833
    @hfe1833 2 года назад

    This video rate should be more than Google play 5 star

  • @ankitcaring
    @ankitcaring Год назад

    Thanks for making such a concise video.
    Starting from what's the prerequisite and explaining with animation.
    Exactly the thing I need to hear.👍👍
    p.s:- been done some editing , I know this kind of tutorial required alot of effort to create then directly just coding on a computer screen.

  • @FernandoOrtega10
    @FernandoOrtega10 3 года назад +5

    Awesome tutorial!! I'm actually curious, what do you use for the presentation itself? your graphics make the explanations very clear, and your IDE looks nice and clean (I think it's a customized Sumblime, isn't it?) kudos for the effort in making this very presentable!

  • @marcus.the.younger
    @marcus.the.younger 3 года назад +1

    Wonderful explaination
    You sir have earned a subscriber

  • @zenxs3
    @zenxs3 3 года назад

    You have potential to get 1 million subs KEEP GOING FORWARD!!!!!!!!!!!!

  • @ememmeme8722
    @ememmeme8722 4 года назад +9

    how can i double like this video?

  • @adrianrdzaldrete7731
    @adrianrdzaldrete7731 4 года назад +9

    19:56 Nice.

  • @prasoonjha1816
    @prasoonjha1816 3 года назад +2

    Please make a video on how can we integrate PyQt5 into Pygame to make our game more interactive (if it is possible).

  • @notsobob
    @notsobob 4 года назад +1

    really good clear description, and slick visuals! thanks

  • @cinquecento1985
    @cinquecento1985 2 года назад

    thank you. finally its a little more clear.

  • @lens3973
    @lens3973 3 года назад +1

    You should make the entire code available to look over in a pastebin or something. Sucks to have to skim through the video just to find one line.

  • @nawaytes24
    @nawaytes24 3 года назад +1

    I have finished the layout, but can't call the 'clicked' function

  • @SHONNER
    @SHONNER 4 года назад +2

    I've only used Qt Designer to do Python GUIs.

  • @tuanphamcong3583
    @tuanphamcong3583 3 года назад

    Can you help me Sir? Instead of creating a QPushButton from QtWidgets class, I want to create QLabel object to store image, and container=QtWidgets.QLabel(). The addWidget stuff stays the same in the video. Can it run?

  • @pablobarbozacanal
    @pablobarbozacanal 3 года назад

    Thankyou bro! but a have this problem in my code, see:
    btn8 = qtw.QPushButton('8', clicked = lambda: self.num_press('8'))
    AttributeError: 'MainWindows' object has no attribute 'num_press'
    Can you help-me?

  • @NeilLTayler
    @NeilLTayler 3 года назад

    This was very well made, thank you for this.

  • @NewBlueType
    @NewBlueType 2 года назад

    Great tutorial by the way, thanks!

  • @CraigHollabaugh
    @CraigHollabaugh 3 года назад

    Hey thanks, just what I needed to get started.

  • @qqlez
    @qqlez 2 года назад +1

    # I got buttons 0-9 done in 4 cheeky lines:
    for x in range(9):
    y = 2 if x == 0 else y+1 if x % 3 == 0 else y
    container.layout().addWidget(qtw.QPushButton(str(9-x)), y, x-(y-2)*3, 1, 1)
    container.layout().addWidget(qtw.QPushButton('0'), 6, 0, 1, 4)

  • @dogesh828
    @dogesh828 4 года назад +1

    Can anyone explain me why there is error if i use this
    ---- btn_9 = qtw.QPushButton('9', clicked=self.num_press('9')) ----
    instead of this
    ---- btn_9 = qtw.QPushButton('9', clicked=lambda: self.num_press('9')) ----

    • @kvrule
      @kvrule 3 года назад +1

      clicked expects a function to be passed in. When you pass self.num_press('9') your actually calling that function and therefore passing the result of that function which is not of type function, which is why it doesn't work. The lambda expression on the other hand, returns a function which in this case happens to be a function that does the same thing as self.num_press('9'). This means the lambda expression is passing the correct type, which is why it works.

  • @МаксимБашарин-о9щ
    @МаксимБашарин-о9щ 4 года назад +1

    Hey, please help me!: terminal AttributeError: module 'PyQt5.QtWidgets' has no attribute 'QtWidgets'

    • @ClearCode
      @ClearCode  4 года назад

      Hey, how are you importing the PyQt5 modules?

    • @cesandr
      @cesandr 4 года назад

      Hey had the same problem and fixed it by initializing the MainWindow class not with QtWidgets but with QWidget

    • @KanikaRaheja
      @KanikaRaheja 3 года назад

      getting the same error .please help!

    • @RohanKumar-zd3pc
      @RohanKumar-zd3pc 3 года назад +1

      @@KanikaRaheja Well well well, Install pyqt5 first

  • @nirajchowdhary7372
    @nirajchowdhary7372 3 года назад

    You further made the video interesting by choosing numbers as '4', '2', '0' :p

  • @drewdrew1468
    @drewdrew1468 2 года назад

    I kept getting syntax errors when I tried to type "Lambda" instead I had to use lowercase "lambda" to get it to work.

  • @dub27step
    @dub27step 3 года назад

    You're a legend sir!

  • @NewBlueType
    @NewBlueType 2 года назад

    Couldn't you create a function that returns a list of the buttons 0-9 instead of manually writing each one?
    for i in range(10):
    btn_list[i].append(qtw.QtPushButton(string(i))

    • @qqlez
      @qqlez 2 года назад

      did u get this to work?

  • @joeyhodge2404
    @joeyhodge2404 4 года назад

    I’m having trouble with lambdas. They generate syntax errors when used as they are here. I’m on python 3.8.3. I use ‘partial’ instead on tkinter but that doesn’t seem to work with pyqt5. I’m stuck without a workaround.

    • @ClearCode
      @ClearCode  4 года назад

      you can just use regular functions. Just make sure that when you connect it to the button you don't call the function (so clicked = button_function instead of clicked = button_function() ). Quite sure that tkinter doesn't need lambdas either, it just happens to be much more concise than writing a dedicated function for every single button.

  • @sashakopiika
    @sashakopiika 4 года назад +2

    I can't find the book that you've recommended in this video. Could you send me a link to this book or explain how to find it. Btw why didn't you use qtdesigner? PS actually I find this video really helpful and appreciate that you've done

    • @ClearCode
      @ClearCode  4 года назад +2

      Hey, glad you liked the video and here is the book: www.packtpub.com/gb/application-development/mastering-gui-programming-python It isn't exactly cheap but you can't find lots of free copies online, but you didn't hear that from me! :)
      And I didn't use qtdesigner because the layout was pretty straightforward anyway and the video was already getting really long.

  • @kwizerafrank4978
    @kwizerafrank4978 2 года назад

    Thanks man

  • @luismiguelnevesgoncalves3702
    @luismiguelnevesgoncalves3702 4 года назад +2

    Hi! I'm wondering what software are you using. I've tried Python 3 (Idle) but it doesn't look as beautiful as yours. Cheers and keep up the good work!

    • @ClearCode
      @ClearCode  4 года назад +1

      Hey, I am using the sublime code editor and hide all the ui elements (which is quite easy to do) and use a bright theme, I believe for this video the theme was called ayu.

    • @alekjanowski9847
      @alekjanowski9847 3 года назад

      @@ClearCode Hello sorry for bothering you but I have a problem with the Lambdas (I'm using pycharm and wanted to know if you downloaded something extra?)

  • @navpreetpawar6877
    @navpreetpawar6877 3 года назад

    Explained very nicely! Thanks a lot.
    Question - wouldn't using the qtDesigner be better, instead of typing? I have used qt with C++ only, and curious to know, why almost all python projects( that I have come across) don't use a qt ui file.

  • @SP-is5pz
    @SP-is5pz 2 года назад

    the calculator just crashes after entering a number or clicking any of the buttons but you can probably figure out how to fix it ur self

  • @monikaguttler3452
    @monikaguttler3452 3 года назад

    Super Tutorial, danke!

  • @BenjaminDelespierre
    @BenjaminDelespierre 3 года назад

    Very good video. If you’re going to use eval why not simply concatenate all pressed button labels in the evaluated string directly?

  • @matheus-felipe-dev
    @matheus-felipe-dev 4 года назад

    Esse é o video mais perfeito que ja vi

  • @gurnkerk3826
    @gurnkerk3826 3 года назад

    Nice video! One question tho… Are u german cuz I think I heard it out but I am not sure and in school I struggle the most with listening tasks so would be nice if you could answer me!

  • @ssa5852
    @ssa5852 3 года назад

    Thank you for this video. What theme you using in this video?

  • @MianAffanAli
    @MianAffanAli 4 года назад

    which code editor you are using in this video?

    • @ClearCode
      @ClearCode  4 года назад

      hey, it is the sublime code editor

  • @srikar8718
    @srikar8718 3 года назад

    hello bro how to do this through pyqt creator

  • @matthiasdunkel9782
    @matthiasdunkel9782 3 года назад

    Will there be another part?

  • @airocety4391
    @airocety4391 4 года назад

    Is it better than Tkinter, which one is more powerful?

    • @ClearCode
      @ClearCode  4 года назад

      Hey, I personally never used tkinter much, so I'm afraid my opinion wouldn't be all that relevant. Both basically just give you access to different gui elements, and you can make complex apps in both. But from what I heard, which is not a great metric, pyqt is more convenient to use and easier to maintain for larger projects.

    • @airocety4391
      @airocety4391 4 года назад

      @@ClearCode Thank you

    • @marcus.the.younger
      @marcus.the.younger 3 года назад

      @@airocety4391
      I am here after learning Tkinter...
      With tkinter's ttk , you can create a gui as beautiful as PyQt5
      The choice is yours

  • @amanapatel2366
    @amanapatel2366 2 года назад

    You should add source code for better understanding

  • @SorenDeveloppement
    @SorenDeveloppement 2 года назад

    What iss your IDE

  • @peterbreis5407
    @peterbreis5407 3 года назад

    Thank you very much. You are very clear and organised and the information is very useful.
    Just one thing. I know English is your second language but you speak it very well, however your presentation is full of distracting typos, which meant I was not fully focusing on the lessons.

    • @jwnigel
      @jwnigel 2 года назад

      I didn't notice any... Do you mean the object and function names?

  • @djdan8777
    @djdan8777 3 года назад

    Give me more stuff like this! :D

    • @ClearCode
      @ClearCode  3 года назад +1

      I am actually planning on making more pyqt tutorials, any specific topic you'd be interested in?

    • @djdan8777
      @djdan8777 3 года назад +1

      ​@@ClearCode Touch events would be great (sliding, rotating, zooming etc) :D Beside that maybe you've tried to combine it with Panda3D or to make some stuff with Qt3D? (and make it working with touch events - I'm trying to make TIN mesh viewer). And generally creating some more complex apps. After that deploying app on the PC and Android would be the icing on the cake :D There is no one on the Internet who make tutorials so clear and in such style as you! So I think that people will love it! :D
      Of course I will also very appriciate some basics from PyQt5/PySide2, but those things above would make you Qt+Python star on the RUclips :D

  • @AlexJaeger716
    @AlexJaeger716 3 года назад

    too many ads. can't skip around without running into an ad

  • @julianandresgomezgomez7264
    @julianandresgomezgomez7264 3 года назад +1

    DISLIKE! THE RESULT IS VERY DIFFERENT FROM THE VIDEO PICTURE

  • @nictanghe98
    @nictanghe98 3 года назад

    THe thumbnail wqs verry deceiving.

    • @nictanghe98
      @nictanghe98 3 года назад

      How to make it look good ?

    • @FernandoOrtega10
      @FernandoOrtega10 3 года назад

      It was! he probably just applied a stylesheet afterwards, you can customized the app colours that way.

  • @gavingotback
    @gavingotback 4 года назад +1

    tkinter is so much easier tho :,(

  • @mattshu
    @mattshu 3 года назад

    What an awkward number pad format...