Sep. 24, 2012

OS Module : os.stat ( )

OS Stat

To perform a stat system call on the given path, we can use the os.stat() functionof OS. 

First import the the os module and then simply specify the path of the file that
you want to perform the system call on.

Example

Let's see an example of how to use the os.stat function
import os
print "-" * 30
print "os.stat    = status of a file 	" , os.stat('/usr/bin/vi')
print "-" * 30

Recommended Python Training – DataCamp

For Python training, our top recommendation is DataCamp.

Datacamp provides online interactive courses that combine interactive coding challenges with videos from top instructors in the field.

Datacamp has beginner to advanced Python training that programmers of all levels benefit from.

 



Read more about:
Disclosure of Material Connection: Some of the links in the post above are “affiliate links.” This means if you click on the link and purchase the item, I will receive an affiliate commission. Regardless, PythonForBeginners.com only recommend products or services that we try personally and believe will add value to our readers.