title: How to find the inode of all files in Linux with Python?
body: <pre><code>#!/usr/bin/python    
  import os, sys
  
  # Open a file
  fd = os.open( "foo.txt", os.O_RDWR|os.O_CREAT )
  
  # Now get  the touple
  info = os.fstat(fd)
  
  print "File Info :", info
  
  # Now get uid of the file
  print "UID of the file :%d" % info.st_uid
  
  # Now get gid of the file
  print "GID of the file :%d" % info.st_gid
  
  # Close opened file
  os.close( fd)
  </code></pre>