I couldn't find this issue addressed anywhere. I think it may be a "feature" of the new beta of Mu. I get the message 'You cannot use the filename "code.py" This name is already used by another part of Python. If you use that name, things are likely to break. Please try again with a different filename.'
One possibility: I have other versions of Python installed on my PC.
Is there something I'm missing? Thanks.
Mu blocks writing code.py
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Mu blocks writing code.py
Try renaming the file.
Python, like most interpreted languages, has a dynamic runtime.. it loads resources from the filesystem as need demands. Apparently some piece of the system is named 'code.py', and that name conflict could make things go sideways.
Python, like most interpreted languages, has a dynamic runtime.. it loads resources from the filesystem as need demands. Apparently some piece of the system is named 'code.py', and that name conflict could make things go sideways.
- Catbar
- Posts: 15
- Joined: Fri Jul 13, 2018 6:14 pm
Re: Mu blocks writing code.py
Yes, I'd already done the renaming via Mu, and then changed it on the Circuit Playground Express and that works. For now, that will have to do, I guess. Thanks.
- Catbar
- Posts: 15
- Joined: Fri Jul 13, 2018 6:14 pm
Re: Mu blocks writing code.py
I tried using storage.erase_filesystem() and now I don't have the issue. I have no idea what I did to get it in the first place.
Thanks, Brian
Thanks, Brian
- flybob
- Posts: 26
- Joined: Fri Dec 27, 2013 12:16 pm
Re: Mu blocks writing code.py
There appears to be an error in the tutorial here (https://learn.adafruit.com/welcome-to-c ... iting-code). Tutorial asks you to save the program as "code.py" This will generate an error. Instead save the program as "main.py" and you will be good to go.
- ntollervey
- Posts: 5
- Joined: Sun Jul 15, 2018 9:19 am
Re: Mu blocks writing code.py
Hi, I created and maintain Mu.
Sorry to hear you're having problems. You're right to summarise it's down to the "shadow module" checking. I'll fix this up in the Adafruit mode for the next release (which should arrive tomorrow).
Thanks,
N.
Sorry to hear you're having problems. You're right to summarise it's down to the "shadow module" checking. I'll fix this up in the Adafruit mode for the next release (which should arrive tomorrow).
Thanks,
N.
- ntollervey
- Posts: 5
- Joined: Sun Jul 15, 2018 9:19 am
Re: Mu blocks writing code.py
Hi,
Just a quick FYI. The issue was logged in Mu and fixed this afternoon here:
https://github.com/mu-editor/mu/issues/554
It'll be in the next release.
Thanks for the feedback. :-)
N.
Just a quick FYI. The issue was logged in Mu and fixed this afternoon here:
https://github.com/mu-editor/mu/issues/554
It'll be in the next release.
Thanks for the feedback. :-)
N.
Please be positive and constructive with your questions and comments.