472,096 Members | 1,364 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,096 software developers and data experts.

Re: Getting Linux partition info programmatically

python dev wrote:
Hello everyone,

I am trying to get a list of all the partitions (along with their respective
file system types) listed in the /media directory. Does anybody know if
there is a way to do this using Python, or do I have to get this information
by parsing the output of a Linux command?
The /sys and /proc file system provide all the information you need:

for line in open("/proc/mounts"):


Sep 12 '08 #1
0 1251

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by cantabile | last post: by
reply views Thread by Rvk | last post: by
6 posts views Thread by Bill Mill | last post: by
5 posts views Thread by sameer_deshpande | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.