可以使用Python中的psutil库来获取本地磁盘存储信息,并进行筛选来避免查看Athens所在的磁盘。
示例代码:
import psutil
for partition in psutil.disk_partitions(): if 'Athens' not in partition.mountpoint: disk_usage = psutil.disk_usage(partition.mountpoint) print(f"Disk: {partition.device}, Total: {disk_usage.total}, Free: {disk_usage.free}")