TinyCircuits Forum

TinyCircuits Products => Thumby => Topic started by: DarkGizmo on April 24, 2022, 11:26:54 PM

Title: Thumby Code Editor Issues
Post by: DarkGizmo on April 24, 2022, 11:26:54 PM
Hello everyone,

I haven't yet received my thumby, but I am already starting a project in the Thumby Code Editor

It's a great tool but I  have some questions that I couldn't find any answer online
I'm still learning Python after years of using C++, so maybe some of these are related to my lack of Python knowledge


Thank you
I'm already having a great time and haven't received my Thumby yet. Can't wait to see how small it actually is!
Title: Re: Thumby Code Editor Issues
Post by: Jason on April 25, 2022, 10:12:15 AM
These are issues that we are working on addressing. In the meantime,

Title: Re: Thumby Code Editor Issues
Post by: DarkGizmo on April 25, 2022, 12:05:57 PM
Make sure to check the white emulation box on the sprite data file and that it's path is where you expect (hover over the file tab)

Yes it should good, is there a limit on the number of character of a filename? Or a limit of file the emulator can support?
Title: Re: Thumby Code Editor Issues
Post by: DarkGizmo on April 25, 2022, 11:06:34 PM
I've created a empty main.py that only loads a file. Doesn't seem to work with my .spr file, but works with the same file if it's a .bin file.
Am I missing something? Is the extension part of my issue?

Code: [Select]
print("Open file")
with open("/player_idle_10x11_x2.spr",'rb') as animFile:
    print("hello")

Outputs:
>>> __import__('/main')
Open file
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/main.py", line 6, in <module>
OSError: [Errno 2] ENOENT

while

Code: [Select]
print("Open file")
with open("/player_idle_10x11_x2.bin",'rb') as animFile:
    print("hello")

Outputs:
>>> __import__('/main')
Open file
hello
<module '/main' from '/main.py'>

Same file content just the extension was changed

If I run os.listdir() I get a variable number of files depending of which file I have emulated or not

['animation.py',
'background.py',
'character.py',
'collectible_12x10_x18_sprite.bin',
'collision_manager.py',
'game_framework.py',
'key.py',
'labyrinth.py',
'lib',
'main.py',
'player.py',
'player_idle_10x11_x2_mask.bin']

if I remove from emulation this file "player_idle_10x11_x2_mask.bin", then I get this list, which seems to be all my files, except this one...-

['animation.py',
'background.py',
'character.py',
'collectible_12x10_x18_sprite.bin',
'collision_manager.py',
'game_framework.py',
'key.py',
'labyrinth.py',
'lib',
'main.py',
'player.py',
'player_idle_10x11_x2_sprite.bin',
'player_walk_10x11_x3_mask.bin',
'player_walk_10x11_x3_sprite.bin']

So my guess is renaming the file to .bin or .spr changes the order and affects the files somehow. Has anyone seen something like this? I'm not sure if I'm doing something wrong or something weird is happening outside of my control
Title: Re: Thumby Code Editor Issues
Post by: DarkGizmo on April 27, 2022, 03:07:23 PM
I feel more and more that's it's an emulator issue, I keep listing my files every execution. Sometime a file is missing and just with code changes it reappears.

On the emulator page, there is a list of files, are all those file supposed to be accessible, because it seems to fit all my files that are set to emulate (the white checkmark). But not all of them are available when the emulator is started?

Anyone has any pointer for this issue? I'm thinking of migrating all my data to a python .py file so I don't have to fight this issue, but it just doesn't feel right
Title: Re: Thumby Code Editor Issues
Post by: Jason on April 28, 2022, 04:13:57 PM
I feel more and more that's it's an emulator issue, I keep listing my files every execution. Sometime a file is missing and just with code changes it reappears.

On the emulator page, there is a list of files, are all those file supposed to be accessible, because it seems to fit all my files that are set to emulate (the white checkmark). But not all of them are available when the emulator is started?

Anyone has any pointer for this issue? I'm thinking of migrating all my data to a python .py file so I don't have to fight this issue, but it just doesn't feel right

I agree that it sounds like an emulator issue.

I may have time to look at it soon.