萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> php編程 >> python獲取當前系統的桌面的路徑

python獲取當前系統的桌面的路徑

也需要win32擴展,原理不懂

from win32com.shell import shell, shellcon
def GetDesktopPath():
    ilist = shell.SHGetSpecialFolderLocation(0, shellcon.CSIDL_DESKTOP)
    return shell.SHGetPathFromIDList(ilist)

copyright © 萬盛學電腦網 all rights reserved