0

I'm trying to use the exec command in python to try to get a function to call on different dictionaries and functions as needs change without making my program bigger than it needs to be. Unfortunately I keep getting this error:

File "Game Files\Intro.py", line 214, in Anim
exec compile('%slegs = ImageTk.PhotoImage(Sprite%s["legs0"])'%(name,name), '<string>', 'exec') in Anim
TypeError: exec: arg 2 must be a dictionary or None

are the args 'compile' and 'in Anim', or is there something else I'm missing?

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Gribouillis
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.