this post was submitted on 16 Jul 2023
6 points (71.4% liked)

Python

6356 readers
3 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

πŸ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
πŸ’“ Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
 

At least I posted it to !programming_horror@programming.dev first!

you are viewing a single comment's thread
view the rest of the comments
[–] stOneskull@programming.dev 1 points 1 year ago* (last edited 1 year ago) (1 children)

i've found a good alternative is returning functions

eg. you have a function like this:

def cycle(func): func=func()

then you start with cycle(main)

def main(): return intro

if __name__ == '__main__: cycle(main)

and then main returns the next function, and following functions return functions..

def intro(): if thisthing: return thisfunc if thatthing: return thatfunc

return is being used like goto

[–] shayan16sa@techhub.social 2 points 1 year ago (1 children)
[–] stOneskull@programming.dev 2 points 1 year ago

you can see how i use it here: godschat

read from the bottom up