Skip to content

Instantly share code, notes, and snippets.

@PaulleDemon
Created October 26, 2021 06:31
Show Gist options
  • Save PaulleDemon/2e64ca501e0fab58b9ae7c601e471326 to your computer and use it in GitHub Desktop.
Save PaulleDemon/2e64ca501e0fab58b9ae7c601e471326 to your computer and use it in GitHub Desktop.
Contains PyQt example of Button and label
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QPushButton
if __name__ == '__main__':
app = QApplication(sys.argv)
widget = QWidget()
label = QLabel("Sample label", parent=widget)
label.move(50, 50) # place the button at x=50, y=50 from the top left corner of the application
button = QPushButton("Button", parent=widget) # create an instance of QPushbutton
button.move(50, 100)
widget.show()
sys.exit(app.exec())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment