shaliniroy Mount 20130711-125510


Posted:

The assignment was to write a python program that execute the same output as we type mount command in the terminal.

The python program can be executed by using:-

$ python mount.py

or

$ chmod +x mount.py
$ ./mount.py

The coded program is given at the link

Explanation of the code

f = open("/proc/mounts")

This line open the file /proc/mounts


for x in f:

This line iterate through each line.


print x,

This line print the file.


f.close()

This line close the opened file.
Contents © 2013 dgplug - Powered by Nikola
Share
UA-42392315-1