Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Volume label
#4
Ok, close, but I get an error:
Output:
AttributeError: module 'os' has no attribute 'statvfs'
Even in Python 3.12 it does not.
I see os.statvfs_result(), but that takes many more arguments.
In python 3.12 this works:
for drive in  os.listdrives():
but only for drive letters, I don't seem to be able to get the volume labels.
But if you have the drive letters, you can think of many workarounds to get the desired result.
Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply


Messages In This Thread
Volume label - by DPaul - Apr-22-2024, 03:10 PM
RE: Volume label - by DPaul - Apr-23-2024, 02:23 PM
RE: Volume label - by SandraYokum - Apr-24-2024, 01:07 PM
RE: Volume label - by DPaul - Apr-24-2024, 03:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Ideas for determine the volume of rotating object Lardos 2 2,572 Apr-05-2019, 04:47 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020