You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running a module mode sketch file without saving causes the setup()/settings() separation feature to fail. The error message only mentions other issues that cause this feature to fail. It would be great if we could find a way of improving this.
The things that I can think of are:
Improve the error message mentioning that another cause of the problem is the file might not yet have been saved
Detect the unsaved state of the file on the IDE and provide a different message. On Thonny print(__file__) throws a NameError if the file was never saved.
Note: On Thonny IDE, this is not an issue using the plugin that enables imported mode, because then, if the sketch was never saved, the IDE prompts the user to save the file when you hit the run button!
The text was updated successfully, but these errors were encountered:
@villares , thanks for spotting this issue and opportunity to improve py5.
It might be possible for py5 to pre-emptively detect that the setup() function's __file__ is <string> and save it to a temporary file. I'll consider this as a possibility when I work on fixing this.
Running a module mode sketch file without saving causes the
setup()
/settings()
separation feature to fail. The error message only mentions other issues that cause this feature to fail. It would be great if we could find a way of improving this.The things that I can think of are:
print(__file__)
throws aNameError
if the file was never saved.Note: On Thonny IDE, this is not an issue using the plugin that enables imported mode, because then, if the sketch was never saved, the IDE prompts the user to save the file when you hit the run button!
The text was updated successfully, but these errors were encountered: