## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• Jul 01 05:14
mlmiller751 commented #2274
• Jul 01 05:01
mlmiller751 commented #2274
• Jun 30 10:58
ntoll commented #2274
• Jun 29 17:41
mlmiller751 commented #2274
• Jun 29 17:37
mlmiller751 commented #2274
• Jun 29 14:24
carlosperate commented #2274
• Jun 29 14:17
ntoll commented #2274
• Jun 29 14:13
carlosperate commented #2274
• Jun 29 14:02
ntoll commented #2274
• Jun 29 12:58
lgtm-com[bot] commented #2279
• Jun 29 12:54
carlosperate edited #2279
• Jun 29 12:53
carlosperate edited #2279
• Jun 29 12:52
ntoll commented #2279
• Jun 29 12:43
carlosperate opened #2279
• Jun 29 12:41

carlosperate on pyqt6

• Jun 29 12:38
carlosperate milestoned #2278
• Jun 29 12:38
carlosperate labeled #2278
• Jun 29 12:38
carlosperate labeled #2278
• Jun 29 12:38
carlosperate labeled #2278
• Jun 29 12:37
carlosperate edited #2278
Terry King
@TerryKing
Hello Nicholas, First: many Thanks for your dedication to mu-editor! I can promise you that 100+ kids in Vermont USA will learn a lot using your work.
I am running WIN10 and mu-editor 1.1.0b7 This is ESP MicroPython Mode. Python3 Mode works great. Kids will start there.
I'd be happy to do anything I can to help now or in the future. I'm an Engineer who went Rogue at IBM and wrote code when that "Wasn't Done". I have quite a bit of Arduino and ESP32 experience and helpers who know more...
Let me know what I can do to help. Regards, Terry
Terry King
@TerryKing
Quick Question: Mu Editor for Windows: IsIt 64 Bit ONLY?? Wondering about students with older machines...
tjguk
@tjguk:matrix.org
[m]
@TerryKing: we limited our builds to 64-bit a couple of releases ago basically as a pragmatic measure. Since we ship the installers with quite a few wheels and so on, plus a static Python image, it became quite a burden. And we took the view that, by this time, even older school kit was likely to be 64-bit. It shouldn't be too difficult to build a 32-bit installer if this was an obstacle for you... assuming we can get matching wheels from the underlying libraries
Terry King
@TerryKing

