본문 바로가기
python 큐의 에서 put과 put_nowait에 대해서 Python 멀티프로세스 큐: put() vs put_nowait() 언제 써야 할까?Python의 multiprocessing.Queue를 사용할 때 작업을 큐에 넣는 방법으로 put()과 put_nowait() 두 가지가 있습니다. 비슷해 보이지만 각각 동작 방식과 적합한 상황이 다릅니다. 이번 포스트에서는 두 메서드의 차이점, 선택 기준, 그리고 실제 서버 코드 예시를 통해 상세히 알아보겠습니다.출처: https://lifesoon.tistory.com/581. put()와 put_nowait()의 차이▶️ put(item, block=True, timeout=None)기본적으로 큐가 가득 차면 대기합니다(blocking).timeout을 설정하면 지정된 시간만큼 기다렸다가 실패하면 Full 예외 .. 2025. 3. 18.
Python에서 리스트 선언: list() vs [] 🤔 Python에서 리스트를 선언할 때 두 가지 방법을 자주 사용하시죠:1️⃣ mylist = list()2️⃣ mylist = []두 방식 모두 같은 결과를 내지만, 가독성, 성능, 유지보수성 측면에서 약간의 차이가 있어요. 각각의 특징을 살펴보고 어떤 상황에서 어떤 방법을 쓰면 좋을지 이야기해 볼게요! 😊[출처]https://lifesoon.tistory.com/57✅ mylist = [] (리터럴 방식)리스트를 선언할 때 가장 간단하고 직관적인 방법입니다. Python 개발자들이 제일 많이 사용하는 방식이기도 하고요.장점간결함: 코드가 짧고 한눈에 이해하기 좋아요.mylist = []일관성 있음: 딕셔너리는 {}, 집합은 set()처럼 Python 자료형의 기본 초기화 방식과 헷갈리지 않아요.성능이 .. 2024. 12. 5.
vmware nogui 실행 VMware Workstation 17.5에서 특정 VM을 명령어로 실행할 때 발생할 수 있는 다양한 오류 상황과 해결 방법을 정리해 보았습니다. 특히 Ubuntu 환경에서 발생하는 이슈들을 중심으로 설명해 드릴게요. 😊출처: https://lifesoon.tistory.com/561. 오류 상황 ⚠️$ vmrun -T ws start /home/username/path_to_vm/YourVM.vmxWarning: program compiled against libxml 212 using older 209Error: Cannot launch the UI because no display server is present in the current environment이 오류 메시지는 GUI 환경을 찾을 .. 2024. 11. 11.
Python Exception Handling vs Conditional Statements: Which One is Faster? 🚀 Python Exception Handling vs Conditional Statements: Which One is Faster? 🚀When working with dictionary values in Python, a common question is whether using exception handling (KeyError) or a conditional statement (if key in dict) is more efficient. 🧐 This topic is particularly relevant for developers dealing with large-scale data processing. In this post, we'll examine the performance differe.. 2024. 11. 7.