Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Does the order of def statements matter?
-
Hi all
I am writing a script using the animation/game template in Pythonista, and have written many functions that are called within the programme. Does the order the functions appear in the script matter?
I am getting a name create_board' not defined error when running the script.
The thing is, the function is actually there in the script. It is currently the first one listed under the MyScene class as here...
class MyScene (Scene): def create_board(self): self.board = np.zeros((ROW_COUNT, COLUMN_COUNT)) return self.board
And this function is called from within the def setup function further on down the script.
Any pointers please? Sorry if this is a little vague, shout and I'll be happy to provide more detail if needed.
Thanks
John -
@themusicman must be called as
self.create_board()