I am trying to save data in a file through a Tkinter app. If the file already exists and is currently open by another application, I can, of course, not write on it but I would like to inform the user that the file is open somewhere else.
In Python Console (Spyder), I receive the following message:
Exception in Tkinter callback
[...]
File "MyFile.py", line 200, in plot_data_save_file
file=open(file_name,"w")
PermissionError: [Errno 13] Permission denied: "FileToSaveDataIn.xy"
I know how to create a Tkinter messagebox but how can I know if Python Console raised the error and pass this information to Tkinter?