Yeah you cant assign values to a string. Thats what your program is trying to do. Well i would advise using a dictionary for this one:
d1 = {}
d2 = {}
for swipeload in range (0, 15, 1):
d1["E"+str(swipeload)+"_Path"] = os.path.join("data","E"+str(swipeload)+".gif")
d2["E"+str(swipeload)] = pygame.image.load("E"+str(swipeload)+"_Path")
This now has a dictionary where the string values are the keys and the values are what you want. The first dictionary holds the path while the second dictionary holds the image.
Hope that helps
Last edited by Paul Thompson; Oct 31st, 2008 at 5:43 pm.
Reputation Points: 264
Solved Threads: 183
Veteran Poster
Offline 1,095 posts
since May 2008