Getting shortcut in python

How to get short file path in windows using python?

I am using the following code,

#!/usr/bin/python import os import sys fileList = [] rootdir = sys.argv[1] for root, subFolders, files in os.walk(rootdir): for file in files: fileList.append(os.path.join(root,file)) for File in fileList: print File 
+2
python windows filenames path
source share
2 answers
+1
source share
 import win32api long_file_name='C:\Program Files\I am a file' short_file_name=win32api.GetShortPathName(long_file_name) 
0
source share

All Articles