1

I have created an exe using pyinstaller.

In which I want to know the size of the SSD and HDD which are installed in the users system.

expected output in the below format { "hdd_size": "1.8TB", "sdd_size": "476GB" } How can I get these informations?

  • Well the *duplicate* does not say a word about which disks are installed... If you need that `psutil.disk_partitions()` will give it to you. – Serge Ballesta Feb 04 '22 at 10:02

1 Answers1

1

if u want to know the size of the disk, u can try this lib (psutil) i think psutil may help u

import psutil
disk_usage = psutil.disk_usage("C:\\")
ItsIvanPsk
  • 11
  • 1
  • @itslvanpsk i have used psutil but it always give me a size of ssd not hdd. is there any way to find a data in below format using python. {"hdd_size":"1.8TB","ssd_size":"476GB"} – Suraj Rajesh Gupta Feb 04 '22 at 18:26
  • If the return is an dict you can pick it up, try to save this '{"hdd_size":"1.8TB","ssd_size":"476GB"}' into a dict and use 'print(dict_name["hdd_size"])' I think this will resolve your problem – ItsIvanPsk Feb 15 '22 at 10:28
  • @ItslvanPsk using psutil i can find the size but how will i determine whether drive is ssd or hdd drive. – Suraj Rajesh Gupta Feb 25 '22 at 11:08