Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

testShellFolder.py 582B

1 year ago
123456789101112131415161718192021
  1. from win32com.shell import shell
  2. from win32com.shell.shellcon import *
  3. sf = shell.SHGetDesktopFolder()
  4. print("Shell Folder is", sf)
  5. names = []
  6. for i in sf: # Magically calls EnumObjects
  7. name = sf.GetDisplayNameOf(i, SHGDN_NORMAL)
  8. names.append(name)
  9. # And get the enumerator manually
  10. enum = sf.EnumObjects(0, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN)
  11. num = 0
  12. for i in enum:
  13. num += 1
  14. if num != len(names):
  15. print("Should have got the same number of names!?")
  16. print("Found", len(names), "items on the desktop")
  17. for name in names:
  18. print(name)