https://github.com/developer0hye/rotten-korean-romanizer/tree/main GitHub - developer0hye/rotten-korean-romanizer: Python library for romanizing Korean text. Converts '안녕하세요' to 'annyeoPython library for romanizing Korean text. Converts '안녕하세요' to 'annyeonghaseyo' and more. - developer0hye/rotten-korean-romanizergithub.com 기존에 한글을 romanization 할 일이 있을때, https://github.com/osori/korean-romanizer ..
https://docs.python.org/dev/faq/library.html#can-t-we-get-rid-of-the-global-interpreter-lock Library and Extension FAQ Contents: Library and Extension FAQ- General Library Questions- How do I find a module or application to perform task X?, Where is the math.py (socket.py, regex.py, etc.) source file?, How do I mak... docs.python.org GIL 때문에 완전한 multithread의 이점을 못누려서 IO Bound task들이나 C로 구현되어 있는 ..
import traceback try: ... except Exception as e: print(e) 코딩을 하다보면 발생하는 예외를 처리하기 위해 try except 문을 많이 쓰게된다. 근데, 위에 코드 처럼 구현하면 어떤 예외가 발생하는지는 알 수 있지만 어디서 어떤 작업을 하다가 해당 예외가 발생했는지 추적이 어렵다. 어디서 예외가 발생했는지 추적을 하기 위해서는 traceback을 import하고 traceback.print_exc()를 except 블럭에서 호출해주면 된다. import traceback try: ... except Exception as e: print(e) traceback.print_exc()
with open(...) as f: for(...): f.write(...) f.flush() 바로 flush()함수를 호출해주면된다. 이거 안해주면 쓰기 작업이 다 마친뒤에야 확인 가능하다. (logging 모듈써서 로깅하는 거면 중간에도 확인 가능) 파일에 쓸 게 많고 파일에 로그를 남기기 위해 소요되는 시간이 길다면 이게 잘 써지고는 있는지 불안하길 마련인데 적절한 시기에 flush 를 한 번씩 해주면 바로 logging이 어떻게 됐나 확인할 수 있다.
Python 프로그래밍중 프로그램이 키보드 인터럽트(Ctrl + c) 혹은 강제 종료, 정상 종료 케이스에 따라서 특정 함수가 호출됐어야 했었습니다. 제 경우를 자세히 말씀드리자면 pyav를 사용하여 RTSP 프로토콜로 비디오를 수신받아 디코딩을 하는데, RTSP 서버(VLC 이용)와 연결 후 연결을 끊어주지 않고 클라이언트 측 프로그램이 종료되는 경우 RTSP 서버의 VLC 프로그램 또한 정상적으로 동작을 안하는 문제가 있었습니다. 확인해보니 항상 연결을 끊어줘야하는데 그렇지 않은 경우 문제가 발생하던 것이였습니다. https://github.com/PyAV-Org/PyAV GitHub - PyAV-Org/PyAV: Pythonic bindings for FFmpeg's libraries. Python..
https://github.com/developer0hye/commitcleaner GitHub - developer0hye/commitcleaner: Clean your all commit history in one line Clean your all commit history in one line. Contribute to developer0hye/commitcleaner development by creating an account on GitHub. github.com 커밋 기록을 명령어 한줄로 싹 날려주는 패키지 pip install commitcleaner cd {your project} commitcleaner 커밋 기록 날리는 방법을 스택오버플로로 찾아 봤는데 명령어를 좀 여러줄 입력시켜줘..
windows 에서 rglob 을 통해 파일(*.ext)을 읽어들이면 파일 확장자에 insensitive해서 대문자 (*.EXT) 든 소문자(*.ext)든 알아서 잘 읽는다. linux 계열에서는 rglob을 통해 파일을 읽어들일때는 파일 확장자에 sensitive 하다. 그래서, 대문자, 소문자 둘다 읽어들이려면 별도의 후처리가 필요하다. 삽질을 안하려면 대문자, 소문자를 통일 시켜줄 필요가 있다. 아 근데 이건 rglob 에 국한된 건 아니고 glob.glob 도 마찬가지 일거 같고, 여타 파일 읽기/쓰기가 필요한 모든 코드에 적용되는 사항같다. https://superuser.com/questions/862270/convention-for-file-extensions-uppercase-or-lowe..
https://stackoverflow.com/a/53877507 Python progress bar and downloads I have a Python script that launches a URL that is a downloadable file. Is there some way to have Python display the download progress as oppose to launching the browser? stackoverflow.com import urllib.request from tqdm import tqdm class DownloadProgressBar(tqdm): def update_to(self, b=1, bsize=1, tsize=None): if tsize is no..
https://stackoverflow.com/questions/3211041/how-to-join-two-generators-or-other-iterables-in-python How to join two generators (or other iterables) in Python? I want to change the following code for directory, dirs, files in os.walk(directory_1): do_something() for directory, dirs, files in os.walk(directory_2): do_something() to this code: for stackoverflow.com Python Generator는 '+' 연산을 지원하지 않는..
- Total
- Today
- Yesterday
- 백준
- Lowest Common Ancestor
- 조합
- 위상 정렬 알고리즘
- MOT
- 가장 긴 증가하는 부분 수열
- ㅂ
- LCA
- FairMOT
- 이분탐색
- 백준 11053
- PyCharm
- 백트래킹
- 순열
- 백준 1766
- 자료구조
- 인공지능을 위한 선형대수
- 파이참
- C++ Deploy
- 백준 11437
- 단축키
- cosine
- 문제집
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |

