import os
command = input("명령을 입력하시오: ")
if command == "shutdown":
print("컴퓨터가 곧 종료됩니다. 엔터키를 누르세요")
input()
os.system("shutdown /s /t 1")
elif command == "cwd":
cwd = os.getcwd()
print("Current working directory: ",cwd)
else:
print("알수없는 명령어입니다.")
>> 명령을 입력하시오: cwd
>> Current working directory: C:\Users\Admin\Desktop\ddah
728x90
'Programming > Python' 카테고리의 다른 글
[Python] 파이썬 print 출력 함수 종류 (0) | 2024.01.29 |
---|---|
[Python] 문자열 길이 반환 함수 len() (0) | 2024.01.15 |
[Python] 논리연산자 Boolean Operator (0) | 2024.01.10 |
[Python] turtle input 입력함수, write 사용 (0) | 2024.01.10 |
[Python] 조건문 if? else if? elif? else? (0) | 2024.01.10 |