Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

get os information python

>>> import platform
>>> platform.platform()
'Linux-3.3.0-8.fc16.x86_64-x86_64-with-fedora-16-Verne'
Comment

get os info in python

import platform
import sys

def linux_distribution():
  try:
    return platform.linux_distribution()
  except:
    return "N/A"

print("""Python version: %s
dist: %s
linux_distribution: %s
system: %s
machine: %s
platform: %s
uname: %s
version: %s
mac_ver: %s
""" % (
sys.version.split('
'),
str(platform.dist()),
linux_distribution(),
platform.system(),
platform.machine(),
platform.platform(),
platform.uname(),
platform.version(),
platform.mac_ver(),
))
Comment

PREVIOUS NEXT
Code Example
Python :: python reduce() 
Python :: pandas add column with constant value 
Python :: n-largest and n-smallest in list in python 
Python :: how do i print a list line by line in python 
Python :: Simple pagination wrapper for discord.py. 
Python :: python make sound when finished 
Python :: print textbox value in tkinter 
Python :: concatenate dataframes 
Python :: docx change font python 
Python :: how to check if given number is binary in pytho 
Python :: python dictonary of dictonary 
Python :: install virtual environment python mac 
Python :: ym ip 
Python :: how to print time python 
Python :: save a torch tensor 
Python :: pandas delete spaces 
Python :: relu function python 
Python :: round down python 
Python :: print subscript and superscript python 
Python :: how to get input from list in python 
Python :: python remove element from list 
Python :: random python 
Python :: string to float python 
Python :: replace value in dataframe 
Python :: python requests post 
Python :: pickle load pickle file 
Python :: using df.astype to select categorical data and numerical data 
Python :: Replace the string with NAN value 
Python :: plot sphere in matplotlib 
Python :: numpy sort array by another array 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =