728x90 반응형 파이썬80 파이썬 - pip "error: externally-managed-environment" 문제 해결 sudo rm /usr/lib/python3.11/EXTERNALLY-MANAGED 출처: https://velog.io/@dongju101/error-externally-managed-environment-%EB%AC%B8%EC%A0%9C-%ED%95%B4%EA%B2%B0 error: externally-managed-environment 문제 해결다음 명령어 입력시 해결 가능velog.io 2024. 8. 10. 셀레니움 - 요소 가운데로 스크롤하기 element = driver.find_element_by_xpath('//*[text()="사용감 없음"]')scrollElementIntoMiddle = "var viewPortHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);"\ + "var elementTop = arguments[0].getBoundingClientRect().top;"\ + "window.scrollBy(0, elementTop-(viewPortHeight/2));";\driver.execute.. 2024. 5. 23. PIL - 이미지 회전 현상 해결 방법 원인 및 해결 EXIF의 방향 태그가 원인, 해결 방안으로 ImageOps.exif_transpose()로 EXIF 방향 태그 제거 from PIL import Image, ImageOps im = Image.open("file.jpg") im = ImageOps.exif_transpose(im) https://stackoverflow.com/questions/4228530/pil-thumbnail-is-rotating-my-image https://pillow.readthedocs.io/en/latest/reference/ImageOps.html#PIL.ImageOps.exif_transpose https://yjs-program.tistory.com/272 https://github.com/pytho.. 2024. 4. 20. 네트워크 보안 - NAC 우회 관련 Cheat Sheet https://redteam.coffee/woot/nac-bypass-cheatsheet NAC Bypass Cheatsheet | Ikigai This post lists down a few of the techniques which can be used to bypass Network Access Control solutions(NAC). redteam.coffee macchanger macchanger -m XX:XX:XX:XX:XX:XX randommac.py #!/usr/bin/python import subprocess import sys import threading import time class MyThread (threading.Thread): die = False def __init_.. 2024. 3. 28. 셀레니움 - 새 탭 열기 & 새 창 열기 driver.switch_to.new_window('tab') driver.switch_to.new_window('window') 2023. 10. 5. 파이썬 - url로부터 이미지 다운로드(urllib.request) import urllib.request urllib.request.urlretrieve(img_url, f'./cache/images/' + str(idx) + '.png') 2023. 8. 25. 알고리즘 - 파일 1회 최대 업로드 제한 횟수 분할 해서 보내기 예시) 1. 한 번에 올릴 수 있는 이미지가 20개라면 -> 이미지를 20개씩 나누어서 올리기 2. 이미지가 43개라면 20개 업로드 나머지 20개 업로드 나머지 3개 업로드 imgs = [i for i in range(1, 43+1)] UPLOAD_LIMIT_COUNT = 20 siz_start = 0 for i in range(1,100): siz_end = UPLOAD_LIMIT_COUNT*i if len(imgs[ siz_start : ]) > UPLOAD_LIMIT_COUNT: print("divide upload", imgs[ siz_start : siz_end ], len(imgs[ siz_start : siz_end ])) siz_start+=UPLOAD_LIMIT_COUNT else: p.. 2023. 8. 17. 알고리즘 - 연속적인 수열인지 확인하기 예시) 1~8개의 숫자로 이루어진 체크 박스가 있으며 체크를 할 때는 연속적인 숫자 나열이어야 함 (올바른 예시: 1, 2, 3, 4) (틀린 예시: 1, 3, 4) def checkSerialCheckBox(): time_checkBoxes = [] if checkbox_time1_var.get() == "on": time_checkBoxes.append(1) if checkbox_time2_var.get() == "on": time_checkBoxes.append(2) if checkbox_time3_var.get() == "on": time_checkBoxes.append(3) if checkbox_time4_var.get() == "on": time_checkBoxes.append(4) if ch.. 2023. 8. 15. Tkinter - CustomTkinter, pyinstaller 빌드 후 blue.json 에러 해결 방법 pyinstaller -F --collect-all customtkinter -w --collect-all customtkinter 옵션을 추가한다. 출처: https://stackoverflow.com/questions/75872305/how-to-get-the-correct-path-to-a-json-file-from-the-customtkinter-module How to get the correct path to a json file from the customtkinter module I made my GUI using customtkinter. I used auto-py-to-exe to make it an file. The exe file doesn't open because of an th.. 2023. 8. 13. Tkinter - 현대적인 UI 디자인 CustomTkinter CustomTkinter 설치 명령어 pip install customtkinter 깃허브 주소 https://github.com/TomSchimansky/CustomTkinter GitHub - TomSchimansky/CustomTkinter: A modern and customizable python UI-library based on Tkinter A modern and customizable python UI-library based on Tkinter - GitHub - TomSchimansky/CustomTkinter: A modern and customizable python UI-library based on Tkinter github.com CustomTkinter 공식 사이트(Doc.. 2023. 8. 13. 파이썬 - 텔레그램 API 사용자 아이디 및 정보 가져오기 https://api.telegram.org/bot{bot_api_key}/getUpdates {"ok":true,"result":[{"update_id":000000000, "message":{"message_id":00,"from":{ "id":0000000000, "is_bot":false, "first_name":"ABC", "username":"ABC", "language_code":"ko"},.. 2023. 8. 1. 파이썬 - 스크립트 파일 실행 도중 인터랙티브 모드로 전환하기 import code def interactive_function(): # 스크립트 실행 중간에 인터랙티브 모드로 전환 console = code.InteractiveConsole(locals=globals()) console.interact("인터랙티브 모드로 전환합니다.") print("스크립트 실행 중...") # 스크립트 실행 로직 # 중간에 인터랙티브 모드로 전환 interactive_function() 2023. 7. 29. 이전 1 2 3 4 ··· 7 다음 728x90 반응형