问题
I'm using the following code to open a dialog box to a specific folder. It is currently displaying all .jpg files. How do I make it show all files?
path = system.file.openFile('jpg', 'J:\FULLSAIL\Historian')
if path != None:
回答1:
The documentation says that you can specify the file extension, for instance “jpg”.
Since it probably uses glob.glob function to filter the files list, you can try with “*” to have no filtering and get all the files.
The documentation also says that the extension is an optional parameter, so you can try:
system.file.openFile(r”J:\FULLSAIL\Historian”)
回答2:
Ignition's support team said to use the following script.
path = system.file.openFile(None,'J:\FULLSAIL\Historian')
I tested and it seems to work exactly like I was hoping. One note, the term None must be have the first N capitalized, I first tried none and the system did not recognize the cmd. Thank you all for your help.
来源:https://stackoverflow.com/questions/53662197/how-to-view-all-files-within-a-folder-using-openfile