Advertisement
calcpage

CSH2012 LAB10 parse.py

May 17th, 2013
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. #!/usr/bin/python
  2. #parse.py    MrG    2013.0513
  3. import turtle
  4. alex=turtle.Turtle()
  5. alex.pensize(10)
  6. alex.color('red')
  7. alex.speed(10)
  8.  
  9. input = open("mystery.dat","r")
  10. for line in input:
  11.     if line[0]=="D":
  12.         alex.pd()
  13.     elif line[0]=="U":
  14.         alex.pu()
  15.     else:
  16.     point=line.split()
  17.         alex.goto(int(point[0]),int(point[1]))
  18.  
  19. turtle.mainloop()
  20. input.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement