[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to get partition information of a hard disk with python

On Wednesday, September 22, 2010 at 4:01:04 AM UTC+5:30, Hellmut Weber wrote:
> Hi list,
> I'm looking for a possibility to access the partiton inforamtion of a
> hard disk of my computer from within a python program.
> Googling I found the module 'parted' but didn't see any possibility to
> get the desired information.
> Is there any reasonable documentation for the parted module?
> Any idea is appreciated ;-)
> Hellmut
> -- 
> Dr. Hellmut Weber         mail at hellmutweber.de
> Degenfeldstra?e 2         tel   +49-89-3081172
> D-80803 M?nchen-Schwabing mobil +49-172-8450321
> please: No DOCs, no PPTs. why: tinyurl.com/cbgq

import os
os.system("fdisk -l")
#you will get information about your hdd,partition