Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 23 23:19
    profasare commented #2249
  • Jan 23 23:11
    profasare commented #2249
  • Jan 22 10:53
    xbecas commented #2382
  • Jan 22 05:07
    rezapci commented #1620
  • Jan 21 07:39
    haikusw commented #2386
  • Jan 19 08:03
    haikusw synchronize #2386
  • Jan 18 21:35
    haikusw commented #2386
  • Jan 18 21:34
    haikusw commented #2386
  • Jan 18 20:37
    haikusw commented #2386
  • Jan 18 20:14
    tjguk commented #2386
  • Jan 18 18:54
    haikusw commented #2386
  • Jan 18 18:54
    haikusw commented #2386
  • Jan 18 18:46
    haikusw commented #2386
  • Jan 18 18:46
    haikusw ready_for_review #2386
  • Jan 18 18:41
    haikusw commented #2386
  • Jan 18 18:20
    haikusw synchronize #2386
  • Jan 18 09:01
    haikusw closed #2394
  • Jan 18 08:17
    haikusw synchronize #2394
  • Jan 17 18:03
    haikusw commented #2386
  • Jan 17 17:51
    haikusw commented #2386
Carl J. Nobile
@cnobile2012
@jeskdm The processing is a built-in library with the CPython version. If it's not in the MicroPython I'll bet it will not work at all. I've used this lib often but not on microcontrollers I have my doubts that it will run on a microcontroller at all. If the lib has no C compiled components in it you can give it a try though.
I just looked at the description and it is base on the threading lib which is only partially supported by MicroPython. Try it see what happens, if it breaks I bet it's because it will not compile properly.
jeskdm
@jeskdm
Thanks for the reply but I am not planning to use it on a microcontroller. Only on a desktop. But if I open MU and select "Third Party Packages" processing is not listed as an option.
Carl J. Nobile
@cnobile2012

That's because it's not a third-party package, it's, as I said above, part of the Python default packages just do an import and it should work.

from multiprocessing import <list the packages within processing you want>

It's generally not a good idea to import everything with an *.

1 reply
Carl J. Nobile
@cnobile2012
@jeskdm I just realized that the package in Python is called multiprocessing, not processing. It seems to be the same thing though.
Ian F
@was-dtech
Does anyone know how to position the window in Pygame Zero when the game starts? At present the window is always start with the top left corner in the middle of the screen. I'd like to place the window where I want on the computer screen. Appreciate any help :-)
Nicholas Tollervey
@ntoll
@was-dtech morning! :wave: This is something beyond Mu's control but I think you've also realised this too, given the ticket you raised on the PGZero GitHub repository. I've posted an answer over there (more visibility for others in the same situation). Best of luck! :+1: lordmauve/pgzero#263
Zander Brown
@zbrown:matrix.org
[m]
(I'd also like to point out setting the window position may not be possible at all)
peternyffeler
@peternyffeler
Be new to mu-editor and need to add the onewire module for reading the DS18B20 temprature sensor on a Micro:bit project.
Following the instrction for installing packages on https://codewith.mu/en/tutorials/1.1/pypi I can't find the tab "Third Party Packages" in the "Mu Adminstration" pup-up window.
I'm using mu-editor 1.1.0.beta.6 (the one you get actually from the wbsite) on Windows 10.
Is there an other way to install mudules?
Nicholas Tollervey
@ntoll
@peternyffeler please make sure you're in Python3 mode for installing packages for use by Python3. If you're in (for example) another mode like micro:bit mode, because you can't install packages directly on the device, this feature disappears for good reason. :+1:
But I think your question demonstrates we should mention this in our docs..! (Thank you for bringing it to our attention)
peternyffeler
@peternyffeler
Thanks for the answer. I installed the module in Python3 mode. But switched back to micro:bit mode I still get "ImportError: no module named 'onewire'". Does this mean I can't use modules for the micro:bit?
Nicholas Tollervey
@ntoll
Yes. The modules you download are for use on your local machine via Python3. The micro:bit doesn't really have any notion of downloaded modules to install on the device.
Nicholas Tollervey
@ntoll
Hi @Nelson231 -- fallen asleep at the keyboard..? :stuck_out_tongue: (I'll clean up the infinite "h"s)
Roger E Critchlow Jr
@recri
Hi, I just tried to run "sudo pip3 install mu-editor==1.1.0b6" on my Ubuntu laptop, the errors are: ERROR: Could not find a version that satisfies the requirement mu-editor==1.1.0b6
ERROR: No matching distribution found for mu-editor==1.1.0b6
Nicholas Tollervey
@ntoll
@recri you need to use Python3.8. We're not yet fully on 3.9 because of an upstream dependency not working properly (yet).
Roger E Critchlow Jr
@recri
@ntoll ah, then build from github source in a virtual env should work, no?
Nicholas Tollervey
@ntoll
Yes. Or just make a venv with Python 3.8: python3.8 -m venv foo
and then pip install mu-editor==1.1.0b6
(in the venv)
Roger E Critchlow Jr
@recri
@ntoll That worked, ended up rebuilding python3.8 from source on Ubuntu 21.10, thanks for the clues.
Nicholas Tollervey
@ntoll
Well done on the rebuild and thanks for letting us know how you got on..! Best of luck. :-)
honeybadgerdh
@honeybadgerdh
Hi, just started using Mu instead of IDLE for teaching python programming, love it overall but found a couple of issues:
minor one - in dark mode, using string formatting makes the colours go funky - there is a white background on the string bits after a print(f"...")
more major one (unless i'm missing something) - the debugger doesn't seem to show scope of variables at all, and if the same variable name exists locally and globally it just shows it as one variable with the local variable value
Nicholas Tollervey
@ntoll
:wave: hi @honeybadgerdh thank you for the feedback. I'll take a look at the colour problem. I'm not sure what you mean by the debugger showing scope. What you see in the list of available objects is exactly what is IN scope for Python at that point in time. I'm probably missing something or misunderstanding. Can you give more details or an example please..? Always appreciative of technical feedback..! :+1:
Zander Brown
@zbrown:matrix.org
[m]

I think what they mean is

fancy_variable = 123
other_variable = 456

def some_function():
    global other_variable

    fancy_variable = 234
    other_variable = 789

    print(fancy_variable, other_variable) # ← Breakpoint here ←

some_function()

print(fancy_variable, other_variable)

Doesn't indicate other_variable is global, and doesn't show the shadowed fancy_variable

Nicholas Tollervey
@ntoll
Ahhh
honeybadgerdh
@honeybadgerdh

Thanks Zander, that's it! For another example, if I was to run the following in Mu debugger and IDLE debugger, at line 3 within the function:

def add(number):
    number += 1
    print (number)

number = 1
add(number)
print(number)
  • IDLE would show number = 2 in 'locals' and number = 1 in 'globals'
  • Mu would just show number=2

For teaching purposes I'd like to be able to follow a program through and demonstrate scope, parameters, returns clearly.

Nicholas Tollervey
@ntoll
:+1: Thanks for the example. I'll take a look.
honeybadgerdh
@honeybadgerdh
thanks!
Nicholas Tollervey
@ntoll
OK.... just taken a look... the debugger just displays locals. I'll see how I might be able to add a "globals" thing so you get the capability you need.
honeybadgerdh
@honeybadgerdh
Fantastic, thank you!
Goose
@GooseTheCat8602
Hey, me again. Need help with a second project. It's very very weird. Please don't question it.
```
class sales:
def init(self, Products_Sold):
self.Products_Sold = Products_Sold
if Products_Sold > 534767897323:
print("Good work. ")
elif Products_Sold < 534767897323:
print("Patrick is dissapointed.")
def PatrickMoney(self):
    print("Patrick's Money: 9 Patrickillion")
    print("Last month's Money: 7 PatrickIllion")

def Patrick_Products(self):
    print("Patrick has many products, but his favorite has to be bacon")
    new_products = ["Bacon Bits", "Bacon Cupcakes", "Chocolate Flavored Bacon"]
dang
hold on
# welcome to Patrick's Puppy Portions! #
class sales:
    def __init__(self, Products_Sold):
        self.Products_Sold = Products_Sold
        if Products_Sold > 534767897323:
            print("Good work.")
        elif Products_Sold < 534767897323:
            print("Patrick is dissapointed.")

    def PatrickMoney(self):
        print("Patrick's Money: 9 Patrickillion")
        print("Last month's Money: 7 PatrickIllion")

    def Patrick_Products(self):
        print("Patrick has many products, but his favorite has to be bacon")
        new_products = ["Bacon Bits", "Bacon Cupcakes", "Chocolate Flavored Bacon"]
very weird, but the problem is the last part.
It says it's assigned to, but not used.
the variable, new_products
Goose
@GooseTheCat8602
my bad. Found the problem.
Nicholas Tollervey
@ntoll
Yeah... it just means you've assigned the list to new_products but not actually done anything WITH new_products (therefore, why assign the list to it?)
haleyma
@haleyma
Hi, I used to be able to use Mu on my Windows 10 laptop, but have tried downloading the latest version several times and it will not open. Is this a know issue?
Nicholas Tollervey
@ntoll
@haleyma can you tell us a bit more about what happens..? Any error messages etc...?
samshurp27
@samshurp27:matrix.org
[m]
Hey, I am using a PWMIO function, and I am able to output the right frequency from ItsyBitsy but when I use a battery to power the Itsybitsy, I get a slight decrease in frequency. For example: when I use battery, the output frequency goes from 5Hz to 4.85Hz, or 10Hz to 9.70Hz. How can I resolve this issue?
Nicholas Tollervey
@ntoll
@samshurp27:matrix.org this is a channel for technical questions about Mu - the editor - rather than ItsyBitsy or Circuit/MicroPython. Try their support channels instead..? If you're using an Adafruit board or CircuitPython, they have a wonderful Discord server with plenty of channels in which to find help.
samshurp27
@samshurp27:matrix.org
[m]
@ntoll: Thank you for responding. I would like to rephrase my question. I am using a PWMIO function, but the output frequency I get is 9.70Hz instead of 10Hz. I believe that I can increase the frequency by +0.3 on the code but I can only use integer for frequency. How can I put frequency = 10.3 when it only allows integers. Above is my current code.
rtborg
@rtborg
Hi, I am experiencing serial port disconnect issues with Mu under Ubuntu, using CircuitPython board Feather M4. While the editor is open and the board is running, the connection suddenly drops, and then the board is mapped to a different /dev/ttyACM*. This does not happen when using Windows.image.png
John Hansen
@John-AAU

Hi, I am experiencing strange behavior when using the plotter together with an ESP32 microcontroller. The attached image shows the output of a function that clearly should produce a uniform sawtooth looking plot. The REPL window shows data correct but the plotter is giving a strange shape. The error changes from run to run.

What am I doing wrong?

strange_plotter_behavior.png
Nicholas Tollervey
@ntoll
Hi @rtborg - so I develop Mu on Ubuntu and have never seen nor heard of this behaviour. I wonder if you're writing to the device's filesystem in some way..? Often that causes the board to reboot and may explain the problem you're seeing. (It's never happened to me). If you could let us know what version of Mu you're using and perhaps attach a log file, we'd be able to tell for sure what Mu is seeing.
Nicholas Tollervey
@ntoll
@John-AAU hmm... that's a weird one. I wonder if it might be a timing issue..? Could you perhaps try time.sleep at a different value, and let us know what you observe..?