Thanks for recognizing this! I generally get a lot of good feedback about they speed I do these in but there are always a few that don't understand what a pause button is. I'm glad you like the approach.
I was reacting to the pace, it is way to fast and mechanical to be effective IMHO. The topic is interesting I am now glad to know of it. It is about time for a tool like this. Packing methods suck, and require too much effort to layout a GUI. NI LabWindows CVI and other tools have had this type tool for ~20 years or more. So good topic.
Definitely agree with this. Others also use lots of fruity language and dull examples on there own projects. I really just want the meat and potatoes. PyTutorials give us exactly that.
The last few days I have been thinking, why someone hasn’t written something that will create widgets easily. This is great stuff. Thanks for sharing your knowledge.
I know others have mentioned it already, but thank you for the speed of the video. You should make a new channel and make tutorials on how to make tutorials.
Haha, tutorials on how to make tutorials; I love the idea. If I am going to make more content though, it will probably be for this channel. If I do get more time though, I could potentially take up the idea thanks 👍
Efficiency is what I often find lacking in those who produce tutorials. They do not seem to realize that time is valuable when one tries to find information, and that making an extensive video for the reasons they evaluate is inconsiderate. This meets the qualities that should have those: Speed and clarity in the explanation without personalization ornaments, So thanks! for efficiency and your consideration to shorten the duration time. And also thank you because now I leave Glade and I lean towards PyQt, if I recently started 1 week with python and 3 days informing about GUI implementation
This is really good for experienced Python programmers in terms of speed and content it covers. Some people would record a video and just keep talking tons of bullshit then start to code character by character to move forward. Yours are much better!
I love your fast method of teaching. Subbed and ready to learn. You can say I'm very entry level, like honestly just started a few months ago and nowhere can I find and one that can explain something so clear and in good time as you. Well done I will be following you from now on.
What a phenomenal tutorial. It is concise yet packed with useful data presented in a clear way. Same applies to the rest of your tutorials, thank you !
Brilliant, this is how you make a clear, concise video to save everybody's time, retain the viewer for the entire length of the video and make the viewer ask for more !
I'm glad you enjoyed the length of the video! I try my best to keep these engaging while knowing the pause button is always available so it is always good getting feedback on this idea in my videos.
Neat trick for Windows users: open a CMD window in the current Explorer location just by typing ‘cmd’ (without the quotes) in the URI field (the field that shows your file path) and hitting Enter
Class, really appreciate this man, was getting fed up of Tkinter and the other videos covering the PyQt5 designer are not as precise, none mentioned that the package could be installed via pip. Huge time saver watching this video, thanks.
Great video. I'm new to this stuff, writing programs with a GUI in general, but if i got this right then Qt Creator is simply to set up the layout, button etc. for your interface, then when you're happy with that you convert it to Python code and you start implementing what is going to happen when the different buttons are pressed and so on.
That's how I typically use this tool - just to get an initial layout. You can however, import the built .py file so you don't overwrite your changes (most Python developers would have guessed this). I made a tutorial on "How to Import a PyQt5 .ui File in a Python GUI" at nitratine.net/blog/post/how-to-import-a-pyqt5-ui-file-in-a-python-gui/ if you are curious.
This is a great video, it easy to understand, with detailed step by step instructions - where the audio in sync with the video. The best Part is it works! I am really grateful. Thank you !!
Clear and to-the-point. The only thing that puzzles me is the that this way of developing, translating from source to source and basically hacking new code in it, is considered a good idea. I will adapt but it does not feel very advanced.
thank you so much , because of this video , i even integrated Qt and python in visual studio code editor , which made things a lot easier , and i learned a lot, and hoping for more similar tutorials, such as of the different forms and apps that can be made via this process.
That's awesome! If you are going to make apps with android, I believe there are a few tutorials using Kivy but I have seen a tool before that can package PtQt5 to apks.
You're a mind readermI'm searching for this on google and found Sendex's video series on youtube, When I about to start watching that video,I get this notification,came here to watch this first!.
Very useful video for getting started! For those running from a custom environment (such as I did with Anaconda), your "pyuic5.exe" file will be located in the " Anaconda3\envs\pyqt5\Scripts " directory. Also, you "designer.exe" file may be located elsewhere, as well, when you are getting started and need to create that shortcut. QUESTION: How do we merely UPDATE the .py fil if we need to modify the QT widgets, labels, etc., when we convert from .ui to .py? As it is, you lose all your custom functional and setupUI classes every time you have to modify the .ui file!
Thanks for that help, I don't use Anaconda so it is good to have them lying around here. For your question, there are two methods. One is 'importing' the .ui file; in the PyQt5 documentation (look for uic.loadUi), you can import the .ui file and then build upon it. The reason I don't use this method is because you need to call findChild which can be a bit more confusing than the methods shown here - this can also break easily if you change the names in the .ui file. The other option is to keep re-converting to .py and import this .py file in another python script. This other Python script will be your main script which inherits the interface from the converted .py file and then builds upon it. This way you can still use the methods in this video.
Very useful tutorial. Just a note, when adding many items like in the second example do it slower because those are all new concepts and I couldn't find the buttons so I had to slow down the video.
I'm sorry you found the video a bit too fast. When I was making it, the target was to get people to pause and watch themselves do it instead of following a video action-by-action.
Great Tutorial , you can add the path of your python Scrips folder to your environment variables so you can access pyuic5 from anywhere and from any folder without changing your directory to the scrips folder. Thanks in advance : -)
I used to teach this way but people couldn't understand to use their own path. You are 100% correct though, it makes it a LOT easier. Also the directory should be on the PATH if they selected it in the instillation.
It appears that the pyqt5_tools package has been updated recently and the location of pyuic5.exe and designer.exe executables could potentially be in a new location. If you cannot find these executables, try looking in pyqt5_tools\Qt\bin (thanks to Torsten W and Roberto Rivera for making me aware of this). Alternatively, I see that the binaries can also be found in the "Scripts" folder in the root directory of your Python installation (are installing the packages of course). Sorry for this confusion, I do not have control over the package so anything can change at any time.
Hi Py, great video, but I need your help. I tried looking for the executables in pyqt5_tools and everything, but I wasn't able to find them. Should I install a specific version of Python and PyQt5, this is a very urgent matter, please help!!!!
Great video. Loved it! I would really like to see a video from you showing how to create window with multiple views.. Like if you press a button., new buttons and labels show up with a button that can take you back to the original view. If anyone reading this knows how, please share.
I have done this before in a project and have an example at github.com/brentvollebregt/multi-clipboard/blob/master/multi_clipboard/ui.py#L203 . You can see that I have another class that inherits QtWidgets.QWidget on line 260 - this could be outside the class I have it in, I just put it in there for ease. You can then see after creating an instance of it, I call .show(). Although this might not be too helpful as it doesn't show the basics. This example, however, is to show a new window. You would be better off to use the same window by removing all the contents and re-populating with the contents you now want.
Thanks man! And yes, I try to write posts for each of my videos now so if you are unsure about any of the video, check out the site first (I can update a website but not a published video); thank you for noticing!
Thank you! The GUI maker I believe would be written in C++ since that's what Qt is written in; they have just added a python interface to the code to make it accessible.
A tip for converting *.ui to *.py with pyuic5 : When you are in the folder of your .ui, open a shell then write the following command in it: pyuic5 *.ui > *.py where *.ui is your GUI and *.py will be your GUI in python code. This is easier than typing the whole path everytime !
The reason I type the whole path out in this video is for people that don't understand what relative paths are. I get a lot of people complaining that something is broken or I did something wrong when really they are not in the correct directory; using absolute paths helps mitigate this.
Instead of using full-paths for the individual files you're trying to modify from the CLI, I think it seems easier to instead stay in the directory of the files you're wanting to mess with, then call the pyuic5 executable using ITS full path. Less copy/paste that way, since you're only using one thing that must be a full path. Incidentally, on my Anaconda install (with python-3.6 on windows), I don't have a pyuic5.exe but a pyuic5.bat. It worked fine.
I wish I could use relative paths in these videos but too many people get confused with relative paths and the command prompt in general thus forcing me to use absolute paths. The whole situation annoys me too.
If you see how the design orientation in Microsoft visual Basic 6.0 was wasou know what user friendly means!!?? but I mean PYTHON does not give you that simplicity in G.U.I. !@@PyTutorials
I agree, Visual Studio makes it a lot easier to design GUI's but Python and .NET/C# are very different. Python is not developed like C# is, C# has a lot more resources behind it's development.
Ooooh, good question. I feel using Qt Designer is a good starting point as it keeps people feeling like they are getting somewhere; however Qt Designer should not be fully relied upon as the real skill is constructing a GUI dynamically programmatically. PyQt5 has a lot of resources online but in some cases I feel that tKinter tutorials may be easier to follow some times. This is a bit of a tough one as I haven't really used tKinter that much as I saw limitations/difficulties from the beginning. I believe I would recommend PyQt5, it may take a bit more effort to learn but it is definitely worth it. Just please don't always rely on the Qt Designer to create your GUI as sometimes creating the GUI manually can be an easier method. Use Qt Designer more as a tool to see how things are constructed.
For those who can't find Qt designer, mine is inside path Python38-32\Lib\site-packages\pyqt5_tools\Qt\bin Else, open cmd, type in 'designer' then it will directly open the app for you
In the description I noted designer.exe has now been moved to pyqt5_tools\Qt\bin but can also be found in the \Scripts\ folder in the root of your Python installation
Great video and great channel my friend! Your website is also really cool. Btw, sorry if this is a newbie question, but can we link a function instead of a method to a button with PyQt5 ? Thanks!
I already figured it out! I meant a function defined outside a class. But obviously I can write inside it. I really appreciate your work man, keep it up!
Nice tutorial! However, I prefer not to implement widget behavior inside the auto-generated PyQt5 Python file, as changes would be lost if you wanted to modify the GUI with Qt Designer. Who knows if you wanted to resume the project after months of laying it aside and you can't remember exactly what to do?
I use the designer as more of a place to get a starting shell. You are actually allowed to modify the code that is generated to add different widgets or even change existing ones. This simply creates a good starting place for people new to PyQt5.
Hi, I have a problem. I have a class Event and one is Main script. In Event class, i have on_login method and compared id and password and return the status as per the validation. Now, in main script, login_form.btn_login.clicked.connect(login). Now, while clicking i want to have the status. But, not getting. Please help.
@@PyTutorials pastebin.com/JDyqqrrY This is event script. Here i have on_login method and returning self.status. pastebin.com/HMZKUEi3 This is the main script. on line 13, i have create event on button click and called on_login. Now, here i am struggling that, how i will get that return value in main script.
Best method would be to create a definition in HMZKUEi3 which calls on_login from JDyqqrrY and then saves the value somewhere in HMZKUEi3. After this, connect login_form.btn_login to the new definition. This means when the button is clicked, it calls this new function which then calls the one you are trying to get the result from. Using this new function, you can then store the returen value. Remember, you cannot get the return of a trigger even created by the .connect definition/function, you need to create a kind of middle-man function as I have described.
great video! thanks for being concise. please do one going into the further functionalities of pyqt5 if you don't mind. I also have a question: if you need to convert the UI file to PY in order to modify the code and set up functionalities, can you no longer open the file in designer to make further modifications to the UI? Appreciate your help
You can only make modifications to the .ui file using the designer, not the Python script. One method to get around this is to import the .ui file in Python and then make changes in the Python script. This allows you still to make changes to the .ui file and keep your changes. I wrote a post at nitratine.net/blog/post/how-to-import-a-pyqt5-ui-file-in-a-python-gui/ explaining this.
@@PyTutorials but the .ui and .py files are not linked surely? Once I've exported the .ui File to .py and hooked up all the buttons, but then decide that I want to change the layout of the buttons, I would have to go back into the designer, make changes to the .ui File, export it to the .py file, then copy over the hookups to the buttons from the other file, is that not so?
No, the .ui and .py files are not linked, I thought you were trying to edit the .py in designer sorry. You are correct, if you make changes to the .ui file and turn it into a .py again, copy over your changes and it will be fine.
Excellent video, Thank you. I am wondering what would be your typical workflow for working with QT Designer and python. I suspect that each time you modify your UI and generate PY file again, it override the previous python file where you had made all your event handling modifications. Is there a smart way to be able to modify the UI without loosing all your changes in python ?
There are a couple of ways but they are both practically the same; however I do not use them as I only use the designer for an initial skeleton and then modify the GUI programmatically from there on in. The idea is to give names like I do in this video (5:37) for referencing elements so you can find them later. Then you want to import the .py file created by pyuic5 (it can be regenerated, you don't need to edit this file) and instantiate the GUI; from here you should have a pointer to the GUI object which you can use to call each element. The other way is to import the .ui file and use the references like before. Once again, I do not use this method so cannot provide examples sorry. I know these aren't great explanations but I do not use the method currently.
Adding the item to the right click file context menu is done by the Python installer - doing it manually is a bit involved and you would probably find it easier to re-install Python and make sure the right click file context menu entry is enabled.
I love this. Is there any way to format the Python output so you can put spaces and comments inbetween the section? Just to make the Python output more readable
Haha, I get a couple of people every so often complaining about how this method is too difficult; this is in fact one of the simpler ways and guarantees everything is setup correctly.
Thanks for your nice video! I follow your steps and it really works on my computer (64-bit windows 10). As a scientist, I usually import one-dimensional data and plot by matplotlib. Furthermore, I fit the data with different mathematical functions. So I am interested if the PyQt5 provides such functions that show plots produced by matplotlib in the GUI window. Thanks a lot!
I didn't even realise that you could use matplotlib in PyQt5 until a few weeks ago so I am not much of an expert on the topic sorry. If I do investigate the topic I will make sure to share though!
What do you mean by your keyEvent function? I am not quite sure what you are referencing. The general idea to setup a button, is to create a class/global method, e.g. def printMessage(self): print ("Hello World!") and then set up between the button and the class/global method, e.g. self.pushButton.clicked.connect(self.printMessage)
Once you've added your own code to the generated .py program, is it possible to go back to the design screen and make changes there, without losing your own code?
This video is really good, another person would do this in 3 videos of 15 minutes each
Thanks for recognizing this! I generally get a lot of good feedback about they speed I do these in but there are always a few that don't understand what a pause button is. I'm glad you like the approach.
good only if you don't want to really learn
@@mr1enrollment This is more of an introductory video to some possible basics if you couldn't tell.
I was reacting to the pace, it is way to fast and mechanical to be effective IMHO. The topic is interesting I am now glad to know of it. It is about time for a tool like this. Packing methods suck, and require too much effort to layout a GUI. NI LabWindows CVI and other tools have had this type tool for ~20 years or more. So good topic.
Definitely agree with this. Others also use lots of fruity language and dull examples on there own projects. I really just want the meat and potatoes. PyTutorials give us exactly that.
Wasted several hours on Tutorials on something I could of learn in 8 minutes. Thanks
Glad you enjoyed it!
PyQt s pl
@@anthonybuckingham5678 Sorry, this that a question?
Nice to know there is something other than Tkinter
Tkinter is a terrible library.
tkinter is unbelievably terrible, it brought me countless hours of banging head in front of my computer.
The last few days I have been thinking, why someone hasn’t written something that will create widgets easily. This is great stuff. Thanks for sharing your knowledge.
Glad you found it useful!
This is literally the best tutorial I've seen in the past two years. Well thought out, well prepared, and served in an informative and concise form.
Comments like this mean a lot to me, thank you very much!
I know others have mentioned it already, but thank you for the speed of the video.
You should make a new channel and make tutorials on how to make tutorials.
Haha, tutorials on how to make tutorials; I love the idea. If I am going to make more content though, it will probably be for this channel. If I do get more time though, I could potentially take up the idea thanks 👍
Efficiency is what I often find lacking in those who produce tutorials. They do not seem to realize that time is valuable when one tries to find information, and that making an extensive video for the reasons they evaluate is inconsiderate. This meets the qualities that should have those: Speed and clarity in the explanation without personalization ornaments,
So thanks! for efficiency and your consideration to shorten the duration time. And also thank you because now I leave Glade and I lean towards PyQt, if I recently started 1 week with python and 3 days informing about GUI implementation
Glad you like the speed! I make my videos how I would like to watch them; I'm happy you feel the same way!
This is really good for experienced Python programmers in terms of speed and content it covers. Some people would record a video and just keep talking tons of bullshit then start to code character by character to move forward. Yours are much better!
Glad you liked it!
I love your fast method of teaching. Subbed and ready to learn. You can say I'm very entry level, like honestly just started a few months ago and nowhere can I find and one that can explain something so clear and in good time as you. Well done I will be following you from now on.
I'm glad you liked the the format! Good luck on learning Python!
Goddamn what a fresh breath of air to watch a tutorial that doesn't stretch 10 mins worth of content into 30.
I'm glad you liked the format!
What a phenomenal tutorial. It is concise yet packed with useful data presented in a clear way. Same applies to the rest of your tutorials, thank you !
Thanks for the appreciation!
This is how coding tutorials should be, no wasting time in floundering over keyboard and to the point. Keep it up
Thanks man! Glad you like the format.
With a high speed but very useful. I learned in 8 minutes what is PyQt5 and can decide about learning it or Kivy.
Glad it was helpful 👍
Brilliant, this is how you make a clear, concise video to save everybody's time, retain the viewer for the entire length of the video and make the viewer ask for more !
I'm glad you enjoyed the length of the video! I try my best to keep these engaging while knowing the pause button is always available so it is always good getting feedback on this idea in my videos.
Wow I use python to do some automated testing I did not think it is that easy to add a view that easily. Definitely worth trying.
Python is definitely a lot more than automated testing 😀
Thank GOD somebody fast forward his videos to go to straight to the point.
The less "Um"s the better 👍
Neat trick for Windows users: open a CMD window in the current Explorer location just by typing ‘cmd’ (without the quotes) in the URI field (the field that shows your file path) and hitting Enter
I was amazed when I learnt this a couple of years back - it's great that it even sets the current working directory to where you opened it from
Class, really appreciate this man, was getting fed up of Tkinter and the other videos covering the PyQt5 designer are not as precise, none mentioned that the package could be installed via pip. Huge time saver watching this video, thanks.
Glad this was helpful! The old method to get the designer used to be by installing an exe but you are correct, using pip makes it much easier.
Finally! I have BEEN searching for something this easy to follow! Subscribing after seeing this, please keep uploading great content such as this!
Glad you enjoyed it! I try to find time for new videos but they do take quite a bit of time to make.
You save our time. We can learn it by pausing. A very good intelligent teacher.
Glad you enjoyed it and see what I aim for!
perfect Video. 2 hours worth of video in 8 minutes
I'm glad you like the speed 👍
Great video. I'm new to this stuff, writing programs with a GUI in general, but if i got this right then Qt Creator is simply to set up the layout, button etc. for your interface, then when you're happy with that you convert it to Python code and you start implementing what is going to happen when the different buttons are pressed and so on.
That's how I typically use this tool - just to get an initial layout. You can however, import the built .py file so you don't overwrite your changes (most Python developers would have guessed this). I made a tutorial on "How to Import a PyQt5 .ui File in a Python GUI" at nitratine.net/blog/post/how-to-import-a-pyqt5-ui-file-in-a-python-gui/ if you are curious.
This is a great video, it easy to understand, with detailed step by step instructions - where the audio in sync with the video. The best Part is it works! I am really grateful. Thank you !!
Cheers! I'm glad you found it helpful.
Mate, once again, right in the dead of night. I can't help myself but shout internally I lOVE U!
Haha, glad it was useful!
Clear and to-the-point. The only thing that puzzles me is the that this way of developing, translating from source to source and basically hacking new code in it, is considered a good idea. I will adapt but it does not feel very advanced.
I generally only use the tool to create the initial design and then build up from that programmatically.
I really loved the pace of your video. Really good work, thank you
Thank you! Glad you found it useful.
Looks like a lot of fun! Thanks for posting!
Thanx mate this video makes more sense I watched more that 20 useless vids until i got this one .
I'm glad you found it useful!
thank you so much , because of this video , i even integrated Qt and python in visual studio code editor , which made things a lot easier , and i learned a lot, and hoping for more similar tutorials, such as of the different forms and apps that can be made via this process.
That's awesome! If you are going to make apps with android, I believe there are a few tutorials using Kivy but I have seen a tool before that can package PtQt5 to apks.
You're a mind readermI'm searching for this on google and found Sendex's video series on youtube, When I about to start watching that video,I get this notification,came here to watch this first!.
Thanks for the support! Good luck on creating your GUI, remember stackoverflow questions will be some of the best advice you will ever get.
My man, hope all the tutorial videos wr like urs!
Very useful video for getting started! For those running from a custom environment (such as I did with Anaconda), your "pyuic5.exe" file will be located in the " Anaconda3\envs\pyqt5\Scripts " directory. Also, you "designer.exe" file may be located elsewhere, as well, when you are getting started and need to create that shortcut.
QUESTION: How do we merely UPDATE the .py fil if we need to modify the QT widgets, labels, etc., when we convert from .ui to .py? As it is, you lose all your custom functional and setupUI classes every time you have to modify the .ui file!
Thanks for that help, I don't use Anaconda so it is good to have them lying around here.
For your question, there are two methods. One is 'importing' the .ui file; in the PyQt5 documentation (look for uic.loadUi), you can import the .ui file and then build upon it. The reason I don't use this method is because you need to call findChild which can be a bit more confusing than the methods shown here - this can also break easily if you change the names in the .ui file.
The other option is to keep re-converting to .py and import this .py file in another python script. This other Python script will be your main script which inherits the interface from the converted .py file and then builds upon it. This way you can still use the methods in this video.
This was a really good video. Clear and to the point. Please do more like this exploring more features using PyQt5.
Glad you enjoyed it! I was thinking of doing a few more interesting things in PyQt5 in the future, thanks for the recommendation!
Fun fact: you can go into CMD by typing "cmd" straight into the file explorer when you click the path box of the folder you are currently in.
When I first found this out I thought it was amazing; such a great shortcut
@@PyTutorials Cheers! Love your tutorials, you explain everything so well and you make complicated stuff so much easier to understand. 🤩
That's sick. Didn't know this. It's a little easier then CDing your way there
Thanx man
I love the speed!!!!!!
Thanks heaps! I try to keep my videos free of things that waste time.
Very useful tutorial. Just a note, when adding many items like in the second example do it slower because those are all new concepts and I couldn't find the buttons so I had to slow down the video.
I'm sorry you found the video a bit too fast. When I was making it, the target was to get people to pause and watch themselves do it instead of following a video action-by-action.
I've infinitely loved this. Very concise, to the point, lovable, appreciatable, awesome tutorial. Please do more videos. Thank You so much!
Glad you enjoyed it!
This is exactly what I needed, So grateful I found this video. Thank you!!!
I'm glad you found it useful!
incredibly concise. thanks
Your videos are great! Thanks a ton. I'm learning a ton.
I'm glad you find them useful 👍
Great Tutorial , you can add the path of your python Scrips folder to your environment variables so you can access pyuic5 from anywhere and from any folder without changing your directory to the scrips folder. Thanks in advance : -)
I used to teach this way but people couldn't understand to use their own path. You are 100% correct though, it makes it a LOT easier. Also the directory should be on the PATH if they selected it in the instillation.
Fast, clear, and precisely!
Thanks for the videos!
I'm glad you enjoyed it!
Ironic that you typed precise incorrectly
It appears that the pyqt5_tools package has been updated recently and the location of pyuic5.exe and designer.exe executables could potentially be in a new location. If you cannot find these executables, try looking in pyqt5_tools\Qt\bin (thanks to Torsten W
and Roberto Rivera
for making me aware of this).
Alternatively, I see that the binaries can also be found in the "Scripts" folder in the root directory of your Python installation (are installing the packages of course).
Sorry for this confusion, I do not have control over the package so anything can change at any time.
Hi Py, great video, but I need your help. I tried looking for the executables in pyqt5_tools and everything, but I wasn't able to find them. Should I install a specific version of Python and PyQt5, this is a very urgent matter, please help!!!!
Was the pyqt5_tools folder in the site packages folder?
@@PyTutorials You shuold add this information to your Python GUI's on Nitrantine
@@ITQuestIT, just added it! Thanks for the reminder
Very clear and fast tutorial!
Glad you enjoyed it!
Great video. Loved it! I would really like to see a video from you showing how to create window with multiple views.. Like if you press a button., new buttons and labels show up with a button that can take you back to the original view. If anyone reading this knows how, please share.
I have done this before in a project and have an example at github.com/brentvollebregt/multi-clipboard/blob/master/multi_clipboard/ui.py#L203 . You can see that I have another class that inherits QtWidgets.QWidget on line 260 - this could be outside the class I have it in, I just put it in there for ease. You can then see after creating an instance of it, I call .show().
Although this might not be too helpful as it doesn't show the basics.
This example, however, is to show a new window. You would be better off to use the same window by removing all the contents and re-populating with the contents you now want.
@@PyTutorials ok, thank you.
thank you so much for the clear explanation
Glad you found it useful!
Amazing explanation, thank you so much.
Glad you found it useful!
u r the best i never seen somone like u, speed and a lot of information thanks bro
Glad you like it, man!
Bro.. You r awesome ....just keep going...your tutorials r really useful in real life...Thank you so much...hope you will continue like this...
Thanks heaps for the appreciation!
excellent tutorial and i recomend visiting your written tutorial website!!!
Thanks man! And yes, I try to write posts for each of my videos now so if you are unsure about any of the video, check out the site first (I can update a website but not a published video); thank you for noticing!
nice one..point to point and exactly what i was finding
Glad it helped!
I won't use tKinter anymore
A very useful video like all of yours
If that PyQt GUI maker app is made in python too...wow
Thank you! The GUI maker I believe would be written in C++ since that's what Qt is written in; they have just added a python interface to the code to make it accessible.
Brilliant tutorial! Thank you so much you made things very clear.
Glad you enjoyed it!
Exactly what I was thinking thanks //ji
amazing video ty
Glad you enjoyed it!
Best 8 minutes of 2018
Hahaha, glad you enjoyed it!
good introduction, really helpful, thanks.
Cheers! I'm glad you found it useful 👍
A tip for converting *.ui to *.py with pyuic5 :
When you are in the folder of your .ui, open a shell then write the following command in it:
pyuic5 *.ui > *.py
where *.ui is your GUI and *.py will be your GUI in python code.
This is easier than typing the whole path everytime !
The reason I type the whole path out in this video is for people that don't understand what relative paths are. I get a lot of people complaining that something is broken or I did something wrong when really they are not in the correct directory; using absolute paths helps mitigate this.
@@PyTutorials yes, definitely. It is a tip for guys who get it 😉
Another awesome video 😘😍😍btw in your videos i came to know that its good if an error occurs 😂😂
Haha, glad you enjoyed it!
Thank you so much!! This helps a lot
Glad you enjoyed it!
Instead of using full-paths for the individual files you're trying to modify from the CLI, I think it seems easier to instead stay in the directory of the files you're wanting to mess with, then call the pyuic5 executable using ITS full path.
Less copy/paste that way, since you're only using one thing that must be a full path.
Incidentally, on my Anaconda install (with python-3.6 on windows), I don't have a pyuic5.exe but a pyuic5.bat. It worked fine.
I wish I could use relative paths in these videos but too many people get confused with relative paths and the command prompt in general thus forcing me to use absolute paths. The whole situation annoys me too.
@@PyTutorials Interesting, because as-is it still uses relative paths. Hehe
But I see where you're coming from on that.
Oh, were did I used relative paths?
@@PyTutorials You moved to a certain directory then invoked pyuic5 relative to that directory. That's a relative path, is it not?
Oh right. I wanted people to find the executable before they started to use it, so this was the best way to verify that they had the correct path.
At last what I've been waiting for and I was wondering why a "super" language is very aggressive!
What do you mean by aggressive?
If you see how the design orientation in Microsoft visual Basic 6.0 was wasou know what user friendly means!!?? but I mean PYTHON does not give you that simplicity in G.U.I. !@@PyTutorials
It is all about first make your G.U.I. and then add the code to it...!
I agree, Visual Studio makes it a lot easier to design GUI's but Python and .NET/C# are very different. Python is not developed like C# is, C# has a lot more resources behind it's development.
well C# is the only language that I never came across and learn and I have learned a lot of languages @@PyTutorials
Qt Designer is the best!
tanks for tutorial, makes me easy to learn
Glad you found it useful!
really helpful , tks alot !
I'm glad you found it useful!
I dont quite get this. Is this better than tkinter?
Should i spend time learning it if im already learning tkinter
PyQt5 is so much better than tkinter in my opinion. So much more you can do.
Excellent tutorial! Appreciate the clarity and speed of explanations.
Glad you found it useful!
Great video. Like
That T H I C C en zed accent
Great vid!
Haha, T H I C C
What you recommend to use for GUI with Python and zero experience in it - Qt or GTK?
Ooooh, good question. I feel using Qt Designer is a good starting point as it keeps people feeling like they are getting somewhere; however Qt Designer should not be fully relied upon as the real skill is constructing a GUI dynamically programmatically. PyQt5 has a lot of resources online but in some cases I feel that tKinter tutorials may be easier to follow some times.
This is a bit of a tough one as I haven't really used tKinter that much as I saw limitations/difficulties from the beginning. I believe I would recommend PyQt5, it may take a bit more effort to learn but it is definitely worth it. Just please don't always rely on the Qt Designer to create your GUI as sometimes creating the GUI manually can be an easier method. Use Qt Designer more as a tool to see how things are constructed.
Excelente !, gracias.
Glad you found it helpful!
Wow, I finally found solution to solve it thank you so much
Glad you found it useful!
Thanks you so much!
Glad you liked it!
i love all your video
Thanks for the appreciation!
amazing tutorial
Glad you found it useful!
@@PyTutorials Thank you very much!
Nice video. I have been using PAGE, but Qt seems like it has more features.
I hadn't heard of PAGE before, looks interesting!
@@PyTutorials It's certainly functional, but it's like a stripped down Qt Designer.
Qt also has many other features like clipboard manipulation and other cool stuff that you generally don't find in other UI frameworks.
You deserve a cold Heineken truck! Very Nice !!!
Haha, glad you found it useful!
Thanks dude brilliant video.
I'm glad you found it useful!
@@PyTutorials I did. I was experiences lots of errors while installing PyQt5 using the exe file.
@@PyTutorials How do i uninstall PyQt5 in command prompt, i want to install PyQt4 which is in line with my old textbook i am using.
`python -m pip uninstall pyqt5` (the standard way of uninstalling any package from pip)
perfect, thank you so much bro👍😊
Glad you found it useful!
It's really helps thank you
That's great to hear!
For those who can't find Qt designer,
mine is inside path Python38-32\Lib\site-packages\pyqt5_tools\Qt\bin
Else, open cmd, type in 'designer' then it will directly open the app for you
In the description I noted designer.exe has now been moved to pyqt5_tools\Qt\bin but can also be found in the \Scripts\ folder in the root of your Python installation
Awesome speed :) Thanks
Glad you liked it!
Great video and great channel my friend! Your website is also really cool.
Btw, sorry if this is a newbie question, but can we link a function instead of a method to a button with PyQt5 ?
Thanks!
What do you mean by function? To me functions and methods are the same.
I already figured it out! I meant a function defined outside a class. But obviously I can write inside it.
I really appreciate your work man, keep it up!
Glad you got it working!
Nice tutorial! However, I prefer not to implement widget behavior inside the auto-generated PyQt5 Python file, as changes would be lost if you wanted to modify the GUI with Qt Designer. Who knows if you wanted to resume the project after months of laying it aside and you can't remember exactly what to do?
I use the designer as more of a place to get a starting shell. You are actually allowed to modify the code that is generated to add different widgets or even change existing ones. This simply creates a good starting place for people new to PyQt5.
Thank you sir
Glad you enjoyed it!
Hi, I have a problem. I have a class Event and one is Main script. In Event class, i have on_login method and compared id and password and return the status as per the validation. Now, in main script, login_form.btn_login.clicked.connect(login). Now, while clicking i want to have the status. But, not getting. Please help.
Could you expand on this a bit more? Also I recommend using a debugger so that you can watch how the flow of your script is going.
@@PyTutorials pastebin.com/JDyqqrrY This is event script. Here i have on_login method and returning self.status.
pastebin.com/HMZKUEi3 This is the main script. on line 13, i have create event on button click and called on_login. Now, here i am struggling that, how i will get that return value in main script.
Best method would be to create a definition in HMZKUEi3 which calls on_login from JDyqqrrY and then saves the value somewhere in HMZKUEi3.
After this, connect login_form.btn_login to the new definition. This means when the button is clicked, it calls this new function which then calls the one you are trying to get the result from. Using this new function, you can then store the returen value.
Remember, you cannot get the return of a trigger even created by the .connect definition/function, you need to create a kind of middle-man function as I have described.
great video! thanks for being concise. please do one going into the further functionalities of pyqt5 if you don't mind.
I also have a question: if you need to convert the UI file to PY in order to modify the code and set up functionalities, can you no longer open the file in designer to make further modifications to the UI? Appreciate your help
You can only make modifications to the .ui file using the designer, not the Python script. One method to get around this is to import the .ui file in Python and then make changes in the Python script. This allows you still to make changes to the .ui file and keep your changes. I wrote a post at nitratine.net/blog/post/how-to-import-a-pyqt5-ui-file-in-a-python-gui/ explaining this.
@@PyTutorials but the .ui and .py files are not linked surely? Once I've exported the .ui File to .py and hooked up all the buttons, but then decide that I want to change the layout of the buttons, I would have to go back into the designer, make changes to the .ui File, export it to the .py file, then copy over the hookups to the buttons from the other file, is that not so?
No, the .ui and .py files are not linked, I thought you were trying to edit the .py in designer sorry. You are correct, if you make changes to the .ui file and turn it into a .py again, copy over your changes and it will be fine.
@@PyTutorials ah ok, no problem. Its a great little program regardless!
Excellent video, Thank you. I am wondering what would be your typical workflow for working with QT Designer and python. I suspect that each time you modify your UI and generate PY file again, it override the previous python file where you had made all your event handling modifications. Is there a smart way to be able to modify the UI without loosing all your changes in python ?
There are a couple of ways but they are both practically the same; however I do not use them as I only use the designer for an initial skeleton and then modify the GUI programmatically from there on in. The idea is to give names like I do in this video (5:37) for referencing elements so you can find them later. Then you want to import the .py file created by pyuic5 (it can be regenerated, you don't need to edit this file) and instantiate the GUI; from here you should have a pointer to the GUI object which you can use to call each element.
The other way is to import the .ui file and use the references like before. Once again, I do not use this method so cannot provide examples sorry.
I know these aren't great explanations but I do not use the method currently.
thank you, thank you, thank you!!!
Glad you found it useful!
thank you very muchhhhhhhhhhhh
You're welcome 👍
It works ! my .py file is associated with idle.bat now, I don't need do further even though "edit with IDLE " still not appeared when right click.
Adding the item to the right click file context menu is done by the Python installer - doing it manually is a bit involved and you would probably find it easier to re-install Python and make sure the right click file context menu entry is enabled.
Cool Stuff
wow! you have such a beautiful voice!
Thank you ❤️
I love this. Is there any way to format the Python output so you can put spaces and comments inbetween the section? Just to make the Python output more readable
Python output? This is a GUI sorry; maybe wrong video?
شكرا
Is it possible to create some check-boxes and use them to select which data to use to create and show a graph?
Yes, it is possible. There will be many ways you can do this so it might pay to experiment with a few concepts.
Wow, that shure was an easy way to get Qt Designer for free
Haha, I get a couple of people every so often complaining about how this method is too difficult; this is in fact one of the simpler ways and guarantees everything is setup correctly.
@@PyTutorials Thank you!
Thanks for your nice video! I follow your steps and it really works on my computer (64-bit windows 10). As a scientist, I usually import one-dimensional data and plot by matplotlib. Furthermore, I fit the data with different mathematical functions. So I am interested if the PyQt5 provides such functions that show plots produced by matplotlib in the GUI window. Thanks a lot!
If glad to hear this was of help to you!
Could you provide videos about how to add plots from matplotlib in PyQt5 app? Thanks
I didn't even realise that you could use matplotlib in PyQt5 until a few weeks ago so I am not much of an expert on the topic sorry. If I do investigate the topic I will make sure to share though!
Can you tell me where should I place my keyEvent function? I just wanted to close some form if this key was pressed. Thank you!
What do you mean by your keyEvent function? I am not quite sure what you are referencing. The general idea to setup a button, is to create a class/global method, e.g.
def printMessage(self):
print ("Hello World!")
and then set up between the button and the class/global method, e.g.
self.pushButton.clicked.connect(self.printMessage)
Once you've added your own code to the generated .py program, is it possible to go back to the design screen and make changes there, without losing your own code?
If you inherit the UI class from a different file then yes