pxt
pxt copied to clipboard
Fix Python Preferred Editor for Tutorials
When Python is set as the preferred editor for a tutorial, we still end up loading the blocks editor because main.py doesn't exist at the time we try to load it.
To address this issue, if the preferred file does not exist, we can create it rather than falling back on the blocks file. We also have to update config to ensure the python files are included in pxt.json. Without that, the python script won't actually be included when the app runs, so it doesn't do anything. This was also missing inside loadTutorialTemplateCodeAsync, so I've added it there, too.
Fixes https://github.com/microsoft/pxt-arcade/issues/4892