You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have worked in a simple mastermind game made in python, and made the following code to make the letters of the text appear with a delay between them (without making newlines).
Unfortunately, this doesn't seem to work on the calculator, and results in a TypeError:
Another way of doing this is using escape codes, such as \b for a backspace. This does work but gives a unwanted output :
To implement this flush feature, a first option would be to add the flush type, but that may not work if that is a limitation from Micropython itself. Another way to put it would be to add the sys module (or a part of it, such as stdout, if it can't fit in the calculator). The last option (that I can think of) would be to make the the escape codes such as \b work, but again, I don't know if there are some limitations around.
The text was updated successfully, but these errors were encountered:
# Type text with delay between letters.
import kandinsky as k
import time
def message(message, delay):
r=11; c=1
for letter in message:
k.draw_string(letter, 10*c, 18*r+2)
time.sleep(delay)
c+=1
message("Hello, world.", 0.2)
I guess using kandinsky to resolve this is an option we can use now.
Unfortunately, we can't really go back to the first lines, and making it possible with kandinsky will loose both a lot of time to develop and space on the device.
But again, unlike Classic Python, this version of Python for embedded devices does not have the flush capabilities by default (which you can try here), so I do not know how hard or at which cost (in terms of space) it will be implemented.
I have worked in a simple mastermind game made in python, and made the following code to make the letters of the text appear with a delay between them (without making newlines).
Unfortunately, this doesn't seem to work on the calculator, and results in a TypeError:
Another way of doing this is using escape codes, such as
\b
for a backspace. This does work but gives a unwanted output :To implement this flush feature, a first option would be to add the flush type, but that may not work if that is a limitation from Micropython itself. Another way to put it would be to add the sys module (or a part of it, such as stdout, if it can't fit in the calculator). The last option (that I can think of) would be to make the the escape codes such as
\b
work, but again, I don't know if there are some limitations around.The text was updated successfully, but these errors were encountered: