Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Create LABELS with Python in 8 minutes! ๐Ÿท๏ธ
Play lesson

Python tutorial for beginners ๐Ÿ - Create LABELS with Python in 8 minutes! ๐Ÿท๏ธ

4.0 (0)
8 learners

What you'll learn

This course includes

  • 14.3 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

#pythontutorial #python #pyqt5 # PyQt5 QLabels import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel from PyQt5.QtGui import QFont from PyQt5.QtCore import Qt class MainWindow(QMainWindow): def __init__(self): super().__init__() self.setGeometry(700, 300, 500, 500) label = QLabel("Hello", self) label.setFont(QFont("Arial", 40)) label.setGeometry(0, 0, 500, 100) label.setStyleSheet("color: #292929;" "background-color: #6fdcf7;" "font-weight: bold;" "font-style: italic;" "text-decoration: underline;") # label.setAlignment(Qt.AlignTop) # VERTICALLY TOP # label.setAlignment(Qt.AlignBottom) # VERTICALLY BOTTOM # label.setAlignment(Qt.AlignVCenter) # VERTICALLY CENTER # label.setAlignment(Qt.AlignRight) # HORIZONTALLY RIGHT # label.setAlignment(Qt.AlignHCenter) # HORIZONTALLY CENTER # label.setAlignment(Qt.AlignLeft) # HORIZONTALLY LEFT # label.setAlignment(Qt.AlignHCenter | Qt.AlignTop) # CENTER & TOP # label.setAlignment(Qt.AlignHCenter | Qt.AlignBottom) # CENTER & BOTTOM # label.setAlignment(Qt.AlignHCenter | Qt.AlignVCenter) # CENTER & CENTER # label.setAlignment(Qt.AlignCenter) # CENTER & CENTER def main(): app = QApplication(sys.argv) window = MainWindow() window.show() sys.exit(app.exec_()) if ___name___ == "__main__": main()

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere