title: How to get python turtle to move according to a text file
body: <pre><code>import turtle as t
  from turtle import *
  from math import sin, pi, sqrt
  setup(500, 500)
  Screen()
  title("Turtle Art")
  showturtle()
  screen = Screen()
  yertle = Turtle()
  
  turn = 90
  speed = 10
  moves = []
  
  def k1():
      t.forward(speed)
      moves.append(1)
  
  def k2():
      t.left(turn)
      moves.append(2)
  
  def k3():
      t.right(turn)
      moves.append(3)
  
  def k4():
      t.backward(speed)
      moves.append(4)
  
  def k102():
      if input("Would you like to save this? (y/n) ") == "y":
          name = input("What would you like to call your masterpiece? ")
          my_file = open("./%s" % (name), "w")
          global moves
          moves = str(moves)
          my_file.write(moves)
          my_file.close()
          print("It has been saved as:", name)
      else:
          t.clear
  
  t.onkey(k1, "Up") #move forwards
  t.onkey(k2, "Left") #turn left
  t.onkey(k3, "Right") #turn right
  t.onkey(k4, "Down") # move backwards
  
  t.onkey(k102, "p") #save page
  
  listen()
  mainloop()
  </code></pre>
  
  <p>This saves it as a list in a text file in the current folder (that looks like this: [1, 1, 2, 1, 3, 3, 1]). I was wondering how to make the turtle reproduce this by moving according to the 1, 2, 3, or 4. Is there any way to read from a text file easily?</p>