Skip to content

Conversation

@tyeth
Copy link

@tyeth tyeth commented Oct 25, 2025

When doing testing on the USB workflow, I didn't see output from the code when using Save + Run button unless I was editing code.py (the code branches according to filename, restarting if code.py otherwise running in RAW mode).

This just outputs the fact import is being called, and the result being printed, then the standard "Code done running." in case there is no output from the code.

It's also worth noting that there is a 15second timeout default when calling runCode, so that might want to be raised to infinity or something to allow code to continue to run. Issue there is we wouldn't see the output until it finishes (or at least that's my assumption)

@tyeth
Copy link
Author

tyeth commented Oct 25, 2025

Tested with a file called c1.py, containing print(1), and another called 1.py (print helloworld2) which doesn't output anything due to the bad filename for importing (half expected an import error to be returned by runCode but it's an empty string).

@tyeth
Copy link
Author

tyeth commented Oct 27, 2025

In relation to this comment by Scott, #399 (comment), it maybe makes more sense to use supervisor.set_next_code_file (docs), with the users file path (maybe also setting working directory), and then do a supervisor.reload.
You still wouldn't get boot.py running first, and usb drive would be as initially configured, but it would be more like the user expected. I think probably not the sticky argument though, so errors are shown and break to repl (presumably ctrl-d wouldn't rerun their file and instead do reload and run code.py).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant