728x90
반응형
Python Command Flag
python -c
- (command) 직접 명령어를 입력해 Python 코드를 실행 ex) python -c "import pandas as pd"
python -m
- (module) Python 모듈을 스크립트로 실행. ex) 'python -m http.server' 현재 디렉토리에서 HTTP 서버 실행
python -i
- (interactive) 스크립트 실행 후 대화형 모드로 진입 ex) 스크립트 실행 후 interpreter로 진입
python -O
- (Optimize) 최적화 모드를 활성화, assert문을 제거하고 `__debug__`를 'False'로 설정
python -B
- (bytecode) .pyc 파일을 생성하는 것을 방지. 보통 개발 중에 임시 파일 생성을 원치 않을 때 사용
python -u
- (unbuffered) 표준 입출력의 버퍼링을 비활성화. 로그나 결과를 실시간으로 보고 싶을 때 유용
python -v
- (version) python 버전 정보 출력.
python -E
- (ignore environment) Python이 환경 변수의 영향을 받지 않도록함.
python -S
- (no site) Python 시작 시 'site' 모듈을 불러지 않는다. Path와 env 변수 확인을 건너뜀
python -s
- (no user site) 사용자 정의 사이트 패키지 디렉토리를 무시. 환경 설정을 배제하고 싶을때 유용
python -W
- (ignore warnings) warnings 출력을 무시.
반응형
'Python' 카테고리의 다른 글
FastAPI - starlette.routing.NoMatchFound: No route exists for name (0) | 2024.01.19 |
---|---|
[pip] WARNING: Skipping due to invalid metadata entry 'name' (0) | 2023.12.30 |
[Pytest] ERROR: file or directory not found (0) | 2023.12.13 |
[pipx] python 전역 패키지관리 pipx (0) | 2023.11.29 |
[mandelbrot set] 망델브로 집합 (0) | 2023.11.19 |