pxt icon indicating copy to clipboard operation
pxt copied to clipboard

Fix Python Preferred Editor for Tutorials

Open thsparks opened this issue 2 years ago • 0 comments

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

thsparks avatar Aug 12 '22 22:08 thsparks