OS 확인

Jmnote (토론 | 기여)님의 2021년 5월 12일 (수) 17:38 판 (→‎Java)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 Java[ | ]

public class MyClass {
    public static void main(String[] args) {
        System.out.println( System.getProperty("os.name") ); // Linux
        System.out.println( System.getProperty("os.arch") ); // amd64
        System.out.println( System.getProperty("os.version") ); // 5.4.0-56-generic
    }
}

2 Python[ | ]

import platform
print( platform.system()   ) # Linux
print( platform.platform() ) # Linux-5.4.0-56-generic-x86_64-with-glibc2.2.5
print( platform.release()  ) # 5.4.0-56-generic
print( platform.version()  ) # #62-Ubuntu SMP Mon Nov 23 19:20:19 UTC 2020
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}