- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to get a file system information using Python?
The os module has the uname function to get information about the os & version:
>>> import os >>> os.uname()
But this can only be used for recent *NIX flavours. To get a more cross platform solution, use the platform module:
>>> import platform >>> import platform >>> platform.machine() 'AMD64' >>> platform.version() '10.0.15063' >>> platform.platform() 'Windows-10-10.0.15063-SP0' >>> platform.uname() uname_result(system='Windows', node='DESKTOP-N0VDLO7', release='10', version='10.0.15063', machine='AMD64', processor='Intel64 Family 6 Model 69 Stepping 1, GenuineIntel') >>> platform.system() 'Windows' >>> platform.processor() 'Intel64 Family 6 Model 69 Stepping 1, GenuineIntel'
- Related Articles
- How to get the system configuration information relevant to an open file using Python?
- How to get stat of a file using Python?
- How to retrieve specific file(s) information using Get-ChildItem in PowerShell?
- C# Program to get information about a file
- How to get system data directory information in android?
- Passing Information using GET method in Python
- How to get creation and modification date/time of a file using Python?
- How to get the maximum file name length limit using Python?
- How to get complete drive information using C#?
- How to get the disk information using PowerShell?
- How to rename a file using Python?
- How to delete a file using Python?
- How to remove a file using Python?
- How to find a file using Python?
- How can I get a file's permission mask using Python?

Advertisements