@tjguk:matrix.org : Thanks for the clear reply. Hmm.. I am working with a program that will have about 150 elementary-middle school kids with no coding experience, learning Python in an online environment : example:( https://hourofpython.trinket.io/a-visual-introduction-to-python#/welcome/an-hour-of-code) That's great to start.. But I am working on a project that bridges those kids AFTER they really learn some Python, to Python3 and MicroPython(esp32) using mu. And that trinket thing charges \$3 per seat per month for Python3 and Pygame etc. OpenSourceRules!

I will try to get the first-phase of online students to tell us what their home computer hardware is. Hmm is there a good online app that will do that for an online user?? So I hope to have a better perspective on the need to a 32-bit installer. Not QuickCritical.

Thanks and let me know what you think...

Terry King
@TerryKing
Is PortaMu still available? Thinking of locked-down school computers.
Zander Brown
@zbrown:matrix.org
[m]
PortaMU really shouldn't work on such a machine
Terry King
@TerryKing
OK. but the HowTo for mu says: (https://codewith.mu/en/howto/1.1/use_portamu)
--(copy)--
"Sometimes it’s not possible to install Mu because the computers you have available are locked down by somebody else.
Perhaps you find yourself running a workshop in a library or your school’s network administrator is more likely to say “get off my lawn” than “let me help you with that”. Don’t worry, thanks to the remarkable work of 14 year old Josh Lowe, you can run Mu from a pendrive (those dongle-thingamabobs for storing files that you plug into the computer’s USB port). This technique should work on both Windows and OSX.
--(end)--
If this is really obsolete maybe it should be removed, or labelled How NOT :-)
Goose
@GooseTheCat8602
I need help. I am trying to create a class that can calculate the area, volume, and perimeter of a 3D object. The problem is, that I do not know how to make a class with multiple constructors, if that's possible. All help is appreciated.
import math

class Object:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z =z
Volume = x * y * z
print(Volume)

def area(self):
Area = self.x * self.z
print(area)

eObject = Object
Goose
@GooseTheCat8602
Update: fixed a bunch of rookie mistakes, including making area x * z. But it still won't work.
Urbain YANG
@urbainy
I can't even install mu-editor by pip.
If I follow: pip3 install mu-editor==1.1.0b7, the terminal said: Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement mu-editor==1.1.0b7
ERROR: No matching distribution found for mu-editor==1.1.0b7
If I install without the "==1.1.0b7", it will install 1.0.3. But these error message was displayed: ERROR: Could not find a version that satisfies the requirement pygame<2.0,>=1.9.2 (from pgzero)
Nicholas Tollervey
@ntoll
@urbainy due to complicated packaging reasons, you should install Mu using Python 3.8.
We have a load of users on old machines with old Python, and this 1.1 release family will be the last we release that they'll be able to use. Sadly, because they're on older Pythons then we can't update some of our dependencies to the latest versions, thus meaning Python 3.9+ might not work. The next version of Mu will drop support for the older Pythons and you should be able to use a newer version of Python. Hope this makes sense @urbainy -- it's all a balancing act for the different sorts of users we have.
@GooseTheCat8602 off the top of my head: you assign Area = self.x * self.z but then print(area) I think you should change Area to area and you'll get a result printed. Also, you may also want to just return area. When you instantiate the object it should look like this: eObject = Object(x=3, y=4, z=5) etc...
(or just eObject=Object(3, 4, 5))
Nicholas Tollervey
@ntoll
@TerryKing so,you're welcome to join the Mu developer's channel (I'll add you, please leave if you'd rather not get involved). This channel is more for support, and those of us maintaining Mu do tech discussions over in the other channel. Feel free to pick up the discussion over there. As for PortaMu - that was @JoshuaLowe1002 's thing. Josh..?
Tiago Montes
@tmontes
Chiming in WRT to possible future portable Mu: the pup based packaging process produces a ZIP-able directory, fully portable, that we can use going forward. Works on both macOS and Windows. It could be a matter of adjusting CI to ship those, too (modulo minor packaging fixes).
Terry King
@TerryKing
@tmontes Said: "Chiming in WRT to possible future portable Mu: "
THANKS! I think it would be very useful for school environments and home schoolers. I would distribute it on small USB Flashdrive I think..
I have run the current release MAC version from flashdrive on a MacBook. VERY slow but it works...
In this era, installing ANYTHING is becoming a hassle. There is so much fear of malware/ransomware in the media and online discussions.
Greg Smith

@ntoll I am running Python 3.9.7 but am encountering issues much like thos reported by @urbainy.
pip3 install mu-editor==1.1.0b7
RROR: Could not find a version that satisfies the requirement mu-editor==1.1.0b7
ERROR: No matching distribution found for mu-editor==1.1.0b7
pip3 install mu-editor
RROR: Cannot install mu-editor==1.0.0, mu-editor==1.0.1, mu-editor==1.0.2 and mu-editor==1.0.3 because these package versions have conflicting dependencies.

The conflict is caused by:
mu-editor 1.0.3 depends on matplotlib==2.2.2
mu-editor 1.0.2 depends on matplotlib==2.2.2
mu-editor 1.0.1 depends on matplotlib==2.2.2
mu-editor 1.0.0 depends on matplotlib==2.2.2

To fix this you could try to:

1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

This is with Ubuntu 21.10 64-bit, btw
Carl J. Nobile
@cnobile2012
@onshi_twitter The latest versions of MU do not run on Python 3.9, you must use 3.8 at best. On Linux, it's best to create a virtual environment so you can isolate the python version to MU.
Zack Cohen
Is there a way to stop using the ipython formatting in the Mu editor and just use standard? I was able to use it last night but since re-opening I've been locked into ipython.
e.g. "In [1]:" to ">>>"
Leon Oxer
Hi Mu friends! Is there a shortcut to switch in between the code editor and the REPL in Mu?
Terry King
@TerryKing

Hi Everyone, (NewBieAlert) Problem with page https://codewith.mu/en/tutorials/1.1/ (Shows available tutorials)..
One tutorial is "Adafruit Boards and Mu" click and see [Adafruit make a wide variety of a...]
Another tutorial is "MicroPython on ESP" Click and.. (it goes to the Adafruit tutorial).

MinorWish: The REPL tutorial is good. There are specific examples of the button bands for Python3 and Adafruit and BBC micro:bit
It WouldBeNice if there was one for the ESP Micropython REPL. :-)

