Is there an equivalent to the "os.listdir()" method using the PyObjC library? I want to list all of the files in a directory.
I am making my python script into an executable using PyInstaller. There is a known issue where some of the "os" functionality cannot be used when launching the app in MacOS.
I found this method in the Foundation framework which seems like it would work, but I have not been able to convert it into the right PyObjC syntax (see error below).
NSFileManager.defaultManager().contentsOfDirectoryAtPath_('/Users/eturner/Desktop', true)
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
NSFileManager.defaultManager().contentsOfDirectoryAtPath_('/Users/eturner/Desktop', true)
AttributeError: 'NSFileManager' object has no attribute 'contentsOfDirectoryAtPath_'