본문 바로가기
반응형
[파이썬/Python] 파이썬으로 디렉토리 내 모든 파일과 디렉토리 출력하기 #Print Directory Listing Recursively in Python [파이썬/Python] 파이썬으로 디렉토리 내 모든 파일과 디렉토리 출력하기 #Print Directory Listing Recursively in Python 특정 디렉토리의 Path가 주어졌을 때, 하위의 모든 디렉토리를 방문하면서 Recursive하게 내부에 있는 파일과 디렉토리를 리스팅하는 스크립트를 만들어봤습니다. 일을 할 때, 가끔식 필요한 경우가 있더라구요. 그래서 간단하게 파이썬으로 구현해봤습니다. Print Directory Listing Recursively in Python 다른데서도 쓰기 편하게 함수로 구현되었으니, 참고하세요. import glob import os import sys def directoryListing(dirPath, depth=1): for item in os.. 2021. 1. 27.
파이썬으로 유튜브 정보 가져오기 #유튜브 제목, 조회수 등의 정보를 Python으로 가져오기 #파이썬 유튜브 제목 조회수 가져오기 #파이썬 pafy #Python pafy 파이썬으로 유튜브 정보 가져오기 #유튜브 제목, 조회수 등의 정보를 Python으로 가져오기 #파이썬 유튜브 제목 조회수 가져오기 #파이썬 pafy #Python pafy 파이썬으로 유튜브의 제목과 조회수와 같은 정보를 가져올 수 있을까? 궁금해서 해보았다. 관련된 모듈을 찾아보니 pafy라는 모듈이 있었다. pythonhosted.org/pafy/ Pafy Documentation — pafy 0.5.1 documentation pafy: The Pafy object for this video, initialised with the arguments given to pafy.get_playlist() playlist_meta: a dict of various video-specific metadata .. 2020. 10. 30.
반응형