51292/bitmap-vector-graphics-creating-drawing-python-turtle-module
This worked for me:
from Tkinter import * from turtle import * import turtle forward(100) ts = turtle.getscreen() ts.getcanvas().postscript(file="duck.eps")
I tried your code, but I got :
from Tkinter import *
ModuleNotFoundError: No module named 'Tkinter'
But if I use
import tkinter I don't get the same error.
Also,
forward(100) ts = turtle.getscreen() ts.getcanvas().postscript(file="NiceHexSpiral.eps")
I get: NameError: name 'forward' is not defined
Here is my code:
import tkinter import turtle t=turtle.Pen() turtle.bgcolor('dimgrey') sides = 4 colors=['lemon chiffon', 'purple', 'blue', 'salmon', 'green', 'red'] y = 350 for x in range(y): t.pencolor(colors[x%sides]) t.width(x*sides/200) t.forward(x*3/sides +x) t.left(y/sides+1) forward(100) ts = turtle.getscreen() ts.getcanvas().postscript(file="NiceHexSpiral.eps")
Hi@OceansBlue,
There is nothing called the Tkinter module. You need to use tkinter. In your second error, you have used one function named forward. But you didn't define the function. So create your function or remove the function name. Make these changes and if you get any error, then paste the error here.
Steps to Convert Text File to CSV ...READ MORE
down voteacceptedUsing OpenCVYou can use resize() in OpenCV to ...READ MORE
You can use QtCore.QTimer class Example(QWidget): def __init__(self, app): QWidget.__init__(self) QTimer.singleShot(0, ...READ MORE
You can also use the random library's ...READ MORE
Syntax : list. count(value) Code: colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...READ MORE
You can simply the built-in function in ...READ MORE
Yes, you can do this. Python allows ...READ MORE
If you are using Ubuntu then the ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.