how to get window diks with python?
- User
how to get window diks with python?
- Assistant
In Python, you can use the built-in
osmodule to interact with the operating system, including accessing disk information. Here's a simple script to list all mounted disk partitions information:import os import shutil def get_disk_info(): total, used, free = shutil.disk_usage("/") print("Total: %d GiB" % (total // (2**30))) print("Used: %d GiB" % (used // (2**30))) print("Free: %d GiB" % (free // (2**30))) get_disk_info()
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.