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

os system python

# importing os module 
import os 
  
# Command to execute
# Using Windows OS command
cmd = 'date'
  
# Using os.system() method
os.system(cmd)
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 :: odoo scaffold command 
Python :: how change column strin of list data type to list 
Python :: insert data in sqlite database in python 
Python :: download unsplash images python no api 
Python :: python remove by index 
Python :: django url with string parameter 
Python :: python how to get data from dictionary 
Python :: reportlab python add font style 
Python :: openpyxl get value from readonly cell 
Python :: python garbaze collection 
Python :: how to handle missing values in dataset 
Python :: python sqrt 
Python :: Create an array of 10 zeros 
Python :: python slicing 
Python :: data must be 1-dimensional pd.dataframe 
Python :: docker opencv python libGL.so.1: cannot open shared object file: No such file or directory 
Python :: python programm zu exe 
Python :: python find if strings are anagrams 
Python :: csv manipulation python 
Python :: how to make a window python 
Python :: word counter python 
Python :: pandas pivot table 
Python :: how to make a key logger 
Python :: lambda in python 
Python :: google assistant in windows 10 
Python :: get mode using python 
Python :: pandas create average per group 
Python :: Identify Null and NAN python 
Python :: while True: 
Python :: pyttsx3 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =