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 :: django widgets 
Python :: how to show pandas last record 
Python :: fuzzy lookup in python 
Python :: extract text regex python 
Python :: check object attributes python 
Python :: from django.utils.translation import ugettext_lazy as _ 
Python :: get stock data in python 
Python :: find first date python 
Python :: how to cancel a input in python 
Python :: python no such file python3 
Python :: extract filename from path in python 
Python :: pandas to excel add another sheet in existing excel file 
Python :: python testing machine learning 
Python :: set python 3 as default ubuntu 
Python :: how to read multiple files in a loop in python 
Python :: plt.plot figure size 
Python :: how to copy text file items to another text file python 
Python :: pygame holding a button down 
Python :: get all files in directory python 
Python :: sum values in django models 
Python :: how to make it so we can give unlimited parameters in python function 
Python :: python gaussian elimination 
Python :: Python loop to run for certain amount of seconds 
Python :: dict.fromkeys with list as value 
Python :: replace a string in a list 
Python :: escape brackets in f string 
Python :: python csv dict reader 
Python :: pyttsx3 install 
Python :: django rest documentation 
Python :: python list iterate in 1 line 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =