
import MySQLdb # Words 클래스 class Words: def __init__(self, eng, kor, lev=1): self.eng = eng self.kor = kor self.lev = lev def setEng(self, eng): self.eng = eng def setKor(self, kor): self.kor = kor def setLev(self, lev): self.lev =lev def getEng(self): return self.eng def getKor(self): return self.kor def getLev(self): return self.lev # SQL에서 작동할 클래스 class WordsDao: def __init__(self): self.db ..

1. mysqlclient 파이썬에서는 MySQL 서버와 통신할 수 있는 파이썬용 데이터베이스 커넥터를 다양하게 지원 PyMySQL, mysqlclient를 가장 많이 사용 PyMySQL은 속도가 느리고 연습용, 사용법은 비슷하고 속도가 빠른 mysqlclient 권장 !pip install mysqlclient import MySQLdb 1-1) MySQL 접속하기 # MySQLdb.connect(host='IP주소', user='사용자', password='비밀번호', db='DB명') db = MySQLdb.connect(host='localhost', user='root', password='1234', db='kdt') 1-2) cursor 생성하기 하나의 DataBase Connection에 ..

1. MySQL 문자열 함수 1-1) concat 복수의 문자열을 연결해주는 함수 select concat('안녕하세요!', 'MySQL') as concat; select * from member; select concat(address1, ' ', address2, ' ', address3) as address from member where userid='apple'; 1-2) left, right 왼쪽 또는 오른쪽에서 길이만큼 문자열을 가져옴 select left('ABCDEFGHIJKLMN', 5); # ABCDE select userid, left(userpw, 2) as password from member; 1-3) substring 문자열의 일부를 가져옴 - substring(문자열, 시..

1. 데이터베이스 생성/선택 create database [데이터베이스명]; use [데이터베이스명]; drop database [데이터베이스명]; show database; # 데이터베이스 전체 보기 2. 테이블 확인/삭제 desc [테이블명]; # 테이블 구성요소 확인 drop table [테이블명]; # 테이블 삭제 4. 필드(열) 추가/수정/삭제 1) 추가 alter table [테이블명] add [필드명] varchar(10); -- not null 제약조건 불가능, 새로 추가한 순간 빈칸이므로 2) 수정 alter table [테이블명] modify column [필드명] varchar(20); 3) 삭제 alter table [테이블명] drop [필드명]; ※ CRUD (Create Rea..

https://dev.mysql.com/downloads/installer/ MySQL :: Download MySQL Installer Note: MySQL 8.0 is the final series with MySQL Installer. As of MySQL 8.1, use a MySQL product's MSI or Zip archive for installation. MySQL Server 8.1 and higher also bundle MySQL Configurator, a tool that helps configure MySQL Server. dev.mysql.com 위 링크에서 설치 계속 Next로 넘겨주다가 중간중간 주의해야할 부분만 살펴보겠다. (설치 시 주의사항) 1. Full로 설치!..

[ 목표 ] 현재 바탕화면에 있는 파일들을 확장자별로 폴더를 나눠서 분류해보자! 1단계 : 압축파일이 있다면 압축을 풀고 정리 #현재 경로 import os os.getcwd() # 결과 : 'C:\\Users\\wlghk\\Desktop' target_path = './바탕화면' # 바탕화면폴더 경로 설정 # 바탕화면에 있는 압축 파일 찾기 import glob zipfile_path = [] for filename in glob.glob(os.path.join(target_path, '*.zip')): zipfile_path.append(filename) print(zipfile_path) # 결과 : ['./바탕화면\\서울농수산시장관리 응시원서_경비_황석규.zip'] 1-1. 압축 해제 (한글 깨짐..
- Total
- Today
- Yesterday
- MySQLdb
- 고정위치
- MySQL
- 솔로의식탁
- 셋
- 닷홈
- 줄 간격
- DB단어장
- CSS
- trasform
- 박스사이징
- FOR
- Enclosing
- animation적용
- 클래스문
- __call__
- html이론
- Python
- 리스트
- 로또번호생성
- 변수
- 폼
- 파이썬SQL연동
- EPL정보프로그램
- 상대위치
- DB프로그램만들기
- HTML
- 출력
- JavaScript
- 절대위치
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |