title: .py won't open when double clicked at first, BUT opens when I already have IDLE shell open
body: <p>Heyy guys, I have a problem with opening .py files on mac. So if I just double click on the file, this error message pops up &quot;The document XXX could not be opened. IDLE cannot open files in the “Python Script” format.&quot; <a href="https://i.stack.imgur.com/p0NKY.png" rel="nofollow noreferrer">1</a></p>
  <p>HOWEVER, if I open a python shell first from my application list. Then I can open the file by double clicking on it directly.</p>
  <p>It seems that as long as there's a python shell open (empty new session or another opened file), the double clicking works. Otherwise it does not. I am using python 3.10 and Mac Big Sur 11.6.</p>
  <p>Any idea what's wrong and how to fix it?</p>