본문 바로가기

python4

[python][pytube] youtube 영상 다운로드 갑자기 youtube 영상을 다운 받을 필요가 생겼다. 기존 크롬 extension에 있던것으로 받을려고 하니 정책상 더이상 지원할 수 없다고 떴다. 그리고는 자기네들 SW를 사용하라고 링크를 준다. 돈을 내란다.. 파이썬에 library가 있을 것 같아서 찾아보니 아니나 다를까 pytube가 있다. 영상 하나 다운 받거나, play list 받아서 모든 영상 다 다운 받는 것으로 만들었다. 실행 파일은 여기서 다운 받을 수 있다. 아니면 아래 복사해서 이름.py로 저장해서 실행해도 된다. 실행하고 영상 주소나, play list 주소를 넣고 엔터 누르면 된다. 실행한 경로에 videos 폴더를 만들고 거기 다운을 받는다. play list는 play list 제목으로 폴더 하나를 더 만들고 그 안에 다.. 2022. 10. 19.
[python][matplotlib] 파이썬에서 그래프 그리기 plot graph #reference link ##https://stackoverflow.com/questions/62783909/matplotlib-set-data-not-showing-a-line import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.gridspec as gridspec #initial grid size with 3rows and 1 column gs = gridspec.GridSpec(3, 1) plt.close('all') plt.ion() fig = plt.figure(figsize=(10, 12)) fig.suptitle(f'Overall plot name', .. 2022. 10. 17.
[leetcode] 20. Valid Parentheses 20. Valid Parentheses Easy 6619269Add to ListShare Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. Example 1: Input: s = "()" Output: true Example 2: Input: s = "()[]{}" Output: true Exa.. 2021. 1. 22.
[Python][PySerial] ModuleNotFoundError : No module name 'serial' issue solve 문제 해결 파이썬에서 pip install 오류 현상과 해결 방법 Envinronment 윈도우7/32비트 파이썬 3.x 컴포트, serial 통신 프로그램을 하나 짜려고 하다 발견했다. AT 커맨드를 폰에 날려서 폰을 컨드롤 하기 위한 것이다. 검색 후 PySerial 모듈을 이용하여 짜보려고 아래와 같이 간단히 짰다. 아래 코드의 동작 여부는 모르지만 첫 줄 부터 에러가 떴다. import serial print("hello") ser = serial.Serial() ser.port='COM22' ser.baudrate=115200 print(ser) ser.open() ser.isOpen() print(ser.isOpen()) print("bye") pip install 에러내용 Traceback (most .. 2018. 8. 30.
반응형