반응형

Qt 9

[python] 도서 검색기 feat. 네이버 개발자센터

Book.py #Book.py class Book: def __init__(self,title,author,price,content="",publisher="",link="",imglink=""): self.title = title self.author = author self.price = price self.content = content self.publisher = publisher self.link = link self.imglink=imglink NaverBookSearcher.py #NaverBookSearcher.py import urllib.request import json from Book import Book class NaverBookSearcher: @staticmethod de..

[python] EH 쇼핑몰 - 고객 관리, 상품 관리 - MSSQL, QT

CustomSql.py #CustomSql.py import pymssql class CustomSql: def AddCustom(self, cid, cname): conn = pymssql.connect("127.0.0.1:1433","sa","1234","BigPro") cursor = conn.cursor() query =str.format("insert into Custom (CID, CNAME) values('{0}','{1}')", cid,cname) cursor.execute(query) conn.commit() conn.close() def RemoveCustom(self, ckey): conn = pymssql.connect("127.0.0.1:1433","sa","1234","BigPr..

[python] 고객 관리 - QT, MSSQL

CustomSql.py #CustomSql.py import pymssql class CustomSql: def AddCustom(self, cid, cname): conn = pymssql.connect("127.0.0.1:1433","sa","1234","BigPro") cursor = conn.cursor() query =str.format("insert into Custom (CID, CNAME) values('{0}','{1}')", cid,cname) cursor.execute(query) conn.commit() conn.close() def RemoveCustom(self, ckey): conn = pymssql.connect("127.0.0.1:1433","sa","1234","BigPr..

[python] 상품 조회 응용 - MSSQL, QT 사용

ProductSql.py #ProductSql.py import pymssql class ProductSql: def AddProduct(self, pid,pname,price): conn = pymssql.connect("localhost","sa","1234","BigPro") cursor = conn.cursor() query =str.format("insert into Product (PID, PNAME, Price) values('{0}','{1}',{2})", pid,pname,price) cursor.execute(query) conn.commit() conn.close() def RemoveProduct(self,pkey): conn = pymssql.connect("localhost","..

[python - QT] 리스트 박스 사용하기 - QListWidget

항목 추가 : addItem(항목) 항목 삭제: takeItem(항목 인덱스) 모든 항목 삭제: clear() 선택 항목 변경 이벤트: currentItemChanged 공식 QT 문서에서 자세히 살펴보기 MyWidget.py #MyWidget.py from PyQt5.QtWidgets import * from PyQt5.QtGui import * class MyWidget(QWidget): def __init__(self): super().__init__() self.setWindowTitle("리스트 박스 사용 데모") self.resize(1000,800) self.lbox = QListWidget(self) self.lbox.resize(400,600) self.te=QTextEdit(self) ..

[python] QT, MSSQL 활용 - 상품 등록하기

Product 테이블 CREATE TABLE [dbo].[Product] ( [PId] VARCHAR (50) NOT NULL, [PName] VARCHAR (50) NOT NULL, [Price] INT NOT NULL, [PKey] INT IDENTITY (1, 1) NOT NULL, CONSTRAINT [PK__Product__C57755405495D0B5] PRIMARY KEY CLUSTERED ([PKey] ASC), CONSTRAINT [AK_PID] UNIQUE NONCLUSTERED ([PId] ASC) ); ProductSql.py #ProductSql.py import pymssql class ProductSql: def AddProduct(self, pid,pname,price): c..

[Python - QT] 텍스트 입력 및 설정, 버튼 클릭 이벤트 핸들러 등록하기

MyWidget.py #MyWidget.py from PyQt5.QtWidgets import * from PyQt5.QtGui import * class MyWidget(QWidget): def __init__(self): super().__init__() self.setWindowTitle("테스트 입력 및 설정") self.te = QTextEdit(self) self.te.resize(400,90) self.resize(1000,600) self.btn = QPushButton("확인",self) self.btn.move(430,0) self.btn.resize(200,90) self.lb = QLabel("[테스트]",self) self.lb.move(0,110) self.btn.clicked...

[python - QT] 위젯의 타이틀 및 배경색 설정하기

MyWidget.py #MyWidget.py from PyQt5.QtWidgets import * from PyQt5.QtGui import * class MyWidget(QWidget): def __init__(self): super().__init__() self.setWindowTitle("나의 창") pal = QPalette() pal.setColor(QPalette.Background,QColor(255,0,255)) self.setAutoFillBackground(True) self.setPalette(pal) Main.py import sys from PyQt5.QtWidgets import QApplication from MyWidget import MyWidget app = QAppli..

반응형