Nov-02-2023, 09:58 AM
(This post was last modified: Nov-02-2023, 09:59 AM by crouzilles.)
Hi,
I am new to python and programming in general.
I have the following 4 functions:
I also have a variable called direction which can contain either: down, up, left or right
Is there a way to call a function based on the variable name, maybe something like this __scroll_{direction}() ?
Thank you for your time and help
Crouz
I am new to python and programming in general.
I have the following 4 functions:
- __scroll_down
- __scroll_up
- __scroll_left
- __scroll_right
I also have a variable called direction which can contain either: down, up, left or right
Is there a way to call a function based on the variable name, maybe something like this __scroll_{direction}() ?
Thank you for your time and help
Crouz