사소한 아이의 소소한 스킬

import sys, os from PyQt5.QtWidgets import * class BaseWindow(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): self.lbl = QLabel("EXAMPLE") self.btn_1 = QPushButton("QInputDialog") self.btn_1.clicked.connect(self.Input_showDialog) self.btn_2 = QPushButton("QColorDialog") self.btn_2.clicked.connect(self.Color_showDialog) self.btn_3 = QPushButton("QFontDialog") self..
import sys from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QSpinBox, QDoubleSpinBox, QVBoxLayout class MyApp(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): self.lbl1 = QLabel('QSpinBox') self.spinbox = QSpinBox() self.spinbox.setMinimum(-10) self.spinbox.setMaximum(30) # self.spinbox.setRange(-10, 30) self.spinbox.setSingleStep(2) self.lbl2 = QLabel('..
import sys from PyQT5.QtWidgets import QApplication, QWidget, QLabel, QDateTimeEdit, QVBoxLayout from PyQT5.QtCore import QDateTime class MyApp(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): self.lbl = QLabel('QTimeEdit') self.lbl2 = QLabel('QTimeEdit') self.datetimeedit = QDateTimeEdit(self) self.datetimeedit.setDateTime(QDateTime.currentDateTime()) self.dateti..
import sys from PyQt5.QtWidgets import QApplication, QWidget, QComboBox, QLabel, QVBoxLayout from PyQt5.QtCore import Qt class MyApp(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): # 라벨 생성 self.l = QLabel('Option1', self) # 콤보 박스 생성 self.cb = QComboBox(self) # 콤보 아이템 추가 self.cb.addItem('Option1') self.cb.addItem('Option2') self.cb.addItem('Option3') self.cb.addIt..
리스트 역변환시키기 a=[“10”,”9",”8",”7"] print(a[::-1]) a.reverse() Output: ['7', '8', '9', '10'] # a[::-1]과 a.reverse()의 차이점 # a[::-1]의 경우 실 데이터 변경없이 거꾸로 출력만 진행하되 # reverse의 경우 실 데이터 자체를 역변환 시켜버림으로써 이 다음 작업 진행 시에도 역변환이 진행되었다는 것을 알고 있어야 한다. 리스트 합치기 a=[‘a’,’b’,’c’,’d’] b=[‘e’,’f’,’g’,’h’] for x, y in zip(a, b): print(x,y) Output: a e b f c g d h 리스트 내에서 빈번한 값 찾기 a = [1, 2, 3, 4, 2, 2, 3, 1, 4, 4, 4] print..
def wav_print(file_path): # 파일 읽어오기 file = open(file_path, "rb") # 44바이트의 헤더정보 가져오기 data = file.read(44) # 44바이틔 헤더 정보를 Dictionary 형태로 저장하기 file_header = {"name": file_path, "ChunkID": data[0:4], "ChunkSize": int.from_bytes(data[4:8], byteorder='little'), "Format": data[8:12], "Subchunk1ID": data[12:16], "Subchunk1Size": data[16:20], "AudioFormat": int.from_bytes(data[20:22], byteorder='little')..
주지님
'사소한 아이의 소소한 스킬' 카테고리의 글 목록 (4 Page)