프로그래밍/python23 python cv2 로 이미지 파일 열기 우선 .py 파일과 이미지 파일이 같은 폴더 안에 있다고 가정을 하였습니다. import cv2 import os dir_path = os.path.dirname(__file__) cur_paht = os.path.join(dir_path, "ddat.jpg") # ddat.jpg 는 사진파일의 이름입니다. img = cv2.imread(cur_paht) cv2.imshow("ddatG", img) cv2.waitKey() cv2.destroyAllWindows() 키가 눌리게 되면 이미지 파일이 닫히게 됩니다. 2022. 1. 12. python while 문 while 사용법 while True: print("hello") 을 사용하게 되면 무한하게 hello 라고 출력이 됨 count = 0 while True: count += 1 print(count) if count > 100: break count가 100이상 일시 탈출 할 수 있게 break를 걸어줌으로써 무한 반복문을 탈출하게 됨 2022. 1. 12. 파이썬 반복문 for x in ragne(5): print(x) 출력 결과 0 1 2 3 4 2021. 11. 25. 파이썬 빌드(exe파일) 파이썬 인스톨러를 다운 윈도우+R -> cmd pip install pyinstaller 빌드 pyinstaller [변환할 파일] - 옵션들 이런식 pyinstaller temp.py -w --onefile 2021. 11. 17. pyside ui to py pyside6를 이용하여 UI 파일을 py파일로 변경하는 방법 pyside6-uic [파일이름.ui] -o [저장할파일이름.py] 2021. 11. 16. 이전 1 2 3 4 다음 반응형