1. 버전 확인
python --version
or
python3 --version

2. 위치 이동
작업할 홈 디렉토리로 이동
cd
ls
pwd

3. 코드 작성
vi CPUandRAM.py

다음 내용 작성
import platform
import psutil
print("Process Impormation : " + platform.processor())
print("Process Architecture : " + platform.machine())
print("RAM : " + str(round(psutil.virtual_memory().total / (1024 **3))) + "GB")

파이썬 파일 실행하기
python3 CPUandRAM.py

'Operating System > Linux' 카테고리의 다른 글
[linux] 우분투에서 자바 파일 실행하기 (ubuntu, java) (0) | 2021.10.03 |
---|---|
[linux] 우분투에 jdk 설치 및 버전 확인하기 (ubuntu, openjdk) (0) | 2021.10.03 |
[linux] 우분투에 파이썬으로 OS정보 출력하기 (ubuntu, python, os) (0) | 2021.10.02 |
[linux] 우분투 방화벽 설정하기 포트 허용 하기 (ubuntu, ufw) (0) | 2021.10.02 |
[linux] 가상머신에 ssh 접속 안될 때 Network is unreachable (virtual box, ssh, Network is unreachable) (0) | 2021.10.02 |
1. 버전 확인
python --version
or
python3 --version

2. 위치 이동
작업할 홈 디렉토리로 이동
cd
ls
pwd

3. 코드 작성
vi CPUandRAM.py

다음 내용 작성
import platform
import psutil
print("Process Impormation : " + platform.processor())
print("Process Architecture : " + platform.machine())
print("RAM : " + str(round(psutil.virtual_memory().total / (1024 **3))) + "GB")

파이썬 파일 실행하기
python3 CPUandRAM.py

'Operating System > Linux' 카테고리의 다른 글
[linux] 우분투에서 자바 파일 실행하기 (ubuntu, java) (0) | 2021.10.03 |
---|---|
[linux] 우분투에 jdk 설치 및 버전 확인하기 (ubuntu, openjdk) (0) | 2021.10.03 |
[linux] 우분투에 파이썬으로 OS정보 출력하기 (ubuntu, python, os) (0) | 2021.10.02 |
[linux] 우분투 방화벽 설정하기 포트 허용 하기 (ubuntu, ufw) (0) | 2021.10.02 |
[linux] 가상머신에 ssh 접속 안될 때 Network is unreachable (virtual box, ssh, Network is unreachable) (0) | 2021.10.02 |