2

I'm having a bit of trouble. When I use askopenfilename, it works perfect on Windows and Linux, but Mac seems to be giving me the finger....

Here's an example:

... (Code before all this)
def openFile(self):
    self.fileName = askopenfilename(filetypes=[("All Files", "*.*")])

... (Code after all this)

The issue is that when I click the open button I have, this method is invoked, and opens the dialog even on Mac, BUT everything in the dialog is grayed out and will not let me select any files. Why not? And how can I fix this?

1 Answer 1

7

So I figured it out. For anyone who may run into this issue, only use filetypes for systems that use file type drop menus. Since Mac does not, just don't include the filetypes tuple.

Example, check for the system running, if it's windows, use filetypes, if mac, don't include it

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.