728x90
반응형
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QPushButton
class MyApp(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
label1 = QLabel('Label1', self)
label1.move(20, 20)
label2 = QLabel('Label2', self)
label2.move(20, 60)
btn1 = QPushButton('Button1', self)
btn1.move(80, 13)
btn2 = QPushButton('Button2', self)
btn2.move(80, 53)
self.setWindowTitle('Absolute Positioning')
self.setGeometry(300, 300, 400, 200)
self.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = MyApp()
sys.exit(app.exec_())
728x90
반응형
'프로그램' 카테고리의 다른 글
[파이썬] 문제 : 입력 받은 문장의 단어 빈도수 (0) | 2022.11.21 |
---|---|
[파이썬] 문제 : UI 입력 받기(PyQt5) (0) | 2022.11.21 |
[파이썬] 문제 : 이중 while True문 (0) | 2022.11.21 |
[파이썬] 문제 : 파일명 찾아 없을때 알람(BeepSound) (0) | 2022.11.21 |
[파이썬] 문제 : ID 중복 찾기 (0) | 2022.11.21 |
댓글