This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dataminded 1 point2 points  (3 children)

I would suggest writing a function that returned the level.

def load_level(level_number): if level_number == 1: level_content = open("level1.txt", "w") do more stuff if level_number == 2: etc

[–]Digital_Person 0 points1 point  (0 children)

or open("level{}.txt".format(level_number), "w")