.. link: http://dgplug.org/summertraining/2013/posts/iamsudip-mount-v3-20130711-091255.html .. description: .. tags: .. date: 2013/07/11 09:12:56 .. title: iamsudip mount v3 20130711-091255 .. slug: iamsudip-mount-v3-20130711-091255 mount v3 ======== In this assignment we will display the contents of *mounts* file which is located in /proc directory :: listing `mount.py `_:: #!/usr/bin/env python f=open("/proc/mounts") #Opening the mounts file. def func(inp): #Function to separate ine inputs a, b, c, d, e, f=inp #Separating inputs as different words return "%s on %s type %s (%s)" % (a, b, c, d) #Returning the value as user need for x in f: #Iterating through each line s=x.split(" ") #Spliting words ie using spaces print func(s) #Calling func(inp) Printing return value f.close() #Closing the file **Hint**: Run the above program like:: $ python mount.py or:: $ chmod +x mount.py $ ./mount.py