from PyQt5.QtCore import QSettings # create a QSettings object with an organization and application name settings = QSettings("MyCompany", "MyApplication") # start a new group to organize settings settings.beginGroup("Window") # set some window settings settings.setValue("size", "800x600") settings.setValue("title", "My Window") # end the group settings.endGroup()In the above example, we create a QSettings object and start a new group called "Window". We then set some window-related settings within this group using the setValue() method. Finally, we use the endGroup() method to end the "Window" group. Package library: PyQt.QtCore is the package library used in the above example.