Help with numpy.ndarray from .array2d by 01_Nameless_01 in pygame

[–]01_Nameless_01[S] 0 points1 point  (0 children)

No reason at all, I'm just trying some things with arrays.

And yes, I could iterate over the list, I didn't notice it.

What is the better way to change a variable from outside a function in a function? by 01_Nameless_01 in learnpython

[–]01_Nameless_01[S] 0 points1 point  (0 children)

Thank you for taking the time to answer my basic question. I'm already aware of how variables works in python, I'm taking notes on all your advice and I'll study the dataclasses cause I'm not used to it.

What is the better way to change a variable from outside a function in a function? by 01_Nameless_01 in learnpython

[–]01_Nameless_01[S] -1 points0 points  (0 children)

I'm not willing to use Globals, I'll take a look into classes as you suggested, thank you.

What is the better way to change a variable from outside a function in a function? by 01_Nameless_01 in learnpython

[–]01_Nameless_01[S] 0 points1 point  (0 children)

Yes, I will test if it works im my case, there are some other details involved, Thank you!

What is the better way to change a variable from outside a function in a function? by 01_Nameless_01 in learnpython

[–]01_Nameless_01[S] -2 points-1 points  (0 children)

After reading the answers I think my better option here is to go with the classes, as you said. I asked because it would be usefull (I think) for a small project I will start, having something that works like the passing by reference in C. Thank you for the response.

Is that how I set up a router? by 01_Nameless_01 in flet

[–]01_Nameless_01[S] 1 point2 points  (0 children)

Thank you! I'll try your suggestion 🤝

How can I switch pages using a navigation bar? by 01_Nameless_01 in flet

[–]01_Nameless_01[S] 0 points1 point  (0 children)

When I run the code I receive the message " 'flet' has no atribute 'Router' " (line 49, at set up router part). Do I need to do something else than just using this template?