Registering a shape in python's turtle module
My problem:
I am attempting to register a shape with the python turtle module, however it is refusing to work. The gif in question is this and it is located in my downloads folder with the title tenor.gif. I am running this code in the IDE, Canopy, in Python 3.
If I restart the kernel and then run the code, I consistently get the same output, verifying I have the right directory:
%run "C:/Users/AlexPC/Python Programs/Chess.py"
C:UsersAlexPCDownloads
C:UsersAlexPCDownloads
and the same error:
---------------------------------------------------------------------------
TclError Traceback (most recent call last)
C:UsersAlexPCPython ProgramsChess.py in <module>()
37 print(os.getcwd())
38 s.register_shape("tenor.gif")
---> 39 t.shape("tenor.gif")
40
41
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibturtle.py in shape(self, name)
2775 if not name in self.screen.getshapes():
2776 raise TurtleGraphicsError("There is no shape named %s" % name)
-> 2777 self.turtle._setshape(name)
2778 self._update()
2779
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibturtle.py in _setshape(self, shapeIndex)
2504 self._item = screen._createpoly()
2505 elif self._type == "image":
-> 2506 self._item = screen._createimage(screen._shapes["blank"]._data)
2507 elif self._type == "compound":
2508 self._item = [screen._createpoly() for item in
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibturtle.py in _createimage(self, image)
721 """Create and return image item on canvas.
722 """
--> 723 return self.cv.create_image(0, 0, image=image)
724
725 def _drawimage(self, item, pos, image):
<string> in create_image(self, *args, **kw)
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibtkinter__init__.py in create_image(self, *args, **kw)
2327 def create_image(self, *args, **kw):
2328 """Create image item with coordinates x1,y1."""
-> 2329 return self._create('image', args, kw)
2330 def create_line(self, *args, **kw):
2331 """Create line with coordinates x1,y1,...,xn,yn."""
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibtkinter__init__.py in _create(self, itemType, args, kw)
2318 return self.tk.getint(self.tk.call(
2319 self._w, 'create', itemType,
-> 2320 *(args + self._options(cnf, kw))))
2321 def create_arc(self, *args, **kw):
2322 """Create arc shaped region with coordinates x1,y1,x2,y2."""
TclError: image "pyimage1" doesn't exist
My code:
from turtle import Turtle, Screen
import os
t = Turtle("square")
t.shapesize(4,4)
t.hideturtle()
t.pu()
t.goto(-280,-280)
s = Screen()
s.clearscreen()
s.tracer(False)
s.screensize(800,800)
#register the piece shapes
print(os.getcwd())
os.chdir("C:\Users\AlexPC\Downloads")
print(os.getcwd())
s.register_shape("tenor.gif")
t.shape("tenor.gif")
python python-3.x turtle-graphics
add a comment |
My problem:
I am attempting to register a shape with the python turtle module, however it is refusing to work. The gif in question is this and it is located in my downloads folder with the title tenor.gif. I am running this code in the IDE, Canopy, in Python 3.
If I restart the kernel and then run the code, I consistently get the same output, verifying I have the right directory:
%run "C:/Users/AlexPC/Python Programs/Chess.py"
C:UsersAlexPCDownloads
C:UsersAlexPCDownloads
and the same error:
---------------------------------------------------------------------------
TclError Traceback (most recent call last)
C:UsersAlexPCPython ProgramsChess.py in <module>()
37 print(os.getcwd())
38 s.register_shape("tenor.gif")
---> 39 t.shape("tenor.gif")
40
41
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibturtle.py in shape(self, name)
2775 if not name in self.screen.getshapes():
2776 raise TurtleGraphicsError("There is no shape named %s" % name)
-> 2777 self.turtle._setshape(name)
2778 self._update()
2779
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibturtle.py in _setshape(self, shapeIndex)
2504 self._item = screen._createpoly()
2505 elif self._type == "image":
-> 2506 self._item = screen._createimage(screen._shapes["blank"]._data)
2507 elif self._type == "compound":
2508 self._item = [screen._createpoly() for item in
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibturtle.py in _createimage(self, image)
721 """Create and return image item on canvas.
722 """
--> 723 return self.cv.create_image(0, 0, image=image)
724
725 def _drawimage(self, item, pos, image):
<string> in create_image(self, *args, **kw)
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibtkinter__init__.py in create_image(self, *args, **kw)
2327 def create_image(self, *args, **kw):
2328 """Create image item with coordinates x1,y1."""
-> 2329 return self._create('image', args, kw)
2330 def create_line(self, *args, **kw):
2331 """Create line with coordinates x1,y1,...,xn,yn."""
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibtkinter__init__.py in _create(self, itemType, args, kw)
2318 return self.tk.getint(self.tk.call(
2319 self._w, 'create', itemType,
-> 2320 *(args + self._options(cnf, kw))))
2321 def create_arc(self, *args, **kw):
2322 """Create arc shaped region with coordinates x1,y1,x2,y2."""
TclError: image "pyimage1" doesn't exist
My code:
from turtle import Turtle, Screen
import os
t = Turtle("square")
t.shapesize(4,4)
t.hideturtle()
t.pu()
t.goto(-280,-280)
s = Screen()
s.clearscreen()
s.tracer(False)
s.screensize(800,800)
#register the piece shapes
print(os.getcwd())
os.chdir("C:\Users\AlexPC\Downloads")
print(os.getcwd())
s.register_shape("tenor.gif")
t.shape("tenor.gif")
python python-3.x turtle-graphics
Instead ofs = Screen(), trys = t.getscreen(). I believe you are registering your shape in a different instance ofScreenthan what your turtle is using, thus the inability to find it.
– jasonharper
Nov 23 '18 at 4:27
I tried doing that, but it gives the same error.
– aargon
Nov 23 '18 at 4:59
@jasonharper, there is no "different instance ofScreen" in standalone turtle -- the screen instance is singular and you get the same one fromScreen()as fromTurtle.getscreen(). (If you use turtle embeded in your own tkinter code, you can have separate screen instances running around, but that's not the case here.)
– cdlane
Nov 23 '18 at 9:06
add a comment |
My problem:
I am attempting to register a shape with the python turtle module, however it is refusing to work. The gif in question is this and it is located in my downloads folder with the title tenor.gif. I am running this code in the IDE, Canopy, in Python 3.
If I restart the kernel and then run the code, I consistently get the same output, verifying I have the right directory:
%run "C:/Users/AlexPC/Python Programs/Chess.py"
C:UsersAlexPCDownloads
C:UsersAlexPCDownloads
and the same error:
---------------------------------------------------------------------------
TclError Traceback (most recent call last)
C:UsersAlexPCPython ProgramsChess.py in <module>()
37 print(os.getcwd())
38 s.register_shape("tenor.gif")
---> 39 t.shape("tenor.gif")
40
41
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibturtle.py in shape(self, name)
2775 if not name in self.screen.getshapes():
2776 raise TurtleGraphicsError("There is no shape named %s" % name)
-> 2777 self.turtle._setshape(name)
2778 self._update()
2779
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibturtle.py in _setshape(self, shapeIndex)
2504 self._item = screen._createpoly()
2505 elif self._type == "image":
-> 2506 self._item = screen._createimage(screen._shapes["blank"]._data)
2507 elif self._type == "compound":
2508 self._item = [screen._createpoly() for item in
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibturtle.py in _createimage(self, image)
721 """Create and return image item on canvas.
722 """
--> 723 return self.cv.create_image(0, 0, image=image)
724
725 def _drawimage(self, item, pos, image):
<string> in create_image(self, *args, **kw)
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibtkinter__init__.py in create_image(self, *args, **kw)
2327 def create_image(self, *args, **kw):
2328 """Create image item with coordinates x1,y1."""
-> 2329 return self._create('image', args, kw)
2330 def create_line(self, *args, **kw):
2331 """Create line with coordinates x1,y1,...,xn,yn."""
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibtkinter__init__.py in _create(self, itemType, args, kw)
2318 return self.tk.getint(self.tk.call(
2319 self._w, 'create', itemType,
-> 2320 *(args + self._options(cnf, kw))))
2321 def create_arc(self, *args, **kw):
2322 """Create arc shaped region with coordinates x1,y1,x2,y2."""
TclError: image "pyimage1" doesn't exist
My code:
from turtle import Turtle, Screen
import os
t = Turtle("square")
t.shapesize(4,4)
t.hideturtle()
t.pu()
t.goto(-280,-280)
s = Screen()
s.clearscreen()
s.tracer(False)
s.screensize(800,800)
#register the piece shapes
print(os.getcwd())
os.chdir("C:\Users\AlexPC\Downloads")
print(os.getcwd())
s.register_shape("tenor.gif")
t.shape("tenor.gif")
python python-3.x turtle-graphics
My problem:
I am attempting to register a shape with the python turtle module, however it is refusing to work. The gif in question is this and it is located in my downloads folder with the title tenor.gif. I am running this code in the IDE, Canopy, in Python 3.
If I restart the kernel and then run the code, I consistently get the same output, verifying I have the right directory:
%run "C:/Users/AlexPC/Python Programs/Chess.py"
C:UsersAlexPCDownloads
C:UsersAlexPCDownloads
and the same error:
---------------------------------------------------------------------------
TclError Traceback (most recent call last)
C:UsersAlexPCPython ProgramsChess.py in <module>()
37 print(os.getcwd())
38 s.register_shape("tenor.gif")
---> 39 t.shape("tenor.gif")
40
41
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibturtle.py in shape(self, name)
2775 if not name in self.screen.getshapes():
2776 raise TurtleGraphicsError("There is no shape named %s" % name)
-> 2777 self.turtle._setshape(name)
2778 self._update()
2779
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibturtle.py in _setshape(self, shapeIndex)
2504 self._item = screen._createpoly()
2505 elif self._type == "image":
-> 2506 self._item = screen._createimage(screen._shapes["blank"]._data)
2507 elif self._type == "compound":
2508 self._item = [screen._createpoly() for item in
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibturtle.py in _createimage(self, image)
721 """Create and return image item on canvas.
722 """
--> 723 return self.cv.create_image(0, 0, image=image)
724
725 def _drawimage(self, item, pos, image):
<string> in create_image(self, *args, **kw)
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibtkinter__init__.py in create_image(self, *args, **kw)
2327 def create_image(self, *args, **kw):
2328 """Create image item with coordinates x1,y1."""
-> 2329 return self._create('image', args, kw)
2330 def create_line(self, *args, **kw):
2331 """Create line with coordinates x1,y1,...,xn,yn."""
C:UsersAlexPCAppDataLocalEnthoughtCanopyedmenvsUserlibtkinter__init__.py in _create(self, itemType, args, kw)
2318 return self.tk.getint(self.tk.call(
2319 self._w, 'create', itemType,
-> 2320 *(args + self._options(cnf, kw))))
2321 def create_arc(self, *args, **kw):
2322 """Create arc shaped region with coordinates x1,y1,x2,y2."""
TclError: image "pyimage1" doesn't exist
My code:
from turtle import Turtle, Screen
import os
t = Turtle("square")
t.shapesize(4,4)
t.hideturtle()
t.pu()
t.goto(-280,-280)
s = Screen()
s.clearscreen()
s.tracer(False)
s.screensize(800,800)
#register the piece shapes
print(os.getcwd())
os.chdir("C:\Users\AlexPC\Downloads")
print(os.getcwd())
s.register_shape("tenor.gif")
t.shape("tenor.gif")
python python-3.x turtle-graphics
python python-3.x turtle-graphics
asked Nov 23 '18 at 4:02
aargon
464
464
Instead ofs = Screen(), trys = t.getscreen(). I believe you are registering your shape in a different instance ofScreenthan what your turtle is using, thus the inability to find it.
– jasonharper
Nov 23 '18 at 4:27
I tried doing that, but it gives the same error.
– aargon
Nov 23 '18 at 4:59
@jasonharper, there is no "different instance ofScreen" in standalone turtle -- the screen instance is singular and you get the same one fromScreen()as fromTurtle.getscreen(). (If you use turtle embeded in your own tkinter code, you can have separate screen instances running around, but that's not the case here.)
– cdlane
Nov 23 '18 at 9:06
add a comment |
Instead ofs = Screen(), trys = t.getscreen(). I believe you are registering your shape in a different instance ofScreenthan what your turtle is using, thus the inability to find it.
– jasonharper
Nov 23 '18 at 4:27
I tried doing that, but it gives the same error.
– aargon
Nov 23 '18 at 4:59
@jasonharper, there is no "different instance ofScreen" in standalone turtle -- the screen instance is singular and you get the same one fromScreen()as fromTurtle.getscreen(). (If you use turtle embeded in your own tkinter code, you can have separate screen instances running around, but that's not the case here.)
– cdlane
Nov 23 '18 at 9:06
Instead of
s = Screen(), try s = t.getscreen(). I believe you are registering your shape in a different instance of Screen than what your turtle is using, thus the inability to find it.– jasonharper
Nov 23 '18 at 4:27
Instead of
s = Screen(), try s = t.getscreen(). I believe you are registering your shape in a different instance of Screen than what your turtle is using, thus the inability to find it.– jasonharper
Nov 23 '18 at 4:27
I tried doing that, but it gives the same error.
– aargon
Nov 23 '18 at 4:59
I tried doing that, but it gives the same error.
– aargon
Nov 23 '18 at 4:59
@jasonharper, there is no "different instance of
Screen" in standalone turtle -- the screen instance is singular and you get the same one from Screen() as from Turtle.getscreen(). (If you use turtle embeded in your own tkinter code, you can have separate screen instances running around, but that's not the case here.)– cdlane
Nov 23 '18 at 9:06
@jasonharper, there is no "different instance of
Screen" in standalone turtle -- the screen instance is singular and you get the same one from Screen() as from Turtle.getscreen(). (If you use turtle embeded in your own tkinter code, you can have separate screen instances running around, but that's not the case here.)– cdlane
Nov 23 '18 at 9:06
add a comment |
1 Answer
1
active
oldest
votes
A couple of issues. First, your image link led to an animated GIF -- there's nothing in the turtle documentation about animated GIF support. You'll likely just get a static GIF image at best, nothing at worst.
Second, your example code has unrelated and unecessary stuff. Let's simplify and focus on the problem:
from turtle import Turtle, Screen
import os
screen = Screen()
screen.screensize(800, 800)
os.chdir(""C:\Users\AlexPC\Downloads"")
screen.register_shape("tenor.gif")
turtle = Turtle("tenor.gif")
turtle.penup()
turtle.goto(-280, -280)
screen.mainloop()
This worked for me on a Unix system, putting the image in a "Downloads" directory under my current directory and using a relative os.chdir() to relocate there -- I don't know if this is a Windows-specific problem. Give the above a try to see if it works any better for you.
It seems as though the issue wasn't within the code, but rather the issue laid with my usage of the IDE, Canopy, as I tried the same code in the Python IDLE shell, and it worked just fine.
– aargon
Nov 23 '18 at 18:46
What's more, the issue was specific to something in canopy, the solution I found in this, and told you to switch the 'backend' that canopy uses with PyLab to one called "Inline (SVG)".
– aargon
Nov 23 '18 at 18:57
@aargon, nice detective work. I'm glad you're moving forward again.
– cdlane
Nov 23 '18 at 20:10
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53440518%2fregistering-a-shape-in-pythons-turtle-module%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
A couple of issues. First, your image link led to an animated GIF -- there's nothing in the turtle documentation about animated GIF support. You'll likely just get a static GIF image at best, nothing at worst.
Second, your example code has unrelated and unecessary stuff. Let's simplify and focus on the problem:
from turtle import Turtle, Screen
import os
screen = Screen()
screen.screensize(800, 800)
os.chdir(""C:\Users\AlexPC\Downloads"")
screen.register_shape("tenor.gif")
turtle = Turtle("tenor.gif")
turtle.penup()
turtle.goto(-280, -280)
screen.mainloop()
This worked for me on a Unix system, putting the image in a "Downloads" directory under my current directory and using a relative os.chdir() to relocate there -- I don't know if this is a Windows-specific problem. Give the above a try to see if it works any better for you.
It seems as though the issue wasn't within the code, but rather the issue laid with my usage of the IDE, Canopy, as I tried the same code in the Python IDLE shell, and it worked just fine.
– aargon
Nov 23 '18 at 18:46
What's more, the issue was specific to something in canopy, the solution I found in this, and told you to switch the 'backend' that canopy uses with PyLab to one called "Inline (SVG)".
– aargon
Nov 23 '18 at 18:57
@aargon, nice detective work. I'm glad you're moving forward again.
– cdlane
Nov 23 '18 at 20:10
add a comment |
A couple of issues. First, your image link led to an animated GIF -- there's nothing in the turtle documentation about animated GIF support. You'll likely just get a static GIF image at best, nothing at worst.
Second, your example code has unrelated and unecessary stuff. Let's simplify and focus on the problem:
from turtle import Turtle, Screen
import os
screen = Screen()
screen.screensize(800, 800)
os.chdir(""C:\Users\AlexPC\Downloads"")
screen.register_shape("tenor.gif")
turtle = Turtle("tenor.gif")
turtle.penup()
turtle.goto(-280, -280)
screen.mainloop()
This worked for me on a Unix system, putting the image in a "Downloads" directory under my current directory and using a relative os.chdir() to relocate there -- I don't know if this is a Windows-specific problem. Give the above a try to see if it works any better for you.
It seems as though the issue wasn't within the code, but rather the issue laid with my usage of the IDE, Canopy, as I tried the same code in the Python IDLE shell, and it worked just fine.
– aargon
Nov 23 '18 at 18:46
What's more, the issue was specific to something in canopy, the solution I found in this, and told you to switch the 'backend' that canopy uses with PyLab to one called "Inline (SVG)".
– aargon
Nov 23 '18 at 18:57
@aargon, nice detective work. I'm glad you're moving forward again.
– cdlane
Nov 23 '18 at 20:10
add a comment |
A couple of issues. First, your image link led to an animated GIF -- there's nothing in the turtle documentation about animated GIF support. You'll likely just get a static GIF image at best, nothing at worst.
Second, your example code has unrelated and unecessary stuff. Let's simplify and focus on the problem:
from turtle import Turtle, Screen
import os
screen = Screen()
screen.screensize(800, 800)
os.chdir(""C:\Users\AlexPC\Downloads"")
screen.register_shape("tenor.gif")
turtle = Turtle("tenor.gif")
turtle.penup()
turtle.goto(-280, -280)
screen.mainloop()
This worked for me on a Unix system, putting the image in a "Downloads" directory under my current directory and using a relative os.chdir() to relocate there -- I don't know if this is a Windows-specific problem. Give the above a try to see if it works any better for you.
A couple of issues. First, your image link led to an animated GIF -- there's nothing in the turtle documentation about animated GIF support. You'll likely just get a static GIF image at best, nothing at worst.
Second, your example code has unrelated and unecessary stuff. Let's simplify and focus on the problem:
from turtle import Turtle, Screen
import os
screen = Screen()
screen.screensize(800, 800)
os.chdir(""C:\Users\AlexPC\Downloads"")
screen.register_shape("tenor.gif")
turtle = Turtle("tenor.gif")
turtle.penup()
turtle.goto(-280, -280)
screen.mainloop()
This worked for me on a Unix system, putting the image in a "Downloads" directory under my current directory and using a relative os.chdir() to relocate there -- I don't know if this is a Windows-specific problem. Give the above a try to see if it works any better for you.
answered Nov 23 '18 at 9:01
cdlane
17.4k21043
17.4k21043
It seems as though the issue wasn't within the code, but rather the issue laid with my usage of the IDE, Canopy, as I tried the same code in the Python IDLE shell, and it worked just fine.
– aargon
Nov 23 '18 at 18:46
What's more, the issue was specific to something in canopy, the solution I found in this, and told you to switch the 'backend' that canopy uses with PyLab to one called "Inline (SVG)".
– aargon
Nov 23 '18 at 18:57
@aargon, nice detective work. I'm glad you're moving forward again.
– cdlane
Nov 23 '18 at 20:10
add a comment |
It seems as though the issue wasn't within the code, but rather the issue laid with my usage of the IDE, Canopy, as I tried the same code in the Python IDLE shell, and it worked just fine.
– aargon
Nov 23 '18 at 18:46
What's more, the issue was specific to something in canopy, the solution I found in this, and told you to switch the 'backend' that canopy uses with PyLab to one called "Inline (SVG)".
– aargon
Nov 23 '18 at 18:57
@aargon, nice detective work. I'm glad you're moving forward again.
– cdlane
Nov 23 '18 at 20:10
It seems as though the issue wasn't within the code, but rather the issue laid with my usage of the IDE, Canopy, as I tried the same code in the Python IDLE shell, and it worked just fine.
– aargon
Nov 23 '18 at 18:46
It seems as though the issue wasn't within the code, but rather the issue laid with my usage of the IDE, Canopy, as I tried the same code in the Python IDLE shell, and it worked just fine.
– aargon
Nov 23 '18 at 18:46
What's more, the issue was specific to something in canopy, the solution I found in this, and told you to switch the 'backend' that canopy uses with PyLab to one called "Inline (SVG)".
– aargon
Nov 23 '18 at 18:57
What's more, the issue was specific to something in canopy, the solution I found in this, and told you to switch the 'backend' that canopy uses with PyLab to one called "Inline (SVG)".
– aargon
Nov 23 '18 at 18:57
@aargon, nice detective work. I'm glad you're moving forward again.
– cdlane
Nov 23 '18 at 20:10
@aargon, nice detective work. I'm glad you're moving forward again.
– cdlane
Nov 23 '18 at 20:10
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53440518%2fregistering-a-shape-in-pythons-turtle-module%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Instead of
s = Screen(), trys = t.getscreen(). I believe you are registering your shape in a different instance ofScreenthan what your turtle is using, thus the inability to find it.– jasonharper
Nov 23 '18 at 4:27
I tried doing that, but it gives the same error.
– aargon
Nov 23 '18 at 4:59
@jasonharper, there is no "different instance of
Screen" in standalone turtle -- the screen instance is singular and you get the same one fromScreen()as fromTurtle.getscreen(). (If you use turtle embeded in your own tkinter code, you can have separate screen instances running around, but that's not the case here.)– cdlane
Nov 23 '18 at 9:06