Message278141
| Author |
paul.moore |
| Recipients |
paul.moore, radialbeast, steve.dower, steven.daprano, tim.golden, zach.ware |
| Date |
2016年10月05日.17:25:59 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1475688359.34.0.628453055682.issue28365@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I can recreate this (based on the screenshots from #28366).
To reproduce, open IDLE. You get the console banner and prompt. Save that file using File-Save. The close IDLE. Reopen it, do File-Open to open your saved console session, then use the "Run" menu to run it. (You need to close IDLE, so it "forgets" the .py file came from a console session.)
That's incorrect usage, of course (not "of course" to the OP - that's the real point here) as the text of a console session isn't a valid Python file, and doesn't syntax check. The error is saying precisely that - what is in the file isn't valid Python.
So in one sense, this is simply user error. But I wonder, is there something about how IDLE presents things that could be improved? Either in the documentation or in the UI? I'm not exactly sure what the point of "file-save" in a console window is, and certainly it would be better to save the transcript as text so it couldn't be inadvertently be read back in as a Python module.
I'm not an IDLE user, though, so I don't really have the background to know the best solution. |
|