I am using python to populate a table with the file pathways of a number of stored files. However the pathway needs to have the full network drive computer name not just the drive letter, ie
//ComputerName/folder/subfolder/file
not
P:/folder/subfolder/file
I have investigated using the win32api, win32file, and os.path modules but nothing is looking like its able to do it. I need something like win32api.GetComputerName()
but with the ability to drop in a known drive letter as an argument and it return the computer name that is mapped to the letter.
So is there anyway in python to look up a drive letter and get back the computer name?
socket.gethostname()
appears to do exactly the same thing aswin32api.GetComputerName()
in that it returns the name of the local computer I need to be able to return the name of a mapped network drive.uname
does not appear to exist as an object in theos
module. – Allin