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?
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
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