Terry King
@TerryKing
Being one of those annoying RTFM people, I went looking for a Mu reference manual. So I find stuff like "Mu Documentation - Read the Docs" but that's just for developers. And of course "Tutorials - Code With Mu" which are good at one level.. And https://mu.readthedocs.io/en/latest/ again, for developers. Did I miss something??
I DID just get Nicholas' book "Programming With MicroPython" but I just started...
OK, sorry, I know this is still Beta but I am easily confused. I will now Read The Tollervey Book.
THANKS for all the work; Mu is a wonderful tool for teaching this stuff. Once I learn it.
Terry King
@TerryKing
Good morning, I did a bad bad thing... I accidentally commented out the webrepl in the boot.py and now I have zero access to the files through mu to get it back... sorry for the super stupid question, but how in the world do I fix this? I can't get into my TinyPico esp32 any other way that I know of... think of me as a super basic idiot... also I'm sure this has been asked before is there a way to search the chat.
Nicholas Tollervey
@ntoll
@Ladybrinx assuming you've backed up the code that was already on the device, just re-flash it with the MicroPython image you originally used. Everything should be reset to a clean state. Then copy your code back onto the device.
29 replies
strongdm
@strongdm:matrix.org
[m]
Excuse me guys.... How do I download the tabulate module to python
but it doesn't come through on mu
Vasco Mora
@xbecas
Hi @strongdm:matrix.org . I believe you can do it directly on Mu. Go to the gear-config symbol on Mu (bottom right corner) and go the the "Third Party Packages" tab.
Some extra help here
As Mu as a dedicated Python installation what you did on the terminal probably affected the default system's Python installation but not Mu's.
Tell us if it worked for you! Best regards
john-kat
@john-kat
Hi there, I'm not sure if this is the correct place for bug reports but I have encountered some unexpected behaviour. Is this the best place to report that?
tjguk
@tjguk:matrix.org
[m]
@john-kat: you can bring it up here for a general discussion. Or you can raise a bug on our GH issue tracker.
john-kat
@john-kat

I will leave this here for anyone who may be able to look in to it. This function shows the problem:

from time import strftime
import time

def clock():

while True:
string = strftime("%H:%M:%S")
print(string, end="\r")
time.sleep(1)

clock()

The output should not redraw on a new line but it does... (\r should cause it to overwrite on the same line) ... Thank you tjguk

~Thanks tjguk. I just finished writing that when you replied. I will leave it here for consideration.
tjguk
@tjguk:matrix.org
[m]

@john-kat: I haven't tried the code in Mu, yet, but I imagine that if it doesn't work it'll be to do with the fact that Mu uses a Qt-based console system rather than the command window which Python would normally use. That may (and probably does) interact differently with some control characters like the carriage return you're using there.

I'll paste your code into Mu to see if I get the same behaviour as you're seeing..

Yep -- same behaviour as you're seeing: throws a new line on each line. I'd have to dig further than I have time for right now, but I expect that the window control we're using doesn't honour carriage-return semantics (if I can call them that). You can certainly run your code outside of Mu to get the desired effect -- which I realise is a bit of a second-best ☹️
Appleboy
I have a question: How do I export a game FROM Mu?
Nicholas Tollervey
@ntoll
@appleboy711_twitter very simple: Just copy the files you need from your mu_code directory into a new directory. Remember to include the subdirectories in mu_code containing your images, music, sounds and so on.
geraldineolivier
@geraldineolivier
Hi, I would like to know if it is possible to set the path for the mu_code directory. My school as a specific virtual network that does not enable acces to C:\Users\name.surname\mu_code directory...so I cannot put additional libraries in this directory ...
Ronald Nicholson
@hotpaw2
Can the mu-editor be used (to write code for a micro:bit) strictly from the command-line (a text terminal window)?
tjguk
@tjguk:matrix.org
[m]

@geraldineolivier: Yes -- you can set the path in the settings file. If it already exists (it may not) it will be in %LOCALAPPDATA%\python\mu\settings.json. As the name suggests, it's a JSON file so you can easily create it and then add the setting:

workspace : <path to your directory>

It's JSON so you'll need to format it something like this:

{"workspace" : "c:/temp"}
@hotpaw2: I might be misunderstanding you but, if you're in micro:bit mode on Mu, does the [REPL] button give you want you want?