본문 바로가기
Python

[Python] 사용자와 상호작용: 입력받기: input, argv, and sys

by ds31x 2024. 7. 24.

input() 함수 사용하기

2023.10.10 - [Python] - [Python] input 함수 사용하여 사용자 입력받기.

 

[Python] input 함수 사용하여 사용자 입력받기.

Python의 input() 함수는표준 입력 스트림(stdin)으로부터 데이터를 입력받는 함수 Terminal에서 수행되는 CLI (Command Line Interface) 프로그램은입력을 stdin (표준 입력, standard input)에서 받아드리고출력은 s

ds31x.tistory.com


sys.argv 사용하기

2023.09.25 - [Python] - [Python] sys 모듈

 

[Python] sys 모듈

sys 모듈은interpreter에 의해 사용되거나 유지되는 variables와interpreter와 밀접(interpreter 종료 등)하게 관련된 functions에대한 access를 제공함. 주로 많이 이용되는 attributes는 다음과 같음.sys.argvPython scri

ds31x.tistory.com


Example

2023.10.10 - [Python] - [Python] Example: input, sys.argv and argparse

 

[Python] input, sys.argv and argparse

이자율과 만기(해당 만기 기준의 이자율)을 주고, 해당 만기 이자율을 기반으로 일복리로 계산한 경우와 연단리로 계산한 경우를 비교하는 예제임. 입력받는 정보는 원금 이자율(년) 만기(지정

ds31x.tistory.com


다른 모듈 이용하기

argparse 이용하기

https://dsaint31.tistory.com/477

 

[Python] argparse 사용하기.

Python에서 기본적으로 제공하는 명령어 인자 파서 모듈이다. command line inerface 으로 프로그램을 만들 때 기본적으로 필요하다. linux 쪽 경험이 풍부한 이들에겐 getopt가 보다 익숙하지만 그런 사람

dsaint31.tistory.com

getopt 이용하기

작성예정


같이보면 좋은 자료들

2023.10.06 - [분류 전체보기] - [Python] Python 정리

 

[Python] Python 정리

Programming Language and Python 소개2023.10.23 - [Python] - [Python] Programming Language and Introduction of Python. [Python] Programming Language and Introduction of Python.Computer and Program https://dsaint31.tistory.com/436 [CE] Computer and Progra

ds31x.tistory.com