< id="tt-body-category">
본문 바로가기 메뉴 바로가기

burningrizen

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

burningrizen

검색하기 폼
  • 분류 전체보기 (254)
    • development (14)
      • python (5)
      • django (4)
      • git (3)
      • ubuntu (1)
      • aws (1)
    • common (3)
      • tistory (2)
      • document (0)
    • python lecture (233)
      • basic (96)
      • concurrency (11)
      • functional programming (1)
      • cleancode (1)
      • common (6)
      • algorism (31)
      • programmers (65)
      • project (22)
  • 방명록

python lecture (233)
[python] 호텔 평점 프로젝트

python lecture/project 2020. 11. 8. 21:40
[Python] Pillow 영상처리 이미지 회전

import math from PIL import Image def rotate(x, y, theta, pi=3.14): radian = theta * pi / 180 sin = math.sin(radian) cos = math.cos(radian) new_x = cos*x - sin*y new_y = sin*x + cos*y return new_x, new_y def rotate_img(ori, theta): dst = Image.new("RGB", ori.size, (0, 0, 0)) width, height = ori.size pixels_dst = dst.load() pixels_ori = ori.load() for y in range(height): for x in range(width): ro..

python lecture/project 2020. 10. 14. 23:09
[python] 은행프로그램

1. 계좌생성 > 예금주 계좌번호 입금액 2. 입금 > 계좌번호 입금액 3. 출금 > 계좌번호 출금액 4. 이체 > 출금계좌번호 입금계좌번호 액수 5. 조회 > 계좌번호 6. 저장 > 파일로 일괄저장 > 계좌번호.txt > 계좌번호 파일에 통장이력은 아래와 같음 (기록시간, 입금 혹은 출금, 액수, 잔액) import datetime class Log: def __init__(self, add=0, sub=0, balance=0): self.now = datetime.datetime.now() if add: self.add = add if sub: self.sub = sub self.balance = balance def __str__(self): return f"{','.join(map(str, sel..

python lecture/project 2020. 7. 2. 22:13
[python] 지하철 승하차 기록 조회

승하차기록파일 1. 년월, 역이름 으로 필터 2. 필터된 승하차 총합을 구함 3. plotly 설치후 그래프로 표시 def read_file(path): with open(path, "r") as f: return f.readlines() class Log: def __init__(self, date=None, line=None, station=None, in_outs=None): self.date = date self.line = line self.station = station self.in_outs = in_outs def __str__(self): return f"{self.__dict__}" @classmethod def line_to_list(cls, line): line = line.repl..

python lecture/project 2020. 6. 7. 15:08
[python] n 진수 바꾸기

십진수 를 n 진수로 변경하기 def foo(r, base): tokens = "0123456789ABCDEF" result = "" q = r while q: q, r = divmod(q, base) n = tokens[r] result = n + result return result print(foo(23, 5))

python lecture/project 2020. 6. 3. 22:51
[python] 시간변환

시간 데이타 파일 더보기 22 25 0 5 30 195 17 40 200 17 15 210 0 40 -50 8 40 -200 22 10 -50 2 15 910 23 20 100 10 50 -20 8 40 200 결과 더보기 22:25 8:45 21:0 20:45 23:50 5:20 21:20 17:25 1:0 10:30 12:0 def read_file(path): with open(path, "r") as f: return f.readlines() def write_file(path, lines): with open(path, "w") as f: f.writelines(lines) def lines_to_rows(lines): rows = list(map(lambda x: x.replace("\n", ..

python lecture/project 2020. 5. 27. 12:38
[python] 스테가노그래피

원본, 히든 이미지 스테가노그래피 설명 Pillow 라이브러리 설치 from PIL import Image as image def encoding(dec, data): val = bin(dec)[:-1] + ("1" if data else "0") return int(val, 2) def decoding(dec): return 255 if int(bin(dec)[-1]) else 0 def encoding_pixel(color_ori, color_data): r = encoding(color_ori[0], color_data[0] if isinstance(color_data, tuple) else color_data) g = encoding(color_ori[1], color_data[1] if isin..

python lecture/project 2020. 5. 25. 23:33
[python] 남/여 균일 매칭

1. 남여를 매칭하는 프로그램을 만든다. 2. 이전에 매칭된 이성은 매칭하지 않는다. 3. 한번에 매칭되는 할당양을 지정한다. 4. 성비가 적은쪽은 할당양 보다 더 많이 받는다. > 예: 남=10, 여=5 일때 할당양이 2면 남자는 2, 여자는 4 정도를 받는다. 5. 어떤 사람이 많이 매칭되고 어떤사람이 적게 매칭되지 않게 균일하게 매칭한다. import random class User: def __init__(self, _id=None, gender=None, history_users_group=None): self.id = _id self.gender = gender self.history_users_group = history_users_group if history_users_group else..

python lecture/project 2020. 5. 25. 22:33
[python] # 연산 하기

아래와 같은 연산을 하는 함수를 작성한다. 더보기 입력출력 결과 input > 123, 11 output > 132131 input > 144345, 13 output > 12433251 input > 153, 12 output > 12513121 def add(a, b): return str(a) + str(b) def count(t, s): return f"{t}{s.count(t)}" def remove(t, s): return s.replace(t, "") def foo(a, b): r = "" s = add(a, b) while s: r += count(s[0], s) s = remove(s[0], s) return int(r) print(foo(11, 14))

python lecture/project 2020. 5. 11. 22:38
[python] 원소기호 맞추기

[메인메뉴] 1. 원소기호 추가 2. 원소기호 수정 3. 원소기호 삭제 4. 원소기호 맞추기 5. 종료 [서브메뉴] 1번메뉴: 한줄에 [원소이름] [원소기호] 를 입력한다 > 수소 H 2번메뉴: 한줄에 [바꿀원소이름] [새로운원소이름] [ 새로운원소기호] > 수소 수소 H 3번메뉴: 한줄에 [삭제할원소이름] > 수소 4번메뉴: 지금까지 입력한 원소리스트 중에 원소 이름을 랜덤으로 출력하면 기호를 맞춘다. 그리고 정답숫자/전제문제 를 출력한다. quit 를 입력하면 플레이 종료 > [수소] 의 원소기호는 무엇입니까? > H > 정답입니다. 1/2 정답 > quit 5번메뉴: 종료라고 메세지를 출력하고 프로그램을 종료한다. import random def add(items, key=None, value=No..

python lecture/project 2020. 5. 9. 13:42
이전 1 2 3 4 ··· 24 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • 파이썬 프로그래밍
  • 문서 비교
  • 파이썬
  • django
  • 파이썬 독학
  • GIT
  • virtualenv
  • gitignore
  • wsgi
  • 모바일 스킨 적용
  • 엑셀 비교
  • 파이썬 입문
  • django chatbot
  • 장고
  • gitlab
  • 이미지 비교
  • 문과 코딩
  • PuTTYGen
  • Tistory
  • 면접정답
  • 면접답변
  • pycrypto
  • admin.py
  • 장고 플러스친구 자동응답
  • 플러스친구 자동응답
  • Python
  • 모바일 테마 적용
  • chatbot
  • 파이썬 강좌
  • 장고 카톡 자동응답
more
«   2025/08   »
일 월 화 수 목 금 토
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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바