본문 바로가기

728x90

기타

[python] dns(hostname) 정보 확인 python dns(hostname) 정보 확인 socket.gethostbyname : 도메인 이름에 대한 IP 주소를 반환 socket.gethostbyname('naver.com') socket.gethostbyname_ex : 확장판(다른 이름의 리스트, 주소의 리스트를 반환) socket.gethostbyname_ex('naver.com') $ python Python 3.9.13 (main, Aug 7 2022, 01:19:39) [Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> socket.ge.. 더보기
[python] tcp 소켓 통신 python tcp 소켓 통신 code : https://github.com/madscheme/introducing-python tcp_server.py 작성 from datetime import datetime import socket address = ('localhost', 6789) max_size = 1000 print('Starting the server at', datetime.now()) print('Waiting for a client to call.') server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind(address) server.listen(5) client, addr = server.accept() data.. 더보기
[python] udp 소켓 통신 python udp 소켓 통신 code : https://github.com/madscheme/introducing-python udp_server.py 작성 from datetime import datetime import socket server_address = ('localhost', 6789) max_size = 4096 print('Starting the server at', datetime.now()) print('Waiting for a client to call.') server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) server.bind(server_address) data, client = server.recvfrom(max_size.. 더보기
[기타] 2022년 Gartner 최고의 전략적 기술 동향 2022년 Gartner 최고의 전략적 기술 동향(Gartner Top Strategic Technology Trends for 2022) [1] 성장 가속(Accelerating Growth) 부문 Trend 9: 분산형 엔터프라이즈(Distributed Enterprises) Trend 10: 통합 경험(Total Experience, TX) Trend 11: 오토노믹 시스템(Autonomic Systems) Trend 12: 제너레이티브 AI(Generative Artificial Intelligence) [2] 변화 형성(Sculpting Change) 부문 Trend 5: 컴포저블 애플리케이션(Composable Applications) Trend 6: 의사결정 지능(Decision Intell.. 더보기
[python] ModuleNotFoundError: No module named 'PIL' python ModuleNotFoundError: No module named 'PIL' 테스트 환경 $ sw_vers ProductName:macOS ProductVersion:12.5 BuildVersion:21G72 $ python --version Python 3.9.13 Module Not Found Error Traceback (most recent call last): File "/Users/.../convert_image.py", line 2, in from PIL import Image ModuleNotFoundError: No module named 'PIL' pillow(PIL) 모듈 설치 pip 명령을 사용하여 pillow(PIL) 모듈 설치 pip3 install Pillow $ .. 더보기
[python] 파이썬 로또 번호 생성기 파이썬 로또 번호 생성기 lotto_v1.py 생성 import random ### 로또 번호 생성 def lotto_numbers(): numbers = random.sample(range(1, 46), 6) numbers.sort() print(numbers) ### 로또 시행 횟수 def lotto_count(): count = int(input("시행 횟수 : ")) print("#" * 30) if 0 < count range object range(start, stop[, step]) range() : 시작(포함), 끝(제외), step(옵션) ex) range(1, 46), 6 = 시작(1), 끝(45) 실행 $ python lotto_v1.py 시행 횟수 : 1 ###############.. 더보기
python 모듈 탐색 경로 찾기 python 모듈 탐색 경로 찾기 테스트 환경 $ python --version Python 3.9.13 파이션 3.9의 sys.path 값 - 임포트할 모듈 경로 python import sys for place in sys.path: print(place) $ python Python 3.9.13 (main, Aug 7 2022, 01:19:39) [Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> for place in sys.path: ... print(place) ... /opt/homebrew/Cella.. 더보기
[기타] 코드로서의 다이어그램(Diagram as Code) 코드로서의 다이어그램(Diagram as Code) https://blog.bytebytego.com/p/diagram-as-code?fbclid=IwAR1B-4U1aOf7lssmFww7SRJ0GqMsYw8sOwIhuH0ELgYgOqOIT4ban3edJIU Diagram as Code 6 different ways to turn code into beautiful architecture diagrams blog.bytebytego.com 더보기

728x90