How do I display the app while also calling another function simultaneously? #512
Replies: 5 comments 5 replies
-
I tried using |
Beta Was this translation helpful? Give feedback.
2 replies
-
There is some advice here - https://lawsie.github.io/guizero/blocking/
You could also look at methods for threading and sharing state between your
GUI and your game.
However... you may find that it is simpler and easier to rewrite your logic
code to work using an event driven model.
…On Thu, 21 Nov 2024, 13:14 TechPro424, ***@***.***> wrote:
I tried using app.after(10, logic.main).
The function was called, but the app stopped responding.
—
Reply to this email directly, view it on GitHub
<#512 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARYXHNIW5SHN5LEYVIACTT2BXMCXAVCNFSM6AAAAABSG67YSWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMZTGYZTIMA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Look at the sensehat example I wrote, but somehow doesn't have me as the
author.
(If on a pi you can change to sense_emu to actually run it)
There is also auto_update... , after_repeat... , app_events...
…On Thu, 21 Nov 2024, 5:13 pm TechPro424, ***@***.***> wrote:
Any examples of event driven models you can provide? I'm not too familiar
with them.
—
Reply to this email directly, view it on GitHub
<#512 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYAXN63CNZP6Z62HLUYE3T2BYIFLAVCNFSM6AAAAABSG67YSWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMZTHEZTANQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
There are lots of examples in the repo. Including a game called floodit
which give you some inspiration.
https://github.com/lawsie/guizero/blob/master/examples/floodit.py
…On Thu, 21 Nov 2024, 17:13 TechPro424, ***@***.***> wrote:
Any examples of event driven models you can provide? I'm not too familiar
with them.
—
Reply to this email directly, view it on GitHub
<#512 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARYXHIFX65YYWI4JTRXJ3T2BYIFLAVCNFSM6AAAAABSG67YSWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMZTHEZTANQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
TechPro424
-
I remember when these where edited for a tidy up by the now author, that
and many others lost the original creator. I was surprised GitHub could
loose them
…On Fri, 22 Nov 2024, 9:00 am Laura Sach, ***@***.***> wrote:
Sorry that there isn't a credit, is it this one? Very happy to add a
credit in the comments (or you can add a PR for it)?
https://github.com/lawsie/guizero/blob/master/examples/sensehat_read_data.py
—
Reply to this email directly, view it on GitHub
<#512 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYAXNYPWUCRSO33S7UQBHD2B3XDHAVCNFSM6AAAAABSG67YSWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMZUGY2DSNY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to recreate the UNO card game using GuiZero, and all my backend logic is in a file called logic, and runs when I call the function
logic.main()
However, on importing logic in my entrypoint file (the file I run to start the program), and calling
logic.main()
afterapp.display()
,logic.main()
is not called asapp.display()
is blocking further execution.logic.main()
is a function that runs in an infinite loop usingwhile True:
till one of the players has no cards, so I cannot call that before displaying the app.How do I display the app while also calling the
logic.main()
function?Beta Was this translation helpful? Give feedback.
All reactions