In this article, we will see how to use
close() method which belongs to the
QWidget class, this method is used to close the window in PyQt5 application. In other words by
close() method the window get closed without manually closing it.
Syntax : self.close()
Argument : It takes no argument.
This will open the window and after 2 seconds it will automatically closes the window.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course