[파이썬] 파일의 최상위 공통 폴더 찾기
By 지훈현서 | 2020년 8월 18일 |
파이썬에서 특정 파일이나 폴더의 절대 경로에서최상위 최대 공통 폴더를 구할 필요가 생겼습니다. 예를 들어, 'V:\rpa-modules\argoslabs\file\zipunzip\tests\__init__.py','V:\rpa-modules\argoslabs\file\zipunzip\__init__.py','V:\rpa-modules\argoslabs\file\__init__.py' 위와 같은 파일 목록이 있을 때,최대 긴 공통 폴더는, 'V:\rpa-modules\argoslabs\file'입니다. 무엇이 있을까 하고 살펴보는데, 간단하게도 os.path 에 있는 commonprefix 함수를 이용하면 되었습니다. 재미난 것은 임의의 목록에 대해서도 모두 적용된다는 것입니다. 아주 간단하게,
mediainfo - 리눅스에서 음악/동영상 파일 정보 확인
By 반달가면 | 2020년 10월 19일 |
리눅스에서 음악/동영상 파일에 대하여 인코딩 방식, 길이 등 자세한 정보를 파악하고자 할 경우 mediainfo를 활용하면 된다. 설치는 아래와 같이 진행한다. 데비안/우분투 계열 배포판 기준이다. # S/W 저장소 정보 갱신 sudo apt-get update # mediainfo 패키지 설치 sudo apt-get install mediainfo 예를 들어 my_music.mp3 파일에 대한 정보를 보려면 아래와 같이 하면 된다. # my_music.mp3 상세 정보 출력 mediainfo my_music.mp3 | more 특정 정보를 확인하려면 grep과 조합하면 편리하다. # my_music.mp3의 길이(Duration) 확인 mediainfo my_musi
[Python] Flask-RestPlus 모듈 제대로 사용해 보기
By 지훈현서 | 2017년 10월 18일 |
지난번에 [Python] Flask & flask-restplus && swagger ui 라는 블로그를 정리했었습니다.그런데 이것을 기존에 작업되어 있던 것에 적용을 하는데이틀정도 시행착오를 겪었습니다. 아직 0.10.1 이라는 버전 때문에 그럴 수도 있지만 뭐 현실에 적응해서 앞으로 나아가는게우선이라...(나중에라도 버전업이 되어 원하는 데로 되어 간다면 내용을 수정해 놓겠습니다) 다음은 작업되어 있는 것을 수정한 내용입니다. 우선 기존 Blueprint 로 되어 있던 부분을 Namespace로 변경합니다. 기존,bp_aaa = Blueprint('bp_aaa', __name__, url_prefix='/api/aaa') 변경,api = Namespace('ns_aaa', d
[Linux][Kernel] What is process?
By Guillermo Austin Kim | 2018년 12월 26일 |
It is difficult to understand process in Linux Kernel. Because processes are abstract concepts, it can be viewed from different perspectives. It seems that you have read and understood the process, but it is often difficult to apply what you have learned in practice to the process. Why? This is because we study the process in a way that understands theory. This process does not seem to be the goa