I wrote a script that creates 50 boxes of random color. The script works normally, but once I used py2exe to make it an executable file, it stopped working. The executable worked at first, but then later it stopped working. I started getting this error:
ImportError: No module named turtle
Here is my python code:
import turtle
from random import randint
colors = ['red', 'green', 'yellow', 'purple', 'blue', 'orange', 'black', 'lightgreen', 'navyblue', 'pink']
window = turtle.Screen()
box = turtle.Turtle()
box.speed(4)
box.penup()
box.setx(-350)
box.sety(200)
box.pendown()
for num in range(100):
box.color(colors[randint(0, 9)])
for x in range(4):
box.forward(30)
box.left(90)
x = box.xcor()
if x >= 350:
y = box.ycor() - 60
x = box.xcor() - 700
else:
y = box.ycor()
x = box.xcor() + 45
box.goto(x, y)
I really am not sure why it started giving me this error.
My .exe file is to long to post here, and it is incomprehensible to me anyway. I have python 27's tkinter, so I don't think that's the problem.
Thanks