8 Replies - 656 Views - Last Post: 07 May 2013 - 01:55 PM Rate Topic: -----

#1 snow_ninja67  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 29-January 13

How to create a custom shape(")

Posted 07 May 2013 - 10:34 AM

As you have read the Title i whould like to know how to create a custom shape("") because i tried by taking the default arrow and adding a base to it and it gave me an error if someone knows how to do this please tell me how to do it so i can learn :D/>

What i tried: i went into turtle.py and searched for arrow copied the arrow and then pasted it right below and added points and it did not compile when i tried to compile it.
arrow" : Shape("polygon", ((-10,0), (10,0), (0,10))),

i then got this error:
Traceback (most recent call last):
File "C:\Python32\Lib\turtle.py", line 4132, in <module>
demo1()
File "C:\Python32\Lib\turtle.py", line 3982, in demo1
reset()
File "<string>", line 1, in reset
File "C:\Python32\Lib\turtle.py", line 3818, in _getpen
Turtle._pen = Turtle()
File "C:\Python32\Lib\turtle.py", line 3807, in __init__
Turtle._screen = Screen()
File "C:\Python32\Lib\turtle.py", line 3656, in Screen
Turtle._screen = _Screen()
File "C:\Python32\Lib\turtle.py", line 3684, in __init__
TurtleScreen.__init__(self, _Screen._canvas)
File "C:\Python32\Lib\turtle.py", line 969, in __init__
"arrow" : Shape("polygon", ((-10,0),(-5,0),(-5,-25), (5,-25), (5,0) (10,0), (0,10))),
TypeError: 'tuple' object is not callable
>>>


Is This A Good Question/Topic? 0
  • +

Replies To: How to create a custom shape(")

#2 snow_ninja67  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 29-January 13

Re: How to create a custom shape(")

Posted 07 May 2013 - 10:56 AM

View Postsnow_ninja67, on 07 May 2013 - 10:34 AM, said:

As you have read the Title i whould like to know how to create a custom shape("") because i tried by taking the default arrow and adding a base to it and it gave me an error if someone knows how to do this please tell me how to do it so i can learn :D/>/>

What i tried: i went into turtle.py and searched for arrow copied the arrow and then pasted it right below and added points and it did not compile when i tried to compile it.
arrow" : Shape("polygon", ((-10,0), (10,0), (0,10))),

i then got this error:
Traceback (most recent call last):
File "C:\Python32\Lib\turtle.py", line 4132, in <module>
demo1()
File "C:\Python32\Lib\turtle.py", line 3982, in demo1
reset()
File "<string>", line 1, in reset
File "C:\Python32\Lib\turtle.py", line 3818, in _getpen
Turtle._pen = Turtle()
File "C:\Python32\Lib\turtle.py", line 3807, in __init__
Turtle._screen = Screen()
File "C:\Python32\Lib\turtle.py", line 3656, in Screen
Turtle._screen = _Screen()
File "C:\Python32\Lib\turtle.py", line 3684, in __init__
TurtleScreen.__init__(self, _Screen._canvas)
File "C:\Python32\Lib\turtle.py", line 969, in __init__
"arrow" : Shape("polygon", ((-10,0),(-5,0),(-5,-25), (5,-25), (5,0) (10,0), (0,10))),
TypeError: 'tuple' object is not callable
>>>

edit thiers a " before the arrow
Was This Post Helpful? 0
  • +
  • -

#3 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 2875
  • View blog
  • Posts: 9,540
  • Joined: 12-December 12

Re: How to create a custom shape(")

Posted 07 May 2013 - 11:07 AM

You should not be modifying turtle.py, especially if you are not sure what you are doing, as seems the case with your "copy and paste" statement :whistling:.

Read the docs or some other tutorial. If you want to change the shape to other than the default "arrow", "turtle" etc., then you first need to register_shape().

This post has been edited by andrewsw: 07 May 2013 - 11:07 AM

Was This Post Helpful? 1
  • +
  • -

#4 snow_ninja67  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 29-January 13

Re: How to create a custom shape(")

Posted 07 May 2013 - 11:26 AM

View Postandrewsw, on 07 May 2013 - 11:07 AM, said:

You should not be modifying turtle.py, especially if you are not sure what you are doing, as seems the case with your "copy and paste" statement :whistling:/>.

Read the docs or some other tutorial. If you want to change the shape to other than the default "arrow", "turtle" etc., then you first need to register_shape().

thanks sadly websites blocked ill have to look at it at home D:

This post has been edited by snow_ninja67: 07 May 2013 - 11:27 AM

Was This Post Helpful? 0
  • +
  • -

#5 snow_ninja67  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 29-January 13

Re: How to create a custom shape(")

Posted 07 May 2013 - 01:22 PM

View Postandrewsw, on 07 May 2013 - 11:07 AM, said:

You should not be modifying turtle.py, especially if you are not sure what you are doing, as seems the case with your "copy and paste" statement :whistling:/>/>/>.

Read the docs or some other tutorial. If you want to change the shape to other than the default "arrow", "turtle" etc., then you first need to register_shape().

Yay first shape done :D/>/> here it is:
screen=getscreen()
screen.register_shape("awesome",((0,10),(-10,0),(-5,0),(-5,-25),(5,-25),(5,0),(10,0),(0,10))) ## my own awesome shape:D ##

moving forward from this with this can i create my own module of coustom shapes that i can import every time? lets say soemthing like
from cshapes import *

This post has been edited by snow_ninja67: 07 May 2013 - 01:29 PM

Was This Post Helpful? 0
  • +
  • -

#6 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 2875
  • View blog
  • Posts: 9,540
  • Joined: 12-December 12

Re: How to create a custom shape(")

Posted 07 May 2013 - 01:29 PM

That's awesome ;)
Was This Post Helpful? 0
  • +
  • -

#7 snow_ninja67  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 29-January 13

Re: How to create a custom shape(")

Posted 07 May 2013 - 01:46 PM

View Postandrewsw, on 07 May 2013 - 01:29 PM, said:

That's awesome ;)/>

moving forward from this with this can i create my own module of coustom shapes that i can import every time? lets say soemthing like
from cshapes import *

Was This Post Helpful? 0
  • +
  • -

#8 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 2875
  • View blog
  • Posts: 9,540
  • Joined: 12-December 12

Re: How to create a custom shape(")

Posted 07 May 2013 - 01:52 PM

View Postsnow_ninja67, on 07 May 2013 - 08:46 PM, said:

View Postandrewsw, on 07 May 2013 - 01:29 PM, said:

That's awesome ;)/>/>

moving forward from this with this can i create my own module of coustom shapes that i can import every time? lets say soemthing like
from cshapes import *

Yes, probably.
Was This Post Helpful? 0
  • +
  • -

#9 snow_ninja67  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 46
  • Joined: 29-January 13

Re: How to create a custom shape(")

Posted 07 May 2013 - 01:55 PM

View Postandrewsw, on 07 May 2013 - 01:52 PM, said:

View Postsnow_ninja67, on 07 May 2013 - 08:46 PM, said:

View Postandrewsw, on 07 May 2013 - 01:29 PM, said:

That's awesome ;)/>/>/>

moving forward from this with this can i create my own module of coustom shapes that i can import every time? lets say soemthing like
from cshapes import *

Yes, probably.

sweetnesss i read online how to do ittttt god this is to much fun ;p
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1