3ds_monty icon indicating copy to clipboard operation
3ds_monty copied to clipboard

SyntaxError, Even When There Shouldn't Be One

Open SaturnSH2x2 opened this issue 8 years ago • 3 comments

I'm having an issue running a program with the interpreter using the netloader. I've been trying to run a program, but whenever I try to run it from a .zip file, it returns:

Traceback (most recent call last):
    File "zip:/test1.py", line 1
SyntaxError: invalid syntax

Here is the code:

from citrus import *

gfx.init_default()
console.init(gfx.SCREEN_TOP)

print("Hello, world!") 
    
while apt.main_loop():
    hid.scan_input()
        
    if hid.keys_down() and hid.KEY_START:
        break
        
    gfx.flush_buffers()
    gfx.swap_buffers()
    gsp.wait_for_vblank()

I have the boot file included in the zip, and have double-checked that it points to the right file.

I should note that the program runs fine when only the .py file is sent. It's only when it's packaged in a .zip does the interpreter act up.

Could this be an issue with encoding? I checked both my Python script and the one used in the examples, but the format used by different editors mess up the interpreter? Or am I simply using the .zip files incorrectly?

SaturnSH2x2 avatar Nov 07 '16 00:11 SaturnSH2x2

Are you compressing the ZIP file? Unfortunately, libzipfs only supports storage ZIP's at the moment.

ObsidianX avatar Nov 07 '16 02:11 ObsidianX

I'm pretty sure I'm compressing the .zip correctly (using the zip command-line utility for Linux). I ask since Google yielded no adequate answers, but what is the distinction between a storage zip and a normal zip file?

SaturnSH2x2 avatar Nov 07 '16 16:11 SaturnSH2x2

Try making an uncompressed ZIP

tomrow avatar Jun 12 '19 14:06 tomrow