Coding tips

Not sure where, or even if there is a spot for this question but I’m looking to see if anyone can spot check my code? I finally have pixlet on the Raspberry Pi using @drudge very helpful tutorial. Thank you, now im looking to start making some basic applets. I’m reading through the manuals and references and cant seem to get this code to work. ill post it and if anyone can spot any mistake I made or tips you can share id greatly appreciate it. Im just trying to use the render.stack widget along with the marquee and animation and i think im either missing a bracket or have it misplaced. feel free to make fun of my code lol as i am a noob. thanks!

load(“render.star”, “render”)

def main():

return render.Root(

    child = render.Stack(

        children = [

            render.Marquee(

                width=64,

                child=render.Text("this won't fit in 64 pixels"),

                offset_start=5,

                offset_end=32,

                    children = [

                        render.Animation(

                            children = [

                                render.Box(width=10, height=10, color="#300"),

                                render.Box(width=12, height=12, color="#500"),

                                render.Box(width=14, height=14, color="#700"),

                                render.Box(width=16, height=16, color="#900"),

                                render.Box(width=18, height=18, color="#b00"),

                    ]

                ),  

            ],

        )    

    ]    

)

)

1 Like

It looks like your missing a few commas on the bottom portion of your code. The brackets underneath your render.box section should all have commas after them to close out the statments.

Also if you have a discord feel free to join our channel. Lots of friendly people will to help out if you have coding questions.

1 Like

Thanks for the input. I’d be glad to join. What’s the discord channel name?

I’d also recommend setting up a git hub account so you can easily share code rather then posting everything in the chat!

Just my two cents

1 Like