+def command_inventory_selector(string):
+ def command_inventory_select():
+ logfile = open("logfile", "a")
+ logfile.write(string + "\n")
+ logfile.close()
+ if string == "up" and world_data["inventory_selection"] > 0:
+ world_data["inventory_selection"] -= 1
+ elif string == "down" and world_data["inventory_selection"] \
+ < len(world_data["inventory"]) - 1:
+ world_data["inventory_selection"] += 1
+ return command_inventory_select
+
+