"OS 확인"의 두 판 사이의 차이

 
5번째 줄: 5번째 줄:
<syntaxhighlight lang='java' run>
<syntaxhighlight lang='java' run>
public class MyClass {
public class MyClass {
     public static void main(String [] args) {
     public static void main(String[] args) {
         System.out.println( System.getProperty("os.name") ); // Linux
         System.out.println( System.getProperty("os.name") ); // Linux
         System.out.println( System.getProperty("os.arch") ); // amd64
         System.out.println( System.getProperty("os.arch") ); // amd64

2021년 5월 12일 (수) 17:38 기준 최신판

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 }}