grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026ž ÷ f£.cO@sdZdZddlZddlZddlZddlZddlZddlm Z m Z m Z ddl m Z ddlmZddd d d d d ddg Zddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.gZd/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}gOZd~dgZeeeeZdd0d3d@dMdQdUd[d]dbdcdedfdqdvdydzgZid€dz6d�d‚6dƒd„6d…d†6ed‡6edˆ6d‰d6dŠd6d‹d6dŒd�6dŽdk6d�dW6d�dA6d�da6ed‘6d’d“6d”d•6d–d—6d˜d)6ed™6Zdšd›„Zdœd�„ZyeeƒWnedžƒYnXGdŸd„deƒZd d¡„Zd¢d£„Zd¤d¥Z fd¦d§„Z!Gd¨d„dej"ƒZ#e!e#ej$d©ƒGdªd«„d«ej%ƒZ&ej$Z$Gd¬d­„d­e'ƒZ(Gd®d¯„d¯e)ƒZ*Gd°d±„d±e)ƒZ+Gd²d„de'ƒZ,Gd³d´„d´e'ƒZ-Gdµd„de(ƒZ.Gd¶d·„d·e'ƒZ/Gd¸d¹„d¹e'ƒZ0Gdºd»„d»e'ƒZ1Gd¼d „d e0e/ƒZ2e2Z3d½d „Z4Gd¾d¿„d¿e.ƒZ5GdÀd „d e2ƒZ6e6Z7dÁd„Z8dÃdÄ„Z9dÅdÆd~„Z:dÇdÈ„Z;ed“Z<ye<d’kr0e;e<ƒnWn4e=k rRedÉe<ƒYnedÊe<ƒYnXdËdÌ„Z>dÍd΄Z?dÏdЄZ@x—eD]�ZAe>eBdÑeAƒƒ\ZCZDeCdÒkr×edÓeCeDƒq“ndÔieAdÕ6eCdÖ6eDd×6ZEeFeEƒe@eBdÑeAƒjƒeBeAƒ_q“Wx—eD]�ZAe>eBdØeAƒƒ\ZCZDeCdÒkrqedÓeCeDƒq-ndÙieAdÕ6eCdÖ6eDd×6ZEeFeEƒe?eBdØeAƒjƒeBeAƒ_q-WeGZHeIdÚkrdÛdÜ„ZJdÝdÞ„ZKdßdà„ZLeKƒeLƒeMƒndS(áu� Turtle graphics is a popular way for introducing programming to kids. It was part of the original Logo programming language developed by Wally Feurzig and Seymour Papert in 1966. Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an ``import turtle``, give it the command turtle.forward(15), and it moves (on-screen!) 15 pixels in the direction it is facing, drawing a line as it moves. Give it the command turtle.right(25), and it rotates in-place 25 degrees clockwise. By combining together these and similar commands, intricate shapes and pictures can easily be drawn. ----- turtle.py This module is an extended reimplementation of turtle.py from the Python standard distribution up to Python 2.5. (See: http://www.python.org) It tries to keep the merits of turtle.py and to be (nearly) 100% compatible with it. This means in the first place to enable the learning programmer to use all the commands, classes and methods interactively when using the module from within IDLE run with the -n switch. Roughly it has the following features added: - Better animation of the turtle movements, especially of turning the turtle. So the turtles can more easily be used as a visual feedback instrument by the (beginning) programmer. - Different turtle shapes, gif-images as turtle shapes, user defined and user controllable turtle shapes, among them compound (multicolored) shapes. Turtle shapes can be stretched and tilted, which makes turtles very versatile geometrical objects. - Fine control over turtle movement and screen updates via delay(), and enhanced tracer() and speed() methods. - Aliases for the most commonly used commands, like fd for forward etc., following the early Logo traditions. This reduces the boring work of typing long sequences of commands, which often occur in a natural way when kids try to program fancy pictures on their first encounter with turtle graphics. - Turtles now have an undo()-method with configurable undo-buffer. - Some simple commands/methods for creating event driven programs (mouse-, key-, timer-events). Especially useful for programming games. - A scrollable Canvas class. The default scrollable Canvas can be extended interactively as needed while playing around with the turtle(s). - A TurtleScreen class with methods controlling background color or background image, window and canvas size and other properties of the TurtleScreen. - There is a method, setworldcoordinates(), to install a user defined coordinate-system for the TurtleScreen. - The implementation uses a 2-vector class named Vec2D, derived from tuple. This class is public, so it can be imported by the application programmer, which makes certain types of computations very natural and compact. - Appearance of the TurtleScreen and the Turtles at startup/import can be configured by means of a turtle.cfg configuration file. The default configuration mimics the appearance of the old turtle module. - If configured appropriately the module reads in docstrings from a docstring dictionary in some different language, supplied separately and replaces the English ones by those read in. There is a utility function write_docstringdict() to write a dictionary with the original (English) docstrings to disc, so it can serve as a template for translations. Behind the scenes there are some features included with possible extensions in mind. These will be commented and documented elsewhere. u-turtle 1.1b- - for Python 3.1 - 4. 5. 2009iN(uisfileusplitujoin(udeepcopy(u simpledialoguScrolledCanvasu TurtleScreenuScreenu RawTurtleuTurtleuRawPenuPenuShapeuVec2Duaddshapeubgcolorubgpicubyeu clearscreenu colormodeudelayu exitonclicku getcanvasu getshapesulistenumainloopumodeunuminputuonkeyu onkeypressu onkeyreleaseu onscreenclickuontimeruregister_shapeu resetscreenu screensizeusetupusetworldcoordinatesu textinpututitleutraceruturtlesuupdateu window_heightu window_widthubackubackwardu begin_fillu begin_polyubkucircleuclearu clearstampu clearstampsucloneucolorudegreesudistanceudotudownuend_filluend_polyufdu fillcolorufillinguforwarduget_polyugetpenu getscreenu get_shapepolyu getturtleugotouheadingu hideturtleuhomeuhtuisdownu isvisibleuleftultuonclickuondragu onreleaseupdupenupencolorupendownupensizeupenupuposupositionupuuradiansurighturesetu resizemodeurtusethu setheadingusetposu setpositionu settiltangleu setundobufferusetxusetyushapeu shapesizeushapetransformu shearfactoru showturtleuspeedustustamputiltu tiltangleutowardsu turtlesizeuundouundobufferentriesuupuwidthuwriteuxcoruycoruwrite_docstringdictudonegà?gè?uheighti�u canvwidthi,u canvheightu leftrightu topbottomustandardgð?i ièuundobuffersizeuclassicublackunoresizeuvisibleuenglishulanguageuturtleu exampleturtleuscreenu examplescreenuPython Turtle Graphicsu using_IDLEcCst|dƒ�}|jƒ}WdQXi}xä|D]Ü}|jƒ}| s1|jdƒr_q1ny|jdƒ\}}Wntd||fƒw1YnX|jƒ}|jƒ}|d krÍt|ƒ}n6y+d |krët|ƒ}n t|ƒ}WnYnX|||(uTKuFrameu__init__uwinfo_toplevelu _rootwindowuwidthuheightu canvwidthu canvheightubguCanvasuSUNKENu_canvasu Scrollbaruxviewu HORIZONTALuhscrolluyviewuvscrollu configureusetu rowconfigureucolumnconfigureugriduresetubinduonResize(uselfumasteruwidthuheightu canvwidthu canvheight((u+/opt/alt/python33/lib64/python3.3/turtle.pyu__init__Ns,  $$$ uScrolledCanvas.__init__c CsÙ|r||_n|r$||_n|r6||_n|jjd|d|j d|j d|jd|jdfƒ|jjd|j|jd|jƒ|jjd|j|jd|jƒ|j ƒdS(u<Adjust canvas and scrollbars according to given canvas size.ubgu scrollregionigà?iN( u canvwidthu canvheightubgu_canvasuconfigu xview_movetouwidthu yview_movetouheightu adjustScrolls(uselfu canvwidthu canvheightubg((u+/opt/alt/python33/lib64/python3.3/turtle.pyuresetgs     uScrolledCanvas.resetcCs|jjƒ}|jjƒ}|jjd|j||jƒ|jjd|j||jƒ||jks€||jkrý|jjddd|ddddddd dd dd d ƒ|j jddd|ddddddd dd dd d ƒn|jj ƒ|j j ƒd S(uA Adjust scrollbars according to window- and canvas-size. gà?upadxiuin_upadyurowucolumniurowspanu columnspanustickyunewsN( u_canvasu winfo_widthu winfo_heightu xview_movetou canvwidthu yview_movetou canvheightuhscrollugriduvscrollu grid_forget(uselfucwidthucheight((u+/opt/alt/python33/lib64/python3.3/turtle.pyu adjustScrollsys""$$ uScrolledCanvas.adjustScrollscCs|jƒdS(uself-explanatoryN(u adjustScrolls(uselfuevent((u+/opt/alt/python33/lib64/python3.3/turtle.pyuonResize‰suScrolledCanvas.onResizecGs|jj|ŒS(u@ 'forward' method, which canvas itself has inherited... (u_canvasubbox(uselfuargs((u+/opt/alt/python33/lib64/python3.3/turtle.pyubbox�suScrolledCanvas.bboxcOs|jj||ŽS(u@ 'forward' method, which canvas itself has inherited... (u_canvasucget(uselfuargsukwargs((u+/opt/alt/python33/lib64/python3.3/turtle.pyucget’suScrolledCanvas.cgetcOs|jj||ŽdS(u@ 'forward' method, which canvas itself has inherited... N(u_canvasuconfig(uselfuargsukwargs((u+/opt/alt/python33/lib64/python3.3/turtle.pyuconfig—suScrolledCanvas.configcOs|jj||ŽdS(u@ 'forward' method, which canvas itself has inherited... N(u_canvasubind(uselfuargsukwargs((u+/opt/alt/python33/lib64/python3.3/turtle.pyubindœsuScrolledCanvas.bindcOs|jj||ŽdS(u@ 'forward' method, which canvas itself has inherited... N(u_canvasuunbind(uselfuargsukwargs((u+/opt/alt/python33/lib64/python3.3/turtle.pyuunbind¡suScrolledCanvas.unbindcCs|jjƒdS(u@ 'forward' method, which canvas itself has inherited... N(u_canvasu focus_force(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu focus_force¦suScrolledCanvas.focus_forceN(u__name__u __module__u __qualname__u__doc__u__init__uNoneuresetu adjustScrollsuonResizeubboxucgetuconfigubinduunbindu focus_force(u __locals__((u+/opt/alt/python33/lib64/python3.3/turtle.pyuScrolledCanvasHs       u_canvascBsn|EeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dS(u_Rootu'Root class for Screen based on Tkinter.cCstjj|ƒdS(N(uTKuTku__init__(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu__init__°su_Root.__init__cCs8t|||||ƒ|_|jjddddƒdS(Nuexpandiufilluboth(uScrolledCanvasu_canvasupack(uselfuwidthuheightucwidthucheight((u+/opt/alt/python33/lib64/python3.3/turtle.pyu setupcanvas³su_Root.setupcanvascCs|jS(N(u_canvas(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _getcanvas·su_Root._getcanvascCs!|jd||||fƒdS(Nu %dx%d%+d%+d(ugeometry(uselfuwidthuheightustartxustarty((u+/opt/alt/python33/lib64/python3.3/turtle.pyu set_geometryºsu_Root.set_geometrycCs|jd|ƒdS(NuWM_DELETE_WINDOW(u wm_protocol(uselfudestroy((u+/opt/alt/python33/lib64/python3.3/turtle.pyu ondestroy½su_Root.ondestroycCs |jƒS(N(uwinfo_screenwidth(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu win_widthÀsu_Root.win_widthcCs |jƒS(N(uwinfo_screenheight(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu win_heightÃsu_Root.win_heightN( u__name__u __module__u __qualname__u__doc__u__init__u setupcanvasu _getcanvasu set_geometryu ondestroyu win_widthu win_height(u __locals__((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_Root®s      u_RootcBsú|EeZdZdZedd„ƒZedd„ƒZdd„Zdd „ZdEdEdEdFd d „Z d d „Z dEdEdEdFdd„Z dd„Zdd„Zdd„Zdd„ZdEdd„Zdd„ZddEdd„ZddEdd „ZddEd!d"„ZddEd#d$„Zd%d&„ZdEd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Zd1d2„Zd3d4„Zd5d6„Z d7d8„Z!d9d:„Z"dEdEdEd;d<„Z#d=d>„Z$d?d@„Z%dAdB„Z&dEdEdEdCdD„Z'dES(GuTurtleScreenBaseuàProvide the basic graphics functionality. Interface between Tkinter and turtle.py. To port turtle.py to some different graphics toolkit a corresponding TurtleScreenBase class has to be implemented. cCs&tjddddƒ}|jƒ|S(u$return a blank image object uwidthiuheight(uTKu PhotoImageublank(uimg((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _blankimageÑs uTurtleScreenBase._blankimagecCstjd|ƒS(u`return an image object containing the imagedata from a gif-file named filename. ufile(uTKu PhotoImage(ufilename((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_imageÙsuTurtleScreenBase._imagecCsº||_t|tƒr3|jj}|jj}nat|jjdƒƒ}t|jjdƒƒ}|jjd| d| d|d|dfƒ||_||_d|_|_ dS(Nuwidthuheightu scrollregionigð?( ucvu isinstanceuScrolledCanvasu canvwidthu canvheightuintucgetuconfiguxscaleuyscale(uselfucvuwuh((u+/opt/alt/python33/lib64/python3.3/turtle.pyu__init__às  1  uTurtleScreenBase.__init__cCs|jjdddddƒS(u<Create an invisible polygon item on canvas self.cv) iufilluuoutline(iiiiii(ucvucreate_polygon(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _createpolyísuTurtleScreenBase._createpolyc Csåg}x=|D]5\}} |j||jƒ|j| |jƒq W|jj||Œ|dk r~|jj|d|ƒn|dk r£|jj|d|ƒn|dk rÈ|jj|d|ƒn|rá|jj|ƒndS(u`Configure polygonitem polyitem according to provided arguments: coordlist is sequence of coordinates fill is filling color outline is outline color top is a boolean value, which specifies if polyitem will be put on top of the canvas' displaylist so it will not be covered by other items. ufilluoutlineuwidthN(uappenduxscaleuyscaleucvucoordsuNoneu itemconfigureu tag_raise( uselfupolyitemu coordlistufilluoutlineuwidthutopucluxuy((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _drawpolyòs    uTurtleScreenBase._drawpolyc Cs.|jjdddddddddtjƒS(u9Create an invisible line item on canvas self.cv) iufilluuwidthiucapstyle(ucvu create_lineuTKuROUND(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _createline s$uTurtleScreenBase._createlinec CsÏ|dk rhg}x=|D]5\}}|j||jƒ|j| |jƒqW|jj||Œn|dk r�|jj|d|ƒn|dk r²|jj|d|ƒn|rË|jj|ƒndS(uQConfigure lineitem according to provided arguments: coordlist is sequence of coordinates fill is drawing color width is width of drawn line. top is a boolean value, which specifies if polyitem will be put on top of the canvas' displaylist so it will not be covered by other items. ufilluwidthN(uNoneuappenduxscaleuyscaleucvucoordsu itemconfigureu tag_raise( uselfulineitemu coordlistufilluwidthutopucluxuy((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _drawlines   uTurtleScreenBase._drawlinecCs|jj|ƒdS(u]Delete graphics item from canvas. If item is"all" delete all graphics items. N(ucvudelete(uselfuitem((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_delete(suTurtleScreenBase._deletecCs|jjƒdS(u(Redraw graphics items on canvas N(ucvuupdate(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_update.suTurtleScreenBase._updatecCs|jj|ƒdS(u-Delay subsequent canvas actions for delay ms.N(ucvuafter(uselfudelay((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_delay3suTurtleScreenBase._delayc Cs>y|jj|ƒ}d}Wntjk r9d}YnX|S(uCCheck if the string color is a legal Tkinter color string. TF(ucvu winfo_rgbuTrueuTKuTclErroruFalse(uselfucolorurgbuok((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_iscolorstring7s   uTurtleScreenBase._iscolorstringcCs@|dk r,|jjd|ƒ|jƒn|jjdƒSdS(uVSet canvas' backgroundcolor if color is not None, else return backgroundcolor.ubgN(uNoneucvuconfigu_updateucget(uselfucolor((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_bgcolorAs  uTurtleScreenBase._bgcolorc Cs°|\}}||j}||j}idd6dd6dd6}|jj|d| d|d ||d |d |ƒ} |jj| ƒ\} } } } |jjƒ| | dfS( u�Write txt at pos in canvas with specified font and color. Return text item and x-coord of right bottom corner of text's bounding box.uswuleftusucenteruseurightiutextuanchorufillufont(uxscaleuyscaleucvu create_textubboxuupdate(uselfuposutxtualignufontupencoloruxuyuanchoruitemux0uy0ux1uy1((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_writeJs   ' uTurtleScreenBase._writeics\ˆdkr&ˆjj|d|ƒn2‡‡fdd†}ˆjj|d|||ƒdS(uÚBind fun to mouse-click event on turtle. fun must be a function with two arguments, the coordinates of the clicked point on the canvas. num, the number of the mouse-button defaults to 1 u csKˆjj|jƒˆjˆjj|jƒ ˆj}}ˆ||ƒdS(N(ucvucanvasxuxuxscaleucanvasyuyuyscale(ueventuxuy(ufunuself(u+/opt/alt/python33/lib64/python3.3/turtle.pyueventfunes!u+TurtleScreenBase._onclick..eventfunN(uNoneucvu tag_unbindutag_bind(uselfuitemufununumuaddueventfun((ufunuselfu+/opt/alt/python33/lib64/python3.3/turtle.pyu_onclick\s uTurtleScreenBase._onclickcs\ˆdkr&ˆjj|d|ƒn2‡‡fdd†}ˆjj|d|||ƒdS(ugBind fun to mouse-button-release event on turtle. fun must be a function with two arguments, the coordinates of the point on the canvas where mouse button is released. num, the number of the mouse-button defaults to 1 If a turtle is clicked, first _onclick-event will be performed, then _onscreensclick-event. ucsKˆjj|jƒˆjˆjj|jƒ ˆj}}ˆ||ƒdS(N(ucvucanvasxuxuxscaleucanvasyuyuyscale(ueventuxuy(ufunuself(u+/opt/alt/python33/lib64/python3.3/turtle.pyueventfunws!u-TurtleScreenBase._onrelease..eventfunN(uNoneucvu tag_unbindutag_bind(uselfuitemufununumuaddueventfun((ufunuselfu+/opt/alt/python33/lib64/python3.3/turtle.pyu _onreleaseks uTurtleScreenBase._onreleasecs\ˆdkr&ˆjj|d|ƒn2‡‡fdd†}ˆjj|d|||ƒdS(uqBind fun to mouse-move-event (with pressed mouse button) on turtle. fun must be a function with two arguments, the coordinates of the actual mouse position on the canvas. num, the number of the mouse-button defaults to 1 Every sequence of mouse-move-events on a turtle is preceded by a mouse-click event on that turtle. uc sZyKˆjj|jƒˆjˆjj|jƒ ˆj}}ˆ||ƒWnYnXdS(N(ucvucanvasxuxuxscaleucanvasyuyuyscale(ueventuxuy(ufunuself(u+/opt/alt/python33/lib64/python3.3/turtle.pyueventfunŠs !u*TurtleScreenBase._ondrag..eventfunN(uNoneucvu tag_unbindutag_bind(uselfuitemufununumuaddueventfun((ufunuselfu+/opt/alt/python33/lib64/python3.3/turtle.pyu_ondrag~s uTurtleScreenBase._ondragcsVˆdkr#ˆjjd|ƒn/‡‡fdd†}ˆjjd|||ƒdS(uGBind fun to mouse-click event on canvas. fun must be a function with two arguments, the coordinates of the clicked point on the canvas. num, the number of the mouse-button defaults to 1 If a turtle is clicked, first _onclick-event will be performed, then _onscreensclick-event. u csKˆjj|jƒˆjˆjj|jƒ ˆj}}ˆ||ƒdS(N(ucvucanvasxuxuxscaleucanvasyuyuyscale(ueventuxuy(ufunuself(u+/opt/alt/python33/lib64/python3.3/turtle.pyueventfunŸs!u1TurtleScreenBase._onscreenclick..eventfunN(uNoneucvuunbindubind(uselfufununumuaddueventfun((ufunuselfu+/opt/alt/python33/lib64/python3.3/turtle.pyu_onscreenclick“s uTurtleScreenBase._onscreenclickcsSˆdkr&|jjd|dƒn)‡fdd†}|jjd||ƒdS(u`Bind fun to key-release event of key. Canvas must have focus. See method listen ucs ˆƒdS(N((uevent(ufun(u+/opt/alt/python33/lib64/python3.3/turtle.pyueventfun¬su0TurtleScreenBase._onkeyrelease..eventfunN(uNoneucvuunbindubind(uselfufunukeyueventfun((ufunu+/opt/alt/python33/lib64/python3.3/turtle.pyu _onkeyrelease¥s uTurtleScreenBase._onkeyreleasecs—ˆdkrH|dkr.|jjddƒq“|jjd|dƒnK‡fdd†}|dkr||jjd|ƒn|jjd||ƒdS(u�If key is given, bind fun to key-press event of key. Otherwise bind fun to any key-press. Canvas must have focus. See method listen. u u cs ˆƒdS(N((uevent(ufun(u+/opt/alt/python33/lib64/python3.3/turtle.pyueventfun»su.TurtleScreenBase._onkeypress..eventfunN(uNoneucvuunbindubind(uselfufunukeyueventfun((ufunu+/opt/alt/python33/lib64/python3.3/turtle.pyu _onkeypress°s   uTurtleScreenBase._onkeypresscCs|jjƒdS(u=Set focus on canvas (in order to collect key-events) N(ucvu focus_force(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_listenÂsuTurtleScreenBase._listencCs6|dkr|jj|ƒn|jj||ƒdS(u?Install a timer, which calls fun after t milliseconds. iN(ucvu after_idleuafter(uselfufunut((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_ontimerÇs uTurtleScreenBase._ontimercCs|jjddd|ƒS(u0Create and return image item on canvas. iuimage(ucvu create_image(uselfuimage((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _createimageÏsuTurtleScreenBase._createimagecCsN|\}}|jj|||j| |jfƒ|jj|d|ƒdS(uZConfigure image item as to draw image object at position (x,y) on canvas) uimageN(ucvucoordsuxscaleuyscaleu itemconfig(uselfuitemuposuimageuxuy((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _drawimageÔs (uTurtleScreenBase._drawimagecCs*|jj|d|ƒ|jj|ƒdS(u³Configure image item as to draw image object at center of canvas. Set item to the first item in the displaylist, so it will be drawn below any other item .uimageN(ucvu itemconfigu tag_lower(uselfuitemuimage((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _setbgpicÜsuTurtleScreenBase._setbgpiccCs|jj|ƒS(uQReturn 'line' or 'polygon' or 'image' depending on type of item. (ucvutype(uselfuitem((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_typeäsuTurtleScreenBase._typecsA|jj|ƒ‰‡fdd†tdtˆƒdƒDƒ}|S(u returns list of coordinate-pairs of points of item Example (for insiders): >>> from turtle import * >>> getscreen()._pointlist(getturtle().turtle._item) [(0.0, 9.9999999999999982), (0.0, -9.9999999999999982), (9.9999999999999982, 0.0)] >>> cs)g|]}ˆ|ˆ|d f‘qS(i((u.0ui(ucl(u+/opt/alt/python33/lib64/python3.3/turtle.pyu ós u/TurtleScreenBase._pointlist..ii(ucvucoordsurangeulen(uselfuitemupl((uclu+/opt/alt/python33/lib64/python3.3/turtle.pyu _pointlistês+uTurtleScreenBase._pointlistcCs#|jjd||||fƒdS(Nu scrollregion(ucvuconfig(uselfusrx1usry1usrx2usry2((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_setscrollregionösu!TurtleScreenBase._setscrollregionc Csª|jjƒ}x”|D]Œ}t|jj|ƒƒ}g}xR|rŽ|dd…\}}|j||ƒ|j||ƒ|dd…}q=W|jj||ŒqWdS(Ni(ucvufind_allulistucoordsuappend( uselfu xscalefactoru yscalefactoruitemsuitemu coordinatesu newcoordlistuxuy((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_rescaleùs  uTurtleScreenBase._rescalecCs©t|jtƒs"|j|jfS||koD|koDdknr_|jj|jjfS|dk rw||_n|dk r�||_n|jj|||ƒdS(uaResize the canvas the turtles are drawing on. Does not alter the drawing window. N(u isinstanceucvuScrolledCanvasu canvwidthu canvheightuNoneureset(uselfu canvwidthu canvheightubg((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_resizes'    uTurtleScreenBase._resizecCs`|jjƒ}|dkr+|jd}n|jjƒ}|dkrV|jd}n||fS(u; Return the width and height of the turtle window. iuwidthuheight(ucvu winfo_widthu winfo_height(uselfuwidthuheight((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _window_sizes  uTurtleScreenBase._window_sizecCstjƒdS(u{Starts event loop - calling Tkinter's mainloop function. No argument. Must be last statement in a turtle graphics program. Must NOT be used if a script is run from within IDLE in -n mode (No subprocess) - for interactive use of turtle graphics. Example (for a TurtleScreen instance named screen): >>> screen.mainloop() N(uTKumainloop(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyumainloops uTurtleScreenBase.mainloopcCstj||ƒS(u…Pop up a dialog window for input of a string. Arguments: title is the title of the dialog window, prompt is a text mostly describing what information to input. Return the string input If the dialog is canceled, return None. Example (for a TurtleScreen instance named screen): >>> screen.textinput("NIM", "Name of first player:") (u simpledialogu askstring(uselfutitleuprompt((u+/opt/alt/python33/lib64/python3.3/turtle.pyu textinput.s uTurtleScreenBase.textinputc Cs"tj||d|d|d|ƒS(u·Pop up a dialog window for input of a number. Arguments: title is the title of the dialog window, prompt is a text mostly describing what numerical information to input. default: default value minval: minimum value for imput maxval: maximum value for input The number input must be in the range minval .. maxval if these are given. If not, a hint is issued and the dialog remains open for correction. Return the number input. If the dialog is canceled, return None. Example (for a TurtleScreen instance named screen): >>> screen.numinput("Poker", "Your stakes:", 1000, minval=10, maxval=10000) u initialvalueuminvalueumaxvalue(u simpledialoguaskfloat(uselfutitleupromptudefaultuminvalumaxval((u+/opt/alt/python33/lib64/python3.3/turtle.pyunuminput=suTurtleScreenBase.numinputNF((u__name__u __module__u __qualname__u__doc__u staticmethodu _blankimageu_imageu__init__u _createpolyuNoneuFalseu _drawpolyu _createlineu _drawlineu_deleteu_updateu_delayu_iscolorstringu_bgcoloru_writeu_onclicku _onreleaseu_ondragu_onscreenclicku _onkeyreleaseu _onkeypressu_listenu_ontimeru _createimageu _drawimageu _setbgpicu_typeu _pointlistu_setscrollregionu_rescaleu_resizeu _window_sizeumainloopu textinputunuminput(u __locals__((u+/opt/alt/python33/lib64/python3.3/turtle.pyuTurtleScreenBaseÉsH                  uTurtleScreenBasecBs|EeZdZdZdS(u Terminatoru¶Will be raised in TurtleScreen.update, if _RUNNING becomes False. This stops execution of a turtle graphics script. Main purpose: use in the Demo-Viewer turtle.Demo.py. N(u__name__u __module__u __qualname__u__doc__(u __locals__((u+/opt/alt/python33/lib64/python3.3/turtle.pyu TerminatorXsu TerminatorcBs|EeZdZdZdS(uTurtleGraphicsErroruSome TurtleGraphics Error N(u__name__u __module__u __qualname__u__doc__(u __locals__((u+/opt/alt/python33/lib64/python3.3/turtle.pyuTurtleGraphicsErrorasuTurtleGraphicsErrorcBs8|EeZdZdZddd„Zddd„ZdS(uShapeuàData structure modeling shapes. attribute _type is one of "polygon", "image", "compound" attribute _data is - depending on _type a poygon-tuple, an image or a list constructed using the addcomponent method. cCs¼||_|dkr6t|tƒr¯t|ƒ}q¯ny|dkrŠt|tƒr¯|jƒjdƒr‡t|ƒr‡tj |ƒ}q‡q¯n%|dkrŸg}nt d|ƒ‚||_ dS(Nupolygonuimageu.gifucompounduThere is no shape type %s( u_typeu isinstanceulistutupleustruloweruendswithuisfileu TurtleScreenu_imageuTurtleGraphicsErroru_data(uselfutype_udata((u+/opt/alt/python33/lib64/python3.3/turtle.pyu__init__ms   !  uShape.__init__cCsW|jdkr%td|jƒ‚n|dkr:|}n|jj|||gƒdS(u-Add component to a shape of type compound. Arguments: poly is a polygon, i. e. a tuple of number pairs. fill is the fillcolor of the component, outline is the outline color of the component. call (for a Shapeobject namend s): -- s.addcomponent(((0,0), (10,10), (-10,10)), "red", "blue") Example: >>> poly = ((0,0),(10,-5),(0,10),(-10,-5)) >>> s = Shape("compound") >>> s.addcomponent(poly, "red", "blue") >>> # .. add more components and then use register_shape() ucompoundu Cannot add component to %s ShapeN(u_typeuTurtleGraphicsErroruNoneu_datauappend(uselfupolyufilluoutline((u+/opt/alt/python33/lib64/python3.3/turtle.pyu addcomponent}s   uShape.addcomponentN(u__name__u __module__u __qualname__u__doc__uNoneu__init__u addcomponent(u __locals__((u+/opt/alt/python33/lib64/python3.3/turtle.pyuShapefscBsh|EeZdZdZddd„Zddd„Zdd„Zd d „Zd d „Z d d„Z dS(uTbufferu5Ring buffer used as undobuffer for RawTurtle objects.i cCs2||_dgg||_d|_d|_dS(NiiÿÿÿÿF(ubufsizeuNoneubufferuptruFalseucumulate(uselfubufsize((u+/opt/alt/python33/lib64/python3.3/turtle.pyu__init__—s  uTbuffer.__init__cCsb|dkr9xFt|jƒD]}dg|j|>> screen.clear() Note: this method is not available as function. udelayu colormodeualluunopiciiuwhiteiiN(iii(u_CFGu _delayvalueu _colormodeu_deleteu _createimageu_bgpicu _bgpicnameu_tracingu_updatecounteru_turtlesubgcoloruonclickuNoneu onkeypressu_keysuonkeyuTurtleu_pen(uselfubtnukey((u+/opt/alt/python33/lib64/python3.3/turtle.pyuclearäs          uTurtleScreen.clearcCs¨|dkr|jS|jƒ}|dkr>td|ƒ‚n||_|d krš|j|j d|j d|jd|jdƒd|_|_n|j ƒdS( ugSet turtle-mode ('standard', 'logo' or 'world') and perform reset. Optional argument: mode -- on of the strings 'standard', 'logo' or 'world' Mode 'standard' is compatible with turtle.py. Mode 'logo' is compatible with most Logo-Turtle-Graphics. Mode 'world' uses userdefined 'worldcoordinates'. *Attention*: in this mode angles appear distorted if x/y unit-ratio doesn't equal 1. If mode is not given, return the current mode. Mode Initial turtle heading positive angles ------------|-------------------------|------------------- 'standard' to the right (east) counterclockwise 'logo' upward (north) clockwise Examples: >>> mode('logo') # resets turtle heading to north >>> mode() 'logo' ustandardulogouworlduNo turtle-graphics-mode %sigð?N(ustandardulogouworld(ustandardulogo( uNoneu_modeuloweruTurtleGraphicsErroru_setscrollregionu canvwidthu canvheightuxscaleuyscaleureset(uselfumode((u+/opt/alt/python33/lib64/python3.3/turtle.pyumodes     uTurtleScreen.modecCs|jƒdkr"|jdƒnt||ƒ}t||ƒ}|jƒ\}}|j|d|dƒ|j|j} } |j||_|j||_||j} | |j} |j| } |j| }|j| | | |ƒ|j |j| |j| ƒ|j ƒdS(usSet up a user defined coordinate-system. Arguments: llx -- a number, x-coordinate of lower left corner of canvas lly -- a number, y-coordinate of lower left corner of canvas urx -- a number, x-coordinate of upper right corner of canvas ury -- a number, y-coordinate of upper right corner of canvas Set up user coodinat-system and switch to mode 'world' if necessary. This performs a screen.reset. If mode 'world' is already active, all drawings are redrawn according to the new coordinates. But ATTENTION: in user-defined coordinatesystems angles may appear distorted. (see Screen.mode()) Example (for a TurtleScreen instance named screen): >>> screen.setworldcoordinates(-10,-0.5,50,1.5) >>> for _ in range(36): ... left(10) ... forward(0.5) uworldiN( umodeufloatu _window_sizeu screensizeuxscaleuyscaleu canvwidthu canvheightu_setscrollregionu_rescaleuupdate(uselfullxullyuurxuuryuxspanuyspanuwxuwyu oldxscaleu oldyscaleusrx1usry1usrx2usry2((u+/opt/alt/python33/lib64/python3.3/turtle.pyusetworldcoordinates$s    u TurtleScreen.setworldcoordinatescCs�|dkrO|jƒjdƒr<td|j|ƒƒ}qptddƒ‚n!t|tƒrptd|ƒ}n||j|>> screen.register_shape("triangle", ((5,-3),(0,5),(-5,-3))) u.gifuimageu"Bad arguments for register_shape. uUse help(register_shape)upolygonN( uNoneuloweruendswithuShapeu_imageuTurtleGraphicsErroru isinstanceutupleu_shapes(uselfunameushape((u+/opt/alt/python33/lib64/python3.3/turtle.pyuregister_shapeKs  uTurtleScreen.register_shapecCsOt|ƒdkr|d}nt|tƒrf|j|ƒsI|dkrM|Stdt|ƒƒ‚ny|\}}}Wntdt|ƒƒ‚YnX|jdkrÑdd„|||fDƒ\}}}nd|koèd kno"d|kod kno"d|ko d kns>td t|ƒƒ‚nd |||fS( uReturn color string corresponding to args. Argument may be a string or a tuple of three numbers corresponding to actual colormode, i.e. in the range 0<=n<=colormode. If the argument doesn't represent a color, an error is raised. iiuubad color string: %subad color arguments: %sgð?cSs g|]}td|ƒ‘qS(gào@(uround(u.0ux((u+/opt/alt/python33/lib64/python3.3/turtle.pyu „s u*TurtleScreen._colorstr..iÿubad color sequence: %su #%02x%02x%02x(ulenu isinstanceustru_iscolorstringuTurtleGraphicsErroru _colormode(uselfucolorurugub((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _colorstrns  (TuTurtleScreen._colorstrcs¦ˆjdƒsˆStˆƒdkrA‡fdd†d Dƒ}nHtˆƒdkry‡fd d†ˆdd…Dƒ}ntd ˆƒ‚t‡fd d†|DƒƒS( Nu#ics-g|]#}tˆ||d…dƒ‘qS(ii(uint(u.0ui(ucstr(u+/opt/alt/python33/lib64/python3.3/turtle.pyu �s u'TurtleScreen._color..iiiics'g|]}dtˆ|dƒ‘qS(i(uint(u.0uh(ucstr(u+/opt/alt/python33/lib64/python3.3/turtle.pyu �s ubad colorstring: %scs!g|]}|ˆjd‘qS(iÿ(u _colormode(u.0uc(uself(u+/opt/alt/python33/lib64/python3.3/turtle.pyu ’s (iii(u startswithulenuTurtleGraphicsErrorutuple(uselfucstrucl((ucstruselfu+/opt/alt/python33/lib64/python3.3/turtle.pyu_color‰s&uTurtleScreen._colorcCsS|dkr|jS|dkr1t|ƒ|_n|dkrOt|ƒ|_ndS(uqReturn the colormode or set it to 1.0 or 255. Optional argument: cmode -- one of the values 1.0 or 255 r, g, b values of colortriples have to be in range 0..cmode. Example (for a TurtleScreen instance named screen): >>> screen.colormode() 1.0 >>> screen.colormode(255) >>> pencolor(240,160,80) gð?iÿN(uNoneu _colormodeufloatuint(uselfucmode((u+/opt/alt/python33/lib64/python3.3/turtle.pyu colormode”s    uTurtleScreen.colormodecCs2x+|jD] }|j|jƒ|jƒq WdS(u®Reset all Turtles on the Screen to their initial state. No argument. Example (for a TurtleScreen instance named screen): >>> screen.reset() N(u_turtlesu_setmodeu_modeureset(uselfuturtle((u+/opt/alt/python33/lib64/python3.3/turtle.pyureset©suTurtleScreen.resetcCs|jS(u»Return the list of turtles on the screen. Example (for a TurtleScreen instance named screen): >>> screen.turtles() [] (u_turtles(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyuturtlesµsuTurtleScreen.turtlescGsO|r|j|ƒ}nd}|j|ƒ}|dk rK|j|ƒ}n|S(uŸSet or return backgroundcolor of the TurtleScreen. Arguments (if given): a color string or three numbers in the range 0..colormode or a 3-tuple of such numbers. Example (for a TurtleScreen instance named screen): >>> screen.bgcolor("orange") >>> screen.bgcolor() 'orange' >>> screen.bgcolor(0.5,0,0.5) >>> screen.bgcolor() '#800080' N(u _colorstruNoneu_bgcoloru_color(uselfuargsucolor((u+/opt/alt/python33/lib64/python3.3/turtle.pyubgcolor¾s uTurtleScreen.bgcolorcCsc|dkr|jSt|ƒ|_d|_|dk rIt|ƒ|_n|jr_|jƒndS(ueTurns turtle animation on/off and set delay for update drawings. Optional arguments: n -- nonnegative integer delay -- nonnegative integer If n is given, only each n-th regular screen update is really performed. (Can be used to accelerate the drawing of complex graphics.) Second arguments sets delay value (see RawTurtle.delay()) Example (for a TurtleScreen instance named screen): >>> screen.tracer(8, 25) >>> dist = 2 >>> for i in range(200): ... fd(dist) ... rt(90) ... dist += 2 iN(uNoneu_tracinguintu_updatecounteru _delayvalueuupdate(uselfunudelay((u+/opt/alt/python33/lib64/python3.3/turtle.pyutracerÕs    uTurtleScreen.tracercCs&|dkr|jSt|ƒ|_dS(uø Return or set the drawing delay in milliseconds. Optional argument: delay -- positive integer Example (for a TurtleScreen instance named screen): >>> screen.delay(15) >>> screen.delay() 15 N(uNoneu _delayvalueuint(uselfudelay((u+/opt/alt/python33/lib64/python3.3/turtle.pyudelayñs uTurtleScreen.delaycCsRtjsdt_t‚n|jdkrN|jd7_|j|j;_ndS(uIncrement update counter.iiNT(u TurtleScreenu_RUNNINGuTrueu _RUNNNINGu Terminatoru_tracingu_updatecounter(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _incrementudcs    uTurtleScreen._incrementudccCsT|j}d|_x(|jƒD]}|jƒ|jƒqW||_|jƒdS(u'Perform a TurtleScreen update. NT(u_tracinguTrueuturtlesu _update_datau _drawturtleu_update(uselfutracingut((u+/opt/alt/python33/lib64/python3.3/turtle.pyuupdate s    uTurtleScreen.updatecCs|jƒdS(u› Return the width of the turtle window. Example (for a TurtleScreen instance named screen): >>> screen.window_width() 640 i(u _window_size(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu window_widthsuTurtleScreen.window_widthcCs|jƒdS(u� Return the height of the turtle window. Example (for a TurtleScreen instance named screen): >>> screen.window_height() 480 i(u _window_size(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu window_heightsuTurtleScreen.window_heightcCs|jS(uçReturn the Canvas of this TurtleScreen. No argument. Example (for a Screen instance named screen): >>> cv = screen.getcanvas() >>> cv (ucv(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu getcanvas&s uTurtleScreen.getcanvascCst|jjƒƒS(uðReturn a list of names of all currently available turtle shapes. No argument. Example (for a TurtleScreen instance named screen): >>> screen.getshapes() ['arrow', 'blank', 'circle', ... , 'turtle'] (usortedu_shapesukeys(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu getshapes2s uTurtleScreen.getshapesicCs|j|||ƒdS(uêBind fun to mouse-click event on canvas. Arguments: fun -- a function with two arguments, the coordinates of the clicked point on the canvas. num -- the number of the mouse-button, defaults to 1 Example (for a TurtleScreen instance named screen) >>> screen.onclick(goto) >>> # Subsequently clicking into the TurtleScreen will >>> # make the turtle move to the clicked point. >>> screen.onclick(None) N(u_onscreenclick(uselfufunubtnuadd((u+/opt/alt/python33/lib64/python3.3/turtle.pyuonclick=suTurtleScreen.onclickcCsg|dkr1||jkrS|jj|ƒqSn"||jkrS|jj|ƒn|j||ƒdS(umBind fun to key-release event of key. Arguments: fun -- a function with no arguments key -- a string: key (e.g. "a") or key-symbol (e.g. "space") In order to be able to register key-events, TurtleScreen must have focus. (See method listen.) Example (for a TurtleScreen instance named screen): >>> def f(): ... fd(50) ... lt(60) ... >>> screen.onkey(f, "Up") >>> screen.listen() Subsequently the turtle can be moved by repeatedly pressing the up-arrow key, consequently drawing a hexagon N(uNoneu_keysuremoveuappendu _onkeyrelease(uselfufunukey((u+/opt/alt/python33/lib64/python3.3/turtle.pyuonkeyNs  uTurtleScreen.onkeycCss|dkr1||jkr_|jj|ƒq_n.|dk r_||jkr_|jj|ƒn|j||ƒdS(uBind fun to key-press event of key if key is given, or to any key-press-event if no key is given. Arguments: fun -- a function with no arguments key -- a string: key (e.g. "a") or key-symbol (e.g. "space") In order to be able to register key-events, TurtleScreen must have focus. (See method listen.) Example (for a TurtleScreen instance named screen and a Turtle instance named turtle): >>> def f(): ... fd(50) ... lt(60) ... >>> screen.onkeypress(f, "Up") >>> screen.listen() Subsequently the turtle can be moved by repeatedly pressing the up-arrow key, or by keeping pressed the up-arrow key. consequently drawing a hexagon. N(uNoneu_keysuremoveuappendu _onkeypress(uselfufunukey((u+/opt/alt/python33/lib64/python3.3/turtle.pyu onkeypressls  uTurtleScreen.onkeypresscCs|jƒdS(uSet focus on TurtleScreen (in order to collect key-events) No arguments. Dummy arguments are provided in order to be able to pass listen to the onclick method. Example (for a TurtleScreen instance named screen): >>> screen.listen() N(u_listen(uselfuxdummyuydummy((u+/opt/alt/python33/lib64/python3.3/turtle.pyulistenŒs uTurtleScreen.listenicCs|j||ƒdS(uïInstall a timer, which calls fun after t milliseconds. Arguments: fun -- a function with no arguments. t -- a number >= 0 Example (for a TurtleScreen instance named screen): >>> running = True >>> def f(): ... if running: ... fd(50) ... lt(60) ... screen.ontimer(f, 250) ... >>> f() # makes the turtle marching around >>> running = False N(u_ontimer(uselfufunut((u+/opt/alt/python33/lib64/python3.3/turtle.pyuontimer˜suTurtleScreen.ontimercCsb|dkr|jS||jkr;|j|ƒ|j|>> screen.bgpic() 'nopic' >>> screen.bgpic("landscape.gif") >>> screen.bgpic() 'landscape.gif' N(uNoneu _bgpicnameu_bgpicsu_imageu _setbgpicu_bgpic(uselfupicname((u+/opt/alt/python33/lib64/python3.3/turtle.pyubgpic­s  uTurtleScreen.bgpiccCs|j|||ƒS(uÖResize the canvas the turtles are drawing on. Optional arguments: canvwidth -- positive integer, new width of canvas in pixels canvheight -- positive integer, new height of canvas in pixels bg -- colorstring or color-tuple, new backgroundcolor If no arguments are given, return current (canvaswidth, canvasheight) Do not alter the drawing window. To observe hidden parts of the canvas use the scrollbars. (Can make visible those parts of a drawing, which were outside the canvas before!) Example (for a Turtle instance named turtle): >>> turtle.screensize(2000,1500) >>> # e.g. to search for an erroneously escaped turtle ;-) (u_resize(uselfu canvwidthu canvheightubg((u+/opt/alt/python33/lib64/python3.3/turtle.pyu screensizeÅsuTurtleScreen.screensizeNT('u__name__u __module__u __qualname__u__doc__uTrueu_RUNNINGu_CFGu__init__uclearuNoneumodeusetworldcoordinatesuregister_shapeu _colorstru_coloru colormodeuresetuturtlesubgcolorutracerudelayu _incrementudcuupdateu window_widthu window_heightu getcanvasu getshapesuonclickuonkeyu onkeypressulistenuontimerubgpicu screensizeu onscreenclicku resetscreenu clearscreenuaddshapeu onkeyrelease(u __locals__((u+/opt/alt/python33/lib64/python3.3/turtle.pyu TurtleScreen»sD " '#       cBs |EeZdZdZieddƒd6eddƒd6eddƒd6ZdZdZdZed d „Z d d „Z dBd d„Z dd„Z ddd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zd d!„Zd"d#„Zd$d%„Zd&d'„Zd(d)„ZdBd*d+„Zd,d-„Zd.d/„Zd0d1„ZdBd2d3„ZdBd4d5„Zd6d7„Z d8d9„Z!dBdBd:d;„Z"dd<d=„Z#dBdBd>d?„Z$dBd@dA„Z%eZ&eZ'eZ(eZ)eZ*eZ+eZ,eZ-e!Z.dBS(Cu TNavigatoruRNavigation part of the RawTurtle. Implements methods for turtle movement. gð?gustandarduworldulogoiicCs[|j|_|j|_||_d|_|jƒd|_|j|ƒt j |ƒdS(N( uDEFAULT_ANGLEOFFSETu _angleOffsetuDEFAULT_ANGLEORIENTu _angleOrientu_modeuNoneu undobufferudegreesu_setmodeu TNavigatorureset(uselfumode((u+/opt/alt/python33/lib64/python3.3/turtle.pyu__init__ês       uTNavigator.__init__cCs)tddƒ|_tj|j|_dS(uXreset turtle to its initial values Will be overwritten by parent class gN(uVec2Du _positionu TNavigatoruSTART_ORIENTATIONu_modeu_orient(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyuresetôsuTNavigator.resetcCsj|dkr|jS|dkr#dS||_|d krMd|_d|_n|jd|_d |_dS( u:Set turtle-mode to 'standard', 'world' or 'logo'. ustandardulogouworldNiig@(ustandardulogouworld(ustandarduworldiÿÿÿÿ(uNoneu_modeu _angleOffsetu _angleOrientu _fullcircle(uselfumode((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_setmodeüs      uTNavigator._setmodecCsB||_d||_|jdkr1d|_n |d|_dS(u+Helper function for degrees() and radians()ihustandardig@N(u _fullcircleu _degreesPerAUu_modeu _angleOffset(uselfu fullcircle((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_setDegreesPerAU s    uTNavigator._setDegreesPerAUg€v@cCs|j|ƒdS(u> Set angle measurement units to degrees. Optional argument: fullcircle - a number Set angle measurement units, i. e. set number of 'degrees' for a full circle. Dafault value is 360 degrees. Example (for a Turtle instance named turtle): >>> turtle.left(90) >>> turtle.heading() 90 Change angle measurement unit to grad (also known as gon, grade, or gradian and equals 1/100-th of the right angle.) >>> turtle.degrees(400.0) >>> turtle.heading() 100 N(u_setDegreesPerAU(uselfu fullcircle((u+/opt/alt/python33/lib64/python3.3/turtle.pyudegreessuTNavigator.degreescCs|jdtjƒdS(u Set the angle measurement units to radians. No arguments. Example (for a Turtle instance named turtle): >>> turtle.heading() 90 >>> turtle.radians() >>> turtle.heading() 1.5707963267948966 iN(u_setDegreesPerAUumathupi(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyuradians,s uTNavigator.radianscCs%|j|j|}|j|ƒdS(u)move turtle forward by specified distanceN(u _positionu_orientu_goto(uselfudistanceuende((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_go:suTNavigator._gocCs&||j9}|jj|ƒ|_dS(u=Turn turtle counterclockwise by specified angle if angle > 0.N(u _degreesPerAUu_orienturotate(uselfuangle((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_rotate?s uTNavigator._rotatecCs ||_dS(umove turtle to position end.N(u _position(uselfuend((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_gotoDsuTNavigator._gotocCs|j|ƒdS(uMove the turtle forward by the specified distance. Aliases: forward | fd Argument: distance -- a number (integer or float) Move the turtle forward by the specified distance, in the direction the turtle is headed. Example (for a Turtle instance named turtle): >>> turtle.position() (0.00, 0.00) >>> turtle.forward(25) >>> turtle.position() (25.00,0.00) >>> turtle.forward(-75) >>> turtle.position() (-50.00,0.00) N(u_go(uselfudistance((u+/opt/alt/python33/lib64/python3.3/turtle.pyuforwardHsuTNavigator.forwardcCs|j| ƒdS(uÏMove the turtle backward by distance. Aliases: back | backward | bk Argument: distance -- a number Move the turtle backward by distance ,opposite to the direction the turtle is headed. Do not change the turtle's heading. Example (for a Turtle instance named turtle): >>> turtle.position() (0.00, 0.00) >>> turtle.backward(30) >>> turtle.position() (-30.00, 0.00) N(u_go(uselfudistance((u+/opt/alt/python33/lib64/python3.3/turtle.pyuback_suTNavigator.backcCs|j| ƒdS(uôTurn turtle right by angle units. Aliases: right | rt Argument: angle -- a number (integer or float) Turn turtle right by angle units. (Units are by default degrees, but can be set via the degrees() and radians() functions.) Angle orientation depends on mode. (See this.) Example (for a Turtle instance named turtle): >>> turtle.heading() 22.0 >>> turtle.right(45) >>> turtle.heading() 337.0 N(u_rotate(uselfuangle((u+/opt/alt/python33/lib64/python3.3/turtle.pyurightssuTNavigator.rightcCs|j|ƒdS(uïTurn turtle left by angle units. Aliases: left | lt Argument: angle -- a number (integer or float) Turn turtle left by angle units. (Units are by default degrees, but can be set via the degrees() and radians() functions.) Angle orientation depends on mode. (See this.) Example (for a Turtle instance named turtle): >>> turtle.heading() 22.0 >>> turtle.left(45) >>> turtle.heading() 67.0 N(u_rotate(uselfuangle((u+/opt/alt/python33/lib64/python3.3/turtle.pyuleftˆsuTNavigator.leftcCs|jS(uæReturn the turtle's current location (x,y), as a Vec2D-vector. Aliases: pos | position No arguments. Example (for a Turtle instance named turtle): >>> turtle.pos() (0.00, 240.00) (u _position(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyupos�s uTNavigator.poscCs |jdS(uö Return the turtle's x coordinate. No arguments. Example (for a Turtle instance named turtle): >>> reset() >>> turtle.left(60) >>> turtle.forward(100) >>> print turtle.xcor() 50.0 i(u _position(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyuxcorªs uTNavigator.xcorcCs |jdS(u  Return the turtle's y coordinate --- No arguments. Example (for a Turtle instance named turtle): >>> reset() >>> turtle.left(60) >>> turtle.forward(100) >>> print turtle.ycor() 86.6025403784 i(u _position(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyuycor¸s uTNavigator.ycorcCs<|dkr"|jt|Œƒn|jt||ƒƒdS(utMove turtle to an absolute position. Aliases: setpos | setposition | goto: Arguments: x -- a number or a pair/vector of numbers y -- a number None call: goto(x, y) # two coordinates --or: goto((x, y)) # a pair (tuple) of coordinates --or: goto(vec) # e.g. as returned by pos() Move turtle to an absolute position. If the pen is down, a line will be drawn. The turtle's orientation does not change. Example (for a Turtle instance named turtle): >>> tp = turtle.pos() >>> tp (0.00, 0.00) >>> turtle.setpos(60,30) >>> turtle.pos() (60.00,30.00) >>> turtle.setpos((20,80)) >>> turtle.pos() (20.00,80.00) >>> turtle.setpos(tp) >>> turtle.pos() (0.00,0.00) N(uNoneu_gotouVec2D(uselfuxuy((u+/opt/alt/python33/lib64/python3.3/turtle.pyugotoÇs uTNavigator.gotocCs!|jddƒ|jdƒdS(u$Move turtle to the origin - coordinates (0,0). No arguments. Move turtle to the origin - coordinates (0,0) and set its heading to its start-orientation (which depends on mode). Example (for a Turtle instance named turtle): >>> turtle.home() iN(ugotou setheading(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyuhomeês uTNavigator.homecCs!|jt||jdƒƒdS(u…Set the turtle's first coordinate to x Argument: x -- a number (integer or float) Set the turtle's first coordinate to x, leave second coordinate unchanged. Example (for a Turtle instance named turtle): >>> turtle.position() (0.00, 240.00) >>> turtle.setx(10) >>> turtle.position() (10.00, 240.00) iN(u_gotouVec2Du _position(uselfux((u+/opt/alt/python33/lib64/python3.3/turtle.pyusetxøsuTNavigator.setxcCs!|jt|jd|ƒƒdS(u‡Set the turtle's second coordinate to y Argument: y -- a number (integer or float) Set the turtle's first coordinate to x, second coordinate remains unchanged. Example (for a Turtle instance named turtle): >>> turtle.position() (0.00, 40.00) >>> turtle.sety(-10) >>> turtle.position() (0.00, -10.00) iN(u_gotouVec2Du _position(uselfuy((u+/opt/alt/python33/lib64/python3.3/turtle.pyusety suTNavigator.setycCs€|dk rt||ƒ}nt|tƒr6|}n9t|tƒrTt|Œ}nt|tƒro|j}nt||jƒS(uëReturn the distance from the turtle to (x,y) in turtle step units. Arguments: x -- a number or a pair/vector of numbers or a turtle instance y -- a number None None call: distance(x, y) # two coordinates --or: distance((x, y)) # a pair (tuple) of coordinates --or: distance(vec) # e.g. as returned by pos() --or: distance(mypen) # where mypen is another turtle Example (for a Turtle instance named turtle): >>> turtle.pos() (0.00, 0.00) >>> turtle.distance(30,40) 50.0 >>> pen = Turtle() >>> pen.forward(77) >>> turtle.distance(pen) 77.0 N(uNoneuVec2Du isinstanceutupleu TNavigatoru _positionuabs(uselfuxuyupos((u+/opt/alt/python33/lib64/python3.3/turtle.pyudistances   uTNavigator.distancecCsÒ|dk rt||ƒ}nt|tƒr6|}n9t|tƒrTt|Œ}nt|tƒro|j}n||j\}}ttj||ƒdtj dƒd}||j }|j |j ||j S(uCReturn the angle of the line from the turtle's position to (x, y). Arguments: x -- a number or a pair/vector of numbers or a turtle instance y -- a number None None call: distance(x, y) # two coordinates --or: distance((x, y)) # a pair (tuple) of coordinates --or: distance(vec) # e.g. as returned by pos() --or: distance(mypen) # where mypen is another turtle Return the angle, between the line from turtle-position to position specified by x, y and the turtle's start orientation. (Depends on modes - "standard" or "logo") Example (for a Turtle instance named turtle): >>> turtle.pos() (10.00, 10.00) >>> turtle.towards(0,0) 225.0 g€f@i g€v@N(uNoneuVec2Du isinstanceutupleu TNavigatoru _positionuroundumathuatan2upiu _degreesPerAUu _angleOffsetu _angleOrientu _fullcircle(uselfuxuyuposuresult((u+/opt/alt/python33/lib64/python3.3/turtle.pyutowards<s   * uTNavigator.towardscCs_|j\}}ttj||ƒdtjdƒd}||j}|j|j||jS(u Return the turtle's current heading. No arguments. Example (for a Turtle instance named turtle): >>> turtle.left(67) >>> turtle.heading() 67.0 g€f@i g€v@( u_orienturoundumathuatan2upiu _degreesPerAUu _angleOffsetu _angleOrientu _fullcircle(uselfuxuyuresult((u+/opt/alt/python33/lib64/python3.3/turtle.pyuheading_s * uTNavigator.headingcCsK||jƒ|j}|j}||d||d}|j|ƒdS(užSet the orientation of the turtle to to_angle. Aliases: setheading | seth Argument: to_angle -- a number (integer or float) Set the orientation of the turtle to to_angle. Here are some common directions in degrees: standard - mode: logo-mode: -------------------|-------------------- 0 - east 0 - north 90 - north 90 - east 180 - west 180 - south 270 - south 270 - west Example (for a Turtle instance named turtle): >>> turtle.setheading(90) >>> turtle.heading() 90 g@N(uheadingu _angleOrientu _fullcircleu_rotate(uselfuto_angleuangleufull((u+/opt/alt/python33/lib64/python3.3/turtle.pyu setheadingns uTNavigator.setheadingc Csõ|jr+|jjdgƒd |j_n|jƒ}|d krO|j}n|d krœt|ƒ|j}dtt dt|ƒddƒ|ƒ}nd||}d|}d|t j |t j d |j ƒ}|d kr| | | }}}n|jƒ} |jƒ} |d kr:|jd d ƒn |jd ƒ|j|ƒxHt|ƒD]:} |j|ƒ|j|ƒ|jd ƒ|j|ƒqaW|j| ƒ|d krÌ|j| | ƒn|j|ƒ|jrñd |j_nd S(uë Draw a circle with given radius. Arguments: radius -- a number extent (optional) -- a number steps (optional) -- an integer Draw a circle with given radius. The center is radius units left of the turtle; extent - an angle - determines which part of the circle is drawn. If extent is not given, draw the entire circle. If extent is not a full circle, one endpoint of the arc is the current pen position. Draw the arc in counterclockwise direction if radius is positive, otherwise in clockwise direction. Finally the direction of the turtle is changed by the amount of extent. As the circle is approximated by an inscribed regular polygon, steps determines the number of steps to use. If not given, it will be calculated automatically. Maybe used to draw regular polygons. call: circle(radius) # full circle --or: circle(radius, extent) # arc --or: circle(radius, extent, steps) --or: circle(radius, steps=6) # 6-sided polygon Example (for a Turtle instance named turtle): >>> turtle.circle(50) >>> turtle.circle(120, 180) # semicircle useqii g@g€M@gð?gà?g@g€f@iNTF(u undobufferupushuTrueucumulateuspeeduNoneu _fullcircleuabsuintuminumathusinupiu _degreesPerAUu_traceru_delayu_rotateurangeu_gouFalse( uselfuradiusuextentustepsuspeedufracuwuw2ulutrudlui((u+/opt/alt/python33/lib64/python3.3/turtle.pyucircleŠs>     . )            uTNavigator.circlecCsdS(u/dummy method - to be overwritten by child classN((uselfus((u+/opt/alt/python33/lib64/python3.3/turtle.pyuspeedËsuTNavigator.speedcCsdS(u/dummy method - to be overwritten by child classN((uselfuaub((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_tracerÍsuTNavigator._tracercCsdS(u/dummy method - to be overwritten by child classN((uselfun((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_delayÏsuTNavigator._delayN(/u__name__u __module__u __qualname__u__doc__uVec2DuSTART_ORIENTATIONu DEFAULT_MODEuDEFAULT_ANGLEOFFSETuDEFAULT_ANGLEORIENTu__init__uresetuNoneu_setmodeu_setDegreesPerAUudegreesuradiansu_gou_rotateu_gotouforwardubackurightuleftuposuxcoruycorugotouhomeusetxusetyudistanceutowardsuheadingu setheadingucircleuspeedu_traceru_delayufdubkubackwardurtultupositionusetposu setpositionuseth(u __locals__((u+/opt/alt/python33/lib64/python3.3/turtle.pyu TNavigatorÞsZ            #    #  Au TNavigatorcBsR|EeZdZdZeddd„Zededdd„Zd+d d „Zd+d d „Z d d„Z dd„Z dd„Z d+dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zdd „Zd+d!d"„Zd,d#d$„Zd,d-d%d&„Zd'd(„Zd)d*„Ze Ze Ze Ze Ze ZeZ eZ!d+S(.uTPenuFDrawing part of the RawTurtle. Implements drawing properties. u resizemodecCs#||_d|_tj|ƒdS(N(u _resizemodeuNoneu undobufferuTPenu_reset(uselfu resizemode((u+/opt/alt/python33/lib64/python3.3/turtle.pyu__init__ás  u TPen.__init__upencoloru fillcolorcCsgd|_d|_||_||_d|_d|_d|_d|_d|_ d|_ d|_ dS(Niigð?gT(gð?gð?(gð?gggð?( u_pensizeuTrueu_shownu _pencoloru _fillcoloru_drawingu_speedu_stretchfactoru _shearfactoru_tiltu _shapetrafou _outlinewidth(uselfupencoloru fillcolor((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_resetæs          u TPen._resetcCsB|dkr|jS|jƒ}|dkr>|jd|ƒndS(uzSet resizemode to one of the values: "auto", "user", "noresize". (Optional) Argument: rmode -- one of the strings "auto", "user", "noresize" Different resizemodes have the following effects: - "auto" adapts the appearance of the turtle corresponding to the value of pensize. - "user" adapts the appearance of the turtle according to the values of stretchfactor and outlinewidth (outline), which are set by shapesize() - "noresize" no adaption of the turtle's appearance takes place. If no argument is given, return current resizemode. resizemode("user") is called by a call of shapesize with arguments. Examples (for a Turtle instance named turtle): >>> turtle.resizemode("noresize") >>> turtle.resizemode() 'noresize' uautouuserunoresizeu resizemodeN(uautouuserunoresize(uNoneu _resizemodeulowerupen(uselfurmode((u+/opt/alt/python33/lib64/python3.3/turtle.pyu resizemodeôs    uTPen.resizemodecCs'|dkr|jS|jd|ƒdS(u!Set or return the line thickness. Aliases: pensize | width Argument: width -- positive number Set the line thickness to width or return it. If resizemode is set to "auto" and turtleshape is a polygon, that polygon is drawn with the same line thickness. If no argument is given, current pensize is returned. Example (for a Turtle instance named turtle): >>> turtle.pensize() 1 >>> turtle.pensize(10) # from here on lines of width 10 are drawn upensizeN(uNoneu_pensizeupen(uselfuwidth((u+/opt/alt/python33/lib64/python3.3/turtle.pyupensizes u TPen.pensizecCs!|js dS|jddƒdS(u¼Pull the pen up -- no drawing when moving. Aliases: penup | pu | up No argument Example (for a Turtle instance named turtle): >>> turtle.penup() NupendownF(u_drawingupenuFalse(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyupenup's u TPen.penupcCs!|jr dS|jddƒdS(uÂPull the pen down -- drawing when moving. Aliases: pendown | pd | down No argument. Example (for a Turtle instance named turtle): >>> turtle.pendown() NupendownT(u_drawingupenuTrue(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyupendown5s u TPen.pendowncCs|jS(uReturn True if pen is down, False if it's up. No argument. Example (for a Turtle instance named turtle): >>> turtle.penup() >>> turtle.isdown() False >>> turtle.pendown() >>> turtle.isdown() True (u_drawing(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyuisdownCs u TPen.isdowncCs idd6dd6dd6dd6d d 6}|dkr<|jS||krU||}n7d |kold knr†tt|ƒƒ}nd}|jd |ƒdS(u¤ Return or set the turtle's speed. Optional argument: speed -- an integer in the range 0..10 or a speedstring (see below) Set the turtle's speed to an integer value in the range 0 .. 10. If no argument is given: return current speed. If input is a number greater than 10 or smaller than 0.5, speed is set to 0. Speedstrings are mapped to speedvalues in the following way: 'fastest' : 0 'fast' : 10 'normal' : 6 'slow' : 3 'slowest' : 1 speeds from 1 to 10 enforce increasingly faster animation of line drawing and turtle turning. Attention: speed = 0 : *no* animation takes place. forward/back makes turtle jump and likewise left/right make the turtle turn instantly. Example (for a Turtle instance named turtle): >>> turtle.speed(3) iufastesti ufastiunormaliuslowiuslowestgà?g%@uspeedN(uNoneu_speeduinturoundupen(uselfuspeeduspeeds((u+/opt/alt/python33/lib64/python3.3/turtle.pyuspeedRs)   u TPen.speedcGsÀ|ršt|ƒ}|dkr/|d}}n4|dkrJ|\}}n|dkrc|}}n|j|ƒ}|j|ƒ}|jd|d|ƒn"|j|jƒ|j|jƒfSdS(ušReturn or set the pencolor and fillcolor. Arguments: Several input formats are allowed. They use 0, 1, 2, or 3 arguments as follows: color() Return the current pencolor and the current fillcolor as a pair of color specification strings as are returned by pencolor and fillcolor. color(colorstring), color((r,g,b)), color(r,g,b) inputs as in pencolor, set both, fillcolor and pencolor, to the given value. color(colorstring1, colorstring2), color((r1,g1,b1), (r2,g2,b2)) equivalent to pencolor(colorstring1) and fillcolor(colorstring2) and analogously, if the other input format is used. If turtleshape is a polygon, outline and interior of that polygon is drawn with the newly set colors. For mor info see: pencolor, fillcolor Example (for a Turtle instance named turtle): >>> turtle.color('red', 'green') >>> turtle.color() ('red', 'green') >>> colormode(255) >>> color((40, 80, 120), (160, 200, 240)) >>> color() ('#285078', '#a0c8f0') iiiiupencoloru fillcolorN(ulenu _colorstrupenu_coloru _pencoloru _fillcolor(uselfuargsulupcolorufcolor((u+/opt/alt/python33/lib64/python3.3/turtle.pyucolorxs      u TPen.colorcGsO|r;|j|ƒ}||jkr(dS|jd|ƒn|j|jƒSdS(uZ Return or set the pencolor. Arguments: Four input formats are allowed: - pencolor() Return the current pencolor as color specification string, possibly in hex-number format (see example). May be used as input to another color/pencolor/fillcolor call. - pencolor(colorstring) s is a Tk color specification string, such as "red" or "yellow" - pencolor((r, g, b)) *a tuple* of r, g, and b, which represent, an RGB color, and each of r, g, and b are in the range 0..colormode, where colormode is either 1.0 or 255 - pencolor(r, g, b) r, g, and b represent an RGB color, and each of r, g, and b are in the range 0..colormode If turtleshape is a polygon, the outline of that polygon is drawn with the newly set pencolor. Example (for a Turtle instance named turtle): >>> turtle.pencolor('brown') >>> tup = (0.2, 0.8, 0.55) >>> turtle.pencolor(tup) >>> turtle.pencolor() '#33cc8c' Nupencolor(u _colorstru _pencolorupenu_color(uselfuargsucolor((u+/opt/alt/python33/lib64/python3.3/turtle.pyupencolor¦s u TPen.pencolorcGsO|r;|j|ƒ}||jkr(dS|jd|ƒn|j|jƒSdS(u] Return or set the fillcolor. Arguments: Four input formats are allowed: - fillcolor() Return the current fillcolor as color specification string, possibly in hex-number format (see example). May be used as input to another color/pencolor/fillcolor call. - fillcolor(colorstring) s is a Tk color specification string, such as "red" or "yellow" - fillcolor((r, g, b)) *a tuple* of r, g, and b, which represent, an RGB color, and each of r, g, and b are in the range 0..colormode, where colormode is either 1.0 or 255 - fillcolor(r, g, b) r, g, and b represent an RGB color, and each of r, g, and b are in the range 0..colormode If turtleshape is a polygon, the interior of that polygon is drawn with the newly set fillcolor. Example (for a Turtle instance named turtle): >>> turtle.fillcolor('violet') >>> col = turtle.pencolor() >>> turtle.fillcolor(col) >>> turtle.fillcolor(0, .5, 0) Nu fillcolor(u _colorstru _fillcolorupenu_color(uselfuargsucolor((u+/opt/alt/python33/lib64/python3.3/turtle.pyu fillcolorËs uTPen.fillcolorcCs|jddƒdS(uÑMakes the turtle visible. Aliases: showturtle | st No argument. Example (for a Turtle instance named turtle): >>> turtle.hideturtle() >>> turtle.showturtle() ushownNT(upenuTrue(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu showturtleïs uTPen.showturtlecCs|jddƒdS(uYMakes the turtle invisible. Aliases: hideturtle | ht No argument. It's a good idea to do this while you're in the middle of a complicated drawing, because hiding the turtle speeds up the drawing observably. Example (for a Turtle instance named turtle): >>> turtle.hideturtle() ushownNF(upenuFalse(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu hideturtleüsuTPen.hideturtlecCs|jS(uãReturn True if the Turtle is shown, False if it's hidden. No argument. Example (for a Turtle instance named turtle): >>> turtle.hideturtle() >>> print turtle.isvisible(): False (u_shown(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu isvisible s uTPen.isvisiblec Ksöi |jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd 6|j d 6|j d 6}|p}|s„|St |t ƒrœ|}ni}|j |ƒi}x|D]}||||>> turtle.pen(fillcolor="black", pencolor="red", pensize=10) >>> turtle.pen() {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1, 'pencolor': 'red', 'pendown': True, 'fillcolor': 'black', 'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0} >>> penstate=turtle.pen() >>> turtle.color("yellow","") >>> turtle.penup() >>> turtle.pen() {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1, 'pencolor': 'yellow', 'pendown': False, 'fillcolor': '', 'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0} >>> p.pen(penstate, fillcolor="green") >>> p.pen() {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1, 'pencolor': 'red', 'pendown': True, 'fillcolor': 'green', 'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0} ushownupendownupencoloru fillcolorupensizeuspeedu resizemodeu stretchfactoru shearfactoruoutlineutiltupenNFT(u_shownu_drawingu _pencoloru _fillcoloru_pensizeu_speedu _resizemodeu_stretchfactoru _shearfactoru _outlinewidthu_tiltu isinstanceudictuupdateu undobufferupushuFalseuTrueutupleu _colorstru_newLineuintufloatumathusinucosu _shapetrafou_update(uselfupenupendictu_pdupu_p_bufukeyunewLineusfuscxuscyushfusauca((u+/opt/alt/python33/lib64/python3.3/turtle.pyupen sŒ/                                    $ %#uTPen.pencCsdS(u/dummy method - to be overwritten by child classN((uselfuusePos((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_newLine— su TPen._newLinecCsdS(u/dummy method - to be overwritten by child classN((uselfucountuforced((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_update™ su TPen._updatecCsdS(u/dummy method - to be overwritten by child classN((uselfuargs((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_color› su TPen._colorcCsdS(u/dummy method - to be overwritten by child classN((uselfuargs((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _colorstr� suTPen._colorstrNTF("u__name__u __module__u __qualname__u__doc__u_CFGu__init__u_resetuNoneu resizemodeupensizeupenupupendownuisdownuspeeducolorupencoloru fillcoloru showturtleu hideturtleu isvisibleupenuTrueu_newLineuFalseu_updateu_coloru _colorstruwidthuupupuupdudownustuht(u __locals__((u+/opt/alt/python33/lib64/python3.3/turtle.pyuTPenÝs8    & . % $    uTPencBs2|EeZdZdZdd„Zdd„ZdS(u _TurtleImageu6Helper class: Datatype to store Turtle attributes cCs#||_d|_|j|ƒdS(N(uscreenuNoneu_typeu _setshape(uselfuscreenu shapeIndex((u+/opt/alt/python33/lib64/python3.3/turtle.pyu__init__­ s  u_TurtleImage.__init__cs_|j‰||_|jdko6ˆj|jknr?dS|jdkocˆj|jknrldS|jdkrŽˆj|jƒn3|jdkrÁx!|jD]}ˆj|ƒq§Wnˆj|j|_|jdkrõˆjƒ|_nf|jdkr#ˆjˆjdjƒ|_n8|jdkr[‡fdd†ˆj|jDƒ|_ndS(Nupolygonuimageucompoundublankcsg|]}ˆjƒ‘qS((u _createpoly(u.0uitem(uscreen(u+/opt/alt/python33/lib64/python3.3/turtle.pyu Ä s u*_TurtleImage._setshape..(uimageupolygon( uscreenu shapeIndexu_typeu_shapesu_deleteu_itemu _createpolyu _createimageu_data(uselfu shapeIndexuitem((uscreenu+/opt/alt/python33/lib64/python3.3/turtle.pyu _setshape² s&  ))u_TurtleImage._setshapeN(u__name__u __module__u __qualname__u__doc__u__init__u _setshape(u __locals__((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _TurtleImage© s u _TurtleImagecBsÞ|EeZdZdZgZdledededdd„Zdd„Zd d „Z d d „Z d d„Z dd„Z dd„Z dd„Zdldldd„Zdd„Zdd„Zdd„Zdd„Zdldd „Zdldldld!d"„Zdld#d$„Zd%d&„Zdld'd(„Zd)d*„Zdldldldld+d,„Zd-d.„Zd/d0„Zdmd1d2„Zd3d4„Zd5d6„Z d7d8„Z!d9d:„Z"dld;d<„Z#d=d>„Z$d?d@„Z%dAdB„Z&dndCdD„Z(dEdF„Z)dGdH„Z*dIdJ„Z+dldKdL„Z,dMdN„Z-dmdOdodSdT„Z.dUdV„Z/dWdX„Z0dYdZ„Z1d[d\„Z2d]d^„Z3e3Z4dld_d`„Z5dadldbdc„Z6dadlddde„Z7dadldfdg„Z8dhdi„Z9djdk„Z:eZ;dlS(pu RawTurtleuvAnimation part of the RawTurtle. Puts RawTurtle upon a TurtleScreen and provides tools for its animation. ushapeuundobuffersizeuvisiblecCs¿t|tƒr||_n·t|tƒrX|tjkrLtjj|ƒn||_nzt|ttfƒrÂxbtjD]"}|j |krw||_PqwqwWt|ƒ|_tjj|jƒnt d|ƒ‚|j}t j ||j ƒƒtj |ƒ|jj|ƒ|jƒ|_t||ƒ|_d|_d|_d|_|_||_d|_|jƒ|_|jg|_|jg|_g|_ ||_!t"|ƒ|_#|j$ƒdS(Nubad canvas argument %sF(%u isinstanceu_Screenuscreenu TurtleScreenu RawTurtleuscreensuappenduScrolledCanvasuCanvasucvuTurtleGraphicsErroru TNavigatoru__init__umodeuTPenu_turtlesu _createlineudrawingLineItemu _TurtleImageuturtleuNoneu_polyuFalseu _creatingPolyu _fillitemu _fillpathu_shownu_hidden_from_screenucurrentLineItemu _positionu currentLineuitemsu stampItemsu_undobuffersizeuTbufferu undobufferu_update(uselfucanvasushapeuundobuffersizeuvisibleuscreen((u+/opt/alt/python33/lib64/python3.3/turtle.pyu__init__Ï s@           uRawTurtle.__init__cCs<tj|ƒtj|ƒ|jƒ|jƒ|jƒdS(uäDelete the turtle's drawings and restore its default values. No argument. Delete the turtle's drawings from the screen, re-center the turtle and set variables to the default values. Example (for a Turtle instance named turtle): >>> turtle.position() (0.00,-22.00) >>> turtle.heading() 100.0 >>> turtle.reset() >>> turtle.position() (0.00,0.00) >>> turtle.heading() 0.0 N(u TNavigatoruresetuTPenu_resetu_clearu _drawturtleu_update(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyureset÷ s     uRawTurtle.resetcCs+|dkrd|_nt|ƒ|_dS(u¢Set or disable undobuffer. Argument: size -- an integer or None If size is an integer an empty undobuffer of given size is installed. Size gives the maximum number of turtle-actions that can be undone by the undo() function. If size is None, no undobuffer is present. Example (for a Turtle instance named turtle): >>> turtle.setundobuffer(42) N(uNoneu undobufferuTbuffer(uselfusize((u+/opt/alt/python33/lib64/python3.3/turtle.pyu setundobuffer s  uRawTurtle.setundobuffercCs |jdkrdS|jjƒS(u¾Return count of entries in the undobuffer. No argument. Example (for a Turtle instance named turtle): >>> while undobufferentries(): ... undo() iN(u undobufferuNoneu nr_of_items(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyuundobufferentries# s uRawTurtle.undobufferentriescCs›d|_|_x!|jD]}|jj|ƒqW|jjƒ|_g|_|j rn|jj |j ƒn|jg|_|j ƒ|j |jƒdS(uDelete all of pen's drawingsN(uNoneu _fillitemu _fillpathuitemsuscreenu_deleteu _createlineucurrentLineItemu currentLineu_drawinguappendu _positionu clearstampsu setundobufferu_undobuffersize(uselfuitem((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_clear0 s   uRawTurtle._clearcCs|jƒ|jƒdS(ugDelete the turtle's drawings from the screen. Do not move turtle. No arguments. Delete the turtle's drawings from the screen. Do not move turtle. State and position of the turtle as well as drawings of other turtles are not affected. Examples (for a Turtle instance named turtle): >>> turtle.clear() N(u_clearu_update(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyuclear> s uRawTurtle.clearcCsd|jjƒ|jjdkr#dSt|jƒdkr`|jj|j|j|j|jƒndS(Nii( uscreenu _incrementudcu_updatecounterulenu currentLineu _drawlineucurrentLineItemu _pencoloru_pensize(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _update_dataM s  uRawTurtle._update_datacCs§|j}|jdkrdS|jdkr\|jƒ|jƒ|jƒ|j|jƒnG|jƒ|jdkr£x|jƒD]}|jƒq‚W|jƒndS(u&Perform a Turtle-data update. iNi( uscreenu_tracingu _update_datau _drawturtleu_updateu_delayu _delayvalueu_updatecounteruturtles(uselfuscreenut((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_updateU s     uRawTurtle._updatecCs|jj||ƒS(umTurns turtle animation on/off and set delay for update drawings. Optional arguments: n -- nonnegative integer delay -- nonnegative integer If n is given, only each n-th regular screen update is really performed. (Can be used to accelerate the drawing of complex graphics.) Second arguments sets delay value (see RawTurtle.delay()) Example (for a Turtle instance named turtle): >>> turtle.tracer(8, 25) >>> dist = 2 >>> for i in range(200): ... turtle.fd(dist) ... turtle.rt(90) ... dist += 2 (uscreenutracer(uselfuflagudelay((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_tracerg suRawTurtle._tracercCs|jj|ƒS(N(uscreenu_color(uselfuargs((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_color| suRawTurtle._colorcCs|jj|ƒS(N(uscreenu _colorstr(uselfuargs((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _colorstr suRawTurtle._colorstrcCsÿt|tƒr|Sy|\}}}Wntdt|ƒƒ‚YnX|jjdkr�dd„|||fDƒ\}}}nd|ko˜dknoÒd|ko´dknoÒd|koÐdknsîtdt|ƒƒ‚nd|||fS( u,Convert colortriples to hexstrings. ubad color arguments: %sgð?cSs g|]}td|ƒ‘qS(gào@(uround(u.0ux((u+/opt/alt/python33/lib64/python3.3/turtle.pyu Œ s u!RawTurtle._cc..iiÿubad color sequence: %su #%02x%02x%02x(u isinstanceustruTurtleGraphicsErroruscreenu _colormode(uselfuargsurugub((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_cc‚ s(Tu RawTurtle._cccsC|j‰|j|jƒ|j}d|_d|_t|ƒ}ˆ|_||_ˆ|_tˆ|jjƒ|_ˆjj |ƒˆj |jjj }|dkrºˆj ƒ|j_ nl|dkrèˆjˆj djƒ|j_ n>|dkr&‡fdd†ˆj |jjjDƒ|j_ nˆjƒ|_|jƒ|S(uCreate and return a clone of the turtle. No argument. Create and return a clone of the turtle with same position, heading and turtle properties. Example (for a Turtle instance named mick): mick = Turtle() joe = mick.clone() upolygonuimageublankucompoundcsg|]}ˆjƒ‘qS((u _createpoly(u.0uitem(uscreen(u+/opt/alt/python33/lib64/python3.3/turtle.pyu ³ s u#RawTurtle.clone..N(uscreenu_newLineu_drawinguturtleuNoneudeepcopyu _TurtleImageu shapeIndexu_turtlesuappendu_shapesu_typeu _createpolyu_itemu _createimageu_datau _createlineucurrentLineItemu_update(uselfuturtleuquttype((uscreenu+/opt/alt/python33/lib64/python3.3/turtle.pyuclone‘ s,          " # uRawTurtle.clonecCs\|dkr|jjS||jjƒkr>td|ƒ‚n|jj|ƒ|jƒdS(ußSet turtle shape to shape with given name / return current shapename. Optional argument: name -- a string, which is a valid shapename Set turtle shape to shape with given name or, if name is not given, return name of current shape. Shape with name must exist in the TurtleScreen's shape dictionary. Initially there are the following polygon shapes: 'arrow', 'turtle', 'circle', 'square', 'triangle', 'classic'. To learn about how to deal with shapes see Screen-method register_shape. Example (for a Turtle instance named turtle): >>> turtle.shape() 'arrow' >>> turtle.shape("turtle") >>> turtle.shape() 'turtle' uThere is no shape named %sN(uNoneuturtleu shapeIndexuscreenu getshapesuTurtleGraphicsErroru _setshapeu_update(uselfuname((u+/opt/alt/python33/lib64/python3.3/turtle.pyushape¹ s   uRawTurtle.shapec Cs||ko"|ko"dknrF|j\}}|||jfS|dks^|dkrmtdƒ‚n|dk r£|dkr”||f}qÎ||f}n+|dk rÅ|jd|f}n |j}|dkræ|j}n|jddd|d|ƒdS(uOSet/return turtle's stretchfactors/outline. Set resizemode to "user". Optional arguments: stretch_wid : positive number stretch_len : positive number outline : positive number Return or set the pen's attributes x/y-stretchfactors and/or outline. Set resizemode to "user". If and only if resizemode is set to "user", the turtle will be displayed stretched according to its stretchfactors: stretch_wid is stretchfactor perpendicular to orientation stretch_len is stretchfactor in direction of turtles orientation. outline determines the width of the shapes's outline. Examples (for a Turtle instance named turtle): >>> turtle.resizemode("user") >>> turtle.shapesize(5, 5, 12) >>> turtle.shapesize(outline=8) iu(stretch_wid/stretch_len must not be zerou resizemodeuuseru stretchfactoruoutlineN(uNoneu_stretchfactoru _outlinewidthuTurtleGraphicsErrorupen(uselfu stretch_widu stretch_lenuoutlineu stretchfactor((u+/opt/alt/python33/lib64/python3.3/turtle.pyu shapesizeÔ s '      uRawTurtle.shapesizecCs-|dkr|jS|jddd|ƒdS(u¾Set or return the current shearfactor. Optional argument: shear -- number, tangent of the shear angle Shear the turtleshape according to the given shearfactor shear, which is the tangent of the shear angle. DO NOT change the turtle's heading (direction of movement). If shear is not given: return the current shearfactor, i. e. the tangent of the shear angle, by which lines parallel to the heading of the turtle are sheared. Examples (for a Turtle instance named turtle): >>> turtle.shape("circle") >>> turtle.shapesize(5,2) >>> turtle.shearfactor(0.5) >>> turtle.shearfactor() >>> 0.5 u resizemodeuuseru shearfactorN(uNoneu _shearfactorupen(uselfushear((u+/opt/alt/python33/lib64/python3.3/turtle.pyu shearfactorü s uRawTurtle.shearfactorcCsK| |j|j}|tjddtj}|jddd|ƒdS(uIRotate the turtleshape to point in the specified direction Argument: angle -- number Rotate the turtleshape to point in the direction specified by angle, regardless of its current tilt-angle. DO NOT change the turtle's heading (direction of movement). Examples (for a Turtle instance named turtle): >>> turtle.shape("circle") >>> turtle.shapesize(5,2) >>> turtle.settiltangle(45) >>> stamp() >>> turtle.fd(50) >>> turtle.settiltangle(-45) >>> stamp() >>> turtle.fd(50) g€f@iu resizemodeuuserutiltN(u _degreesPerAUu _angleOrientumathupiupen(uselfuangleutilt((u+/opt/alt/python33/lib64/python3.3/turtle.pyu settiltangle suRawTurtle.settiltanglecCsK|dkr:|j dtj|j}||j|jS|j|ƒdS(u»Set or return the current tilt-angle. Optional argument: angle -- number Rotate the turtleshape to point in the direction specified by angle, regardless of its current tilt-angle. DO NOT change the turtle's heading (direction of movement). If angle is not given: return the current tilt-angle, i. e. the angle between the orientation of the turtleshape and the heading of the turtle (its direction of movement). Deprecated since Python 3.1 Examples (for a Turtle instance named turtle): >>> turtle.shape("circle") >>> turtle.shapesize(5,2) >>> turtle.tilt(45) >>> turtle.tiltangle() g€f@N(uNoneu_tiltumathupiu _angleOrientu _degreesPerAUu _fullcircleu settiltangle(uselfuangleutilt((u+/opt/alt/python33/lib64/python3.3/turtle.pyu tiltangle+ s uRawTurtle.tiltanglecCs|j||jƒƒdS(uÌRotate the turtleshape by angle. Argument: angle - a number Rotate the turtleshape by angle from its current tilt-angle, but do NOT change the turtle's heading (direction of movement). Examples (for a Turtle instance named turtle): >>> turtle.shape("circle") >>> turtle.shapesize(5,2) >>> turtle.tilt(30) >>> turtle.fd(50) >>> turtle.tilt(30) >>> turtle.fd(50) N(u settiltangleu tiltangle(uselfuangle((u+/opt/alt/python33/lib64/python3.3/turtle.pyutiltE suRawTurtle.tiltc Csœ||ko-|ko-|ko-dknr9|jS|j\}}}}|dk rc|}n|dk rx|}n|dk r�|}n|dk r¢|}n||||dkrÉtdƒ‚n||||f|_tj| |ƒdtj} tj| ƒtj| ƒ} } | || || || || || || || |f\} } }}| |f|_| ||_ | |_ |j ƒdS(uÒSet or return the current transformation matrix of the turtle shape. Optional arguments: t11, t12, t21, t22 -- numbers. If none of the matrix elements are given, return the transformation matrix. Otherwise set the given elements and transform the turtleshape according to the matrix consisting of first row t11, t12 and second row t21, 22. Modify stretchfactor, shearfactor and tiltangle according to the given matrix. Examples (for a Turtle instance named turtle): >>> turtle.shape("square") >>> turtle.shapesize(4,2) >>> turtle.shearfactor(-0.5) >>> turtle.shapetransform() (4.0, -1.0, -0.0, 2.0) iu0Bad shape transform matrix: must not be singulariN( uNoneu _shapetrafouTurtleGraphicsErrorumathuatan2upiusinucosu_stretchfactoru _shearfactoru_tiltu_update(uselfut11ut12ut21ut22um11um12um21um22ualfausaucaua11ua12ua21ua22((u+/opt/alt/python33/lib64/python3.3/turtle.pyushapetransformX s,2    0  uRawTurtle.shapetransformcs�|j‰|j\‰‰|j\‰‰tˆˆˆjˆjƒ}dt|ƒ|\‰‰‡‡‡‡‡fdd†|DƒS(ulComputes transformed polygon shapes from a shape according to current position and heading. gð?csQg|]G\}}ˆˆ|ˆ|ˆjˆˆ |ˆ|ˆjf‘qS((uxscaleuyscale(u.0uxuy(ue0ue1up0up1uscreen(u+/opt/alt/python33/lib64/python3.3/turtle.pyu ‰ s u(RawTurtle._polytrafo..(uscreenu _positionu_orientuVec2Duyscaleuxscaleuabs(uselfupolyue((ue0ue1up0up1uscreenu+/opt/alt/python33/lib64/python3.3/turtle.pyu _polytrafo€ s uRawTurtle._polytrafocCsE|jj|jj}|jdkrA|j|j|jdkƒSdS(u@Return the current shape polygon as tuple of coordinate pairs. No argument. Examples (for a Turtle instance named turtle): >>> turtle.shape("square") >>> turtle.shapetransform(4, -1, 0, 2) >>> turtle.get_shapepoly() ((50, -20), (30, 20), (-50, 20), (-30, -20)) upolygonucompoundN(uscreenu_shapesuturtleu shapeIndexu_typeu _getshapepolyu_data(uselfushape((u+/opt/alt/python33/lib64/python3.3/turtle.pyu get_shapepolyŒ s uRawTurtle.get_shapepolycs¬|jdks|r-|j\‰‰‰‰nY|jdkrstd|jdƒ}|dd|f\‰‰‰‰n|jdkr†|St‡‡‡‡fdd†|DƒƒS( u`Calculate transformed shape polygon according to resizemode and shapetransform. uuseruautoig@iunoresizecs:g|]0\}}ˆ|ˆ|ˆ|ˆ|f‘qS(((u.0uxuy(ut11ut12ut21ut22(u+/opt/alt/python33/lib64/python3.3/turtle.pyu ¨ s u+RawTurtle._getshapepoly..(u _resizemodeu _shapetrafoumaxu_pensizeutuple(uselfupolygonucompoundul((ut11ut12ut21ut22u+/opt/alt/python33/lib64/python3.3/turtle.pyu _getshapepoly� s!uRawTurtle._getshapepolyc Csd|j}|j|jj}|j}|jj}|jrÀ|jdkrÀ|jdkrÀd|_ |j }|dkr|j dkrŽd}n$|j dkr©|j }n |j}|j|j|ƒƒ}|j|j}}|j||d|d|d|d dƒq`|d kr-|j||j|ƒq`|d kr`x�t||ƒD]m\} \} }}|j|j| dƒƒ} |j| | d|j|ƒd|j|ƒd|jd dƒqIWq`n |j rÍd S|dkrò|j|dd d ƒne|d kr!|j||j|jdj ƒn6|d krWx'|D]} |j| dd d ƒq4Wnd|_ d S(upManages the correct rendering of the turtle with respect to its shape, resizemode, stretch and tilt etc.iupolygonunoresizeiuautoufilluoutlineuwidthutopuimageucompoundNuublankFT(ii(ii(ii((ii(ii(ii(ii(ii(ii((ii(ii(ii(uscreenu_shapesuturtleu shapeIndexu_typeu_itemu_shownu_updatecounteru_tracinguFalseu_hidden_from_screenu_datau _resizemodeu_pensizeu _outlinewidthu _polytrafou _getshapepolyu _fillcoloru _pencoloru _drawpolyuTrueu _drawimageu _positionuzipu_cc( uselfuscreenushapeuttypeutitemutshapeuwufcuocuitemupoly((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _drawturtleª sF   '        %)     uRawTurtle._drawturtlec Cs|j}|j|jj}|j}|j}|dkrØ|jƒ}|jdkr^d}n$|jdkry|j}n |j }|j |j |ƒƒ}|j |j }}|j||d|d|d|dd ƒn|d kr |jd ƒ}|j||j|ƒnÌ|d krØg}x'|D]} |jƒ} |j| ƒq%Wt|ƒ}x�t||ƒD]m\} \} }}|j |j | d ƒƒ} |j| | d|j|ƒd|j|ƒd|j dd ƒqdWn|jj|ƒ|jjd |fƒ|S(uÅStamp a copy of the turtleshape onto the canvas and return its id. No argument. Stamp a copy of the turtle shape onto the canvas at the current turtle position. Return a stamp_id for that stamp, which can be used to delete it by calling clearstamp(stamp_id). Example (for a Turtle instance named turtle): >>> turtle.color("blue") >>> turtle.stamp() 13 >>> turtle.fd(50) upolygonunoresizeiuautoufilluoutlineuwidthutopuimageuucompoundustampT(uscreenu_shapesuturtleu shapeIndexu_typeu_datau _createpolyu _resizemodeu_pensizeu _outlinewidthu _polytrafou _getshapepolyu _fillcoloru _pencoloru _drawpolyuTrueu _createimageu _drawimageu _positionuappendutupleuzipu_ccu stampItemsu undobufferupush( uselfuscreenushapeuttypeutshapeustitemuwufcuocuelementuitemupoly((u+/opt/alt/python33/lib64/python3.3/turtle.pyustampÒ s>             %&uRawTurtle.stampcCs||jkret|tƒrBx1|D]}|jj|ƒq%Wn|jj|ƒ|jj|ƒnd|f}|j}||jkr�dS|jj|ƒ}|jj|ƒ||j krØ|j d|j |_ n|jj |j d|j dgƒdS(u9does the work for clearstamp() and clearstamps() ustampNi( u stampItemsu isinstanceutupleuscreenu_deleteuremoveu undobufferubufferuindexuptrubufsizeuinsertuNone(uselfustampidusubitemuitemubufuindex((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _clearstampÿ s   uRawTurtle._clearstampcCs|j|ƒ|jƒdS(uDDelete stamp with given stampid Argument: stampid - an integer, must be return value of previous stamp() call. Example (for a Turtle instance named turtle): >>> turtle.color("blue") >>> astamp = turtle.stamp() >>> turtle.fd(50) >>> turtle.clearstamp(astamp) N(u _clearstampu_update(uselfustampid((u+/opt/alt/python33/lib64/python3.3/turtle.pyu clearstamp s uRawTurtle.clearstampcCsƒ|dkr"|jdd…}n5|dkrD|jd|…}n|j|d…}x|D]}|j|ƒq^W|jƒdS(uìDelete all or first/last n of turtle's stamps. Optional argument: n -- an integer If n is None, delete all of pen's stamps, else if n > 0 delete first n stamps else if n < 0 delete last n stamps. Example (for a Turtle instance named turtle): >>> for i in range(8): ... turtle.stamp(); turtle.fd(30) ... >>> turtle.clearstamps(2) >>> turtle.clearstamps(-2) >>> turtle.clearstamps() Ni(uNoneu stampItemsu _clearstampu_update(uselfunutoDeleteuitem((u+/opt/alt/python33/lib64/python3.3/turtle.pyu clearstamps$ s   uRawTurtle.clearstampsc Csr|j|j|jt|jtƒf}|j}d|j|||j|j dd…|j |jƒ|j dd…ff}|j r™|j j |ƒn|j}|jrÜ|jdkrÜ||}|d|jd|d|jd}dt|ddd|j|jƒ}|d |} x„td|ƒD]s} | dkrOd} nd} || | |_|jr�|j|j||jf|j|j| ƒn|jƒq4W|jrÜ|j|jdd d d |jƒqÜn|jrø|j j|ƒnt|jtƒr|jj|ƒn||_|jrB|jj|ƒnt|j ƒd krd|jƒn|jƒdS(u˜Move the pen to the point end, thereby drawing a line if pen is down. All other methods for turtle movement depend on this one. ugoNiiigà?igš™™™™™ñ?gð?ufilluuwidthi*TF(ii(ii((ii(ii(u_drawingu _pencoloru_pensizeu isinstanceu _fillpathulistuscreenu _positionucurrentLineItemu currentLineu _pointlistuitemsu undobufferupushu_speedu_tracinguxscaleuyscaleuinturangeuTrueuFalseu _drawlineudrawingLineItemu_updateuappendu _creatingPolyu_polyulenu_newLine( uselfuendugo_modesuscreenu undo_entryustartudiffudiffsqunhopsudeltaunutop((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_goto@ sR    (*          uRawTurtle._gotocsë|\}}}}|\}}}} |\} } } ‰|j‰t|j|ƒdkretdƒn| |_| |_| ddgkr’d} n|} ˆj| | d| d|ƒ‡‡fdd†|jDƒ}x+|D]#}ˆj|ƒ|jj |ƒqÚW|}|j r2ˆj d kr2||}|dˆj d |d ˆj d }d t|dd d |j |j ƒ}|d |}x{td |ƒD]j}|d kr´d}nd}||||_|rùˆj|j||jf|||ƒn|jƒq™W|r2ˆj|jdddd|ƒq2n||_|jr�t|jƒdkri|jjƒn|jgkr�d|_d|_q�n| rÝ|jgkr»d|_tdƒqÝ|jdk rÝ|jjƒqÝn|jƒdS(u)Reverse a _goto. Used for undo() gà?u$undogoto: HALLO-DA-STIMMT-WAS-NICHT!iuufilluwidthcs7g|]-}|ˆkrˆj|ƒdkr|‘qS(uline(u_type(u.0ui(uitemsuscreen(u+/opt/alt/python33/lib64/python3.3/turtle.pyu ˆ s u'RawTurtle._undogoto..iiigš™™™™™ñ?gð?uUnwahrscheinlich in _undogoto!N(ii(iiTF(ii(ii((ii(ii(uscreenuabsu _positionuprintucurrentLineItemu currentLineu _drawlineuitemsu_deleteuremoveu_speedu_tracinguxscaleuyscaleuinturangeuTrueuFalseudrawingLineItemu_updateu _creatingPolyulenu_polyupopuNoneu _fillpath(uselfuentryuoldunewugo_modesucoodataudrawingupcupsufillingucLIucLupluusepcutodeleteuiustartudiffudiffsqunhopsudeltaunutop((uitemsuscreenu+/opt/alt/python33/lib64/python3.3/turtle.pyu _undogotou sb        (*         uRawTurtle._undogotocCsó|jr(|jjd||jfƒn||j9}|jj|ƒ}|jj}|dkrÜ|jdkrÜd|j}dtt |ƒ|ƒ}d||}x6t |ƒD]%}|jj|ƒ|_|j ƒq°Wn||_|j ƒdS(u&Turns pen clockwise by angle. urotiig@gð?N( u undobufferupushu _degreesPerAUu_orienturotateuscreenu_tracingu_speeduintuabsurangeu_update(uselfuangleu neworientutracinguanglevelustepsudeltau_((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_rotate¶ s     uRawTurtle._rotatecCs t|jƒdkrb|jj|j|j|j|jƒ|jjƒ|_|jj |jƒn|jj|jddƒg|_|rœ|j g|_ndS(u¶Closes current line item and starts a new one. Remark: if current line became too long, animation performance (via _drawline) slowed down considerably. iutopNT( ulenu currentLineuscreenu _drawlineucurrentLineItemu _pencoloru_pensizeu _createlineuitemsuappenduTrueu _position(uselfuusePos((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_newLineÈ s uRawTurtle._newLinecCst|jtƒS(uReturn fillstate (True if filling, False else). No argument. Example (for a Turtle instance named turtle): >>> turtle.begin_fill() >>> if turtle.filling(): ... turtle.pensize(5) ... else: ... turtle.pensize(3) (u isinstanceu _fillpathulist(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyufillingØ s uRawTurtle.fillingcCs€|jƒs4|jjƒ|_|jj|jƒn|jg|_|jƒ|j rr|j j d|jfƒn|j ƒdS(u Called just before drawing a shape to be filled. No argument. Example (for a Turtle instance named turtle): >>> turtle.color("black", "red") >>> turtle.begin_fill() >>> turtle.circle(60) >>> turtle.end_fill() u beginfillN( ufillinguscreenu _createpolyu _fillitemuitemsuappendu _positionu _fillpathu_newLineu undobufferupushu_update(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu begin_fillæ s   uRawTurtle.begin_fillcCsŒ|jƒrˆt|jƒdkrk|jj|j|jd|jƒ|jrk|jjd|jfƒqknd|_|_|j ƒndS(u Fill the shape drawn after the call begin_fill(). No argument. Example (for a Turtle instance named turtle): >>> turtle.color("black", "red") >>> turtle.begin_fill() >>> turtle.circle(60) >>> turtle.end_fill() iufilludofillN( ufillingulenu _fillpathuscreenu _drawpolyu _fillitemu _fillcoloru undobufferupushuNoneu_update(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyuend_fillû s   uRawTurtle.end_fillc GsÅ|stt|ttfƒrF|j|ƒ}|jt|jdƒ}q«|j}|s«|jt|jdƒ}q«n7|dkrœ|jt|jdƒ}n|j|ƒ}t|j dƒr |j j |j ||ƒ}|j j |ƒ|jrÁ|jjd|fƒqÁn´|jƒ}|jrD|jjdgƒd|j_nzT|jƒdkrf|jƒn|jƒ|j|ƒ|j|ƒ|jdƒWd|j|ƒX|jrÁd |j_ndS( uÑDraw a dot with diameter size, using color. Optional arguments: size -- an integer >= 1 (if given) color -- a colorstring or a numeric color tuple Draw a circular dot with diameter size, using color. If size is not given, the maximum of pensize+4 and 2*pensize is used. Example (for a Turtle instance named turtle): >>> turtle.dot() >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50) iu_dotudotusequautoiNTF(u isinstanceustrutupleu _colorstru_pensizeumaxu _pencoloruNoneuhasattruscreenu_dotu _positionuitemsuappendu undobufferupushupenuTrueucumulateu resizemodeuhtupendownupensizeupencoloruforwarduFalse(uselfusizeucoloruitemupen((u+/opt/alt/python33/lib64/python3.3/turtle.pyudot s:          u RawTurtle.dotcCs`|jj|j||||jƒ\}}|jj|ƒ|jr\|jjd|fƒn|S(u)Performs the writing for write() uwri(uscreenu_writeu _positionu _pencoloruitemsuappendu undobufferupush(uselfutxtualignufontuitemuend((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_write? s  uRawTurtle._writeuleftuArialiunormalcCs“|jr+|jjdgƒd|j_n|jt|ƒ|jƒ|ƒ}|rw|jƒ\}}|j||ƒn|jr�d|j_ndS(u÷Write text at the current turtle position. Arguments: arg -- info, which is to be written to the TurtleScreen move (optional) -- True/False align (optional) -- one of the strings "left", "center" or right" font (optional) -- a triple (fontname, fontsize, fonttype) Write text - the string representation of arg - at the current turtle position according to align ("left", "center" or right") and with the given font. If move is True, the pen is moved to the bottom-right corner of the text. By default, move is False. Example (for a Turtle instance named turtle): >>> turtle.write('Home = ', True, align="center") >>> turtle.write((0,0), True) useqNTF( u undobufferupushuTrueucumulateu_writeustruloweruposusetposuFalse(uselfuargumoveualignufontuenduxuy((u+/opt/alt/python33/lib64/python3.3/turtle.pyuwriteI s ! uRawTurtle.writecCs|jg|_d|_dS(uStart recording the vertices of a polygon. No argument. Start recording the vertices of a polygon. Current turtle position is first point of polygon. Example (for a Turtle instance named turtle): >>> turtle.begin_poly() NT(u _positionu_polyuTrueu _creatingPoly(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu begin_polyf s uRawTurtle.begin_polycCs d|_dS(u7Stop recording the vertices of a polygon. No argument. Stop recording the vertices of a polygon. Current turtle position is last point of polygon. This will be connected with the first point. Example (for a Turtle instance named turtle): >>> turtle.end_poly() NF(uFalseu _creatingPoly(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyuend_polyt s uRawTurtle.end_polycCs |jdk rt|jƒSdS(uÔReturn the lastly recorded polygon. No argument. Example (for a Turtle instance named turtle): >>> p = turtle.get_poly() >>> turtle.register_shape("myFavouriteShape", p) N(u_polyuNoneutuple(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyuget_poly� s uRawTurtle.get_polycCs|jS(u˜Return the TurtleScreen object, the turtle is drawing on. No argument. Return the TurtleScreen object, the turtle is drawing on. So TurtleScreen-methods can be called for that object. Example (for a Turtle instance named turtle): >>> ts = turtle.getscreen() >>> ts >>> ts.bgcolor("pink") (uscreen(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu getscreenŽ suRawTurtle.getscreencCs|S(uUReturn the Turtleobject itself. No argument. Only reasonable use: as a function to return the 'anonymous turtle': Example: >>> pet = getturtle() >>> pet.fd(50) >>> pet >>> turtles() [] ((uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyu getturtlež suRawTurtle.getturtlecCs|jj|ƒS(uDSet delay value which determines speed of turtle animation. (uscreenudelay(uselfudelay((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_delay¶ suRawTurtle._delayicCs-|jj|jj|||ƒ|jƒdS(u¹Bind fun to mouse-click event on this turtle on canvas. Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. num -- number of the mouse-button defaults to 1 (left mouse button). add -- True or False. If True, new binding will be added, otherwise it will replace a former binding. Example for the anonymous turtle, i. e. the procedural way: >>> def turn(x, y): ... left(360) ... >>> onclick(turn) # Now clicking into the turtle will turn it. >>> onclick(None) # event-binding will be removed N(uscreenu_onclickuturtleu_itemu_update(uselfufunubtnuadd((u+/opt/alt/python33/lib64/python3.3/turtle.pyuonclick» suRawTurtle.onclickcCs-|jj|jj|||ƒ|jƒdS(uÿBind fun to mouse-button-release event on this turtle on canvas. Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. num -- number of the mouse-button defaults to 1 (left mouse button). Example (for a MyTurtle instance named joe): >>> class MyTurtle(Turtle): ... def glow(self,x,y): ... self.fillcolor("red") ... def unglow(self,x,y): ... self.fillcolor("") ... >>> joe = MyTurtle() >>> joe.onclick(joe.glow) >>> joe.onrelease(joe.unglow) Clicking on joe turns fillcolor red, unclicking turns it to transparent. N(uscreenu _onreleaseuturtleu_itemu_update(uselfufunubtnuadd((u+/opt/alt/python33/lib64/python3.3/turtle.pyu onreleaseÐ suRawTurtle.onreleasecCs#|jj|jj|||ƒdS(u’Bind fun to mouse-move event on this turtle on canvas. Arguments: fun -- a function with two arguments, to which will be assigned the coordinates of the clicked point on the canvas. num -- number of the mouse-button defaults to 1 (left mouse button). Every sequence of mouse-move-events on a turtle is preceded by a mouse-click event on that turtle. Example (for a Turtle instance named turtle): >>> turtle.ondrag(turtle.goto) Subsequently clicking and dragging a Turtle will move it across the screen thereby producing handdrawings (if pen is down). N(uscreenu_ondraguturtleu_item(uselfufunubtnuadd((u+/opt/alt/python33/lib64/python3.3/turtle.pyuondragé suRawTurtle.ondragcCs˜|jdkrdS|dkrV|\}}|j| ||jƒ|jjƒ}n>|dkr||d}|j|ƒn|dkr˜|j|ƒnü|dkrÑ|d}|jj|ƒ|j j |ƒnÃ|dkr |d}|jj |dd d d d ƒn‹|d krd|d}d|_ |_ ||j kr”|jj|ƒ|j j |ƒq”n0|d kr”tj||dƒ|jjƒndS(u2Does the main part of the work for undo() Nurotustampiugouwriudotudofillufilluuoutlineu beginfillupen(uwriudot(ii(ii(ii((ii(ii(ii(u undobufferuNoneu_rotateu _degreesPerAUupopu clearstampu _undogotouscreenu_deleteuitemsuremoveu _drawpolyu _fillitemu _fillpathuTPenupen(uselfuactionudatauangleudegPAUudummyustitemuitem((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_undoþ s8            uRawTurtle._undocCs–|jdkrdS|jjƒ}|d}|dd…}|dkr‚xG|r~|jƒ}|j|d|dd…ƒqKWn|j||ƒdS(u±undo (repeatedly) the last turtle action. No argument. undo (repeatedly) the last turtle action. Number of available undo actions is determined by the size of the undobuffer. Example (for a Turtle instance named turtle): >>> for i in range(4): ... turtle.fd(50); turtle.lt(80) ... >>> for i in range(8): ... turtle.undo() ... Niiuseq(u undobufferuNoneupopu_undo(uselfuitemuactionudata((u+/opt/alt/python33/lib64/python3.3/turtle.pyuundos    %uRawTurtle.undoNFT(uArialiunormal(<u__name__u __module__u __qualname__u__doc__uscreensuNoneu_CFGu__init__uresetu setundobufferuundobufferentriesu_clearuclearu _update_datau_updateu_traceru_coloru _colorstru_ccucloneushapeu shapesizeu shearfactoru settiltangleu tiltangleutiltushapetransformu _polytrafou get_shapepolyuFalseu _getshapepolyu _drawturtleustampu _clearstampu clearstampu clearstampsu_gotou _undogotou_rotateuTrueu_newLineufillingu begin_filluend_filludotu_writeuwriteu begin_polyuend_polyuget_polyu getscreenu getturtleugetpenu_delayuonclicku onreleaseuondragu_undouundou turtlesize(u __locals__((u+/opt/alt/python33/lib64/python3.3/turtle.pyu RawTurtleÈ sp%          ((  (  ( -   5 A    0     cCs%tjdkrtƒt_ntjS(u‡Return the singleton screen object. If none exists at the moment, create a new one and return it, else return the existing one.N(uTurtleu_screenuNoneu_Screen(((u+/opt/alt/python33/lib64/python3.3/turtle.pyuScreenAscBsŽ|EeZdZdZdZedZdd„Zededededdd „Z d d „Z d d „Z dd„Z dd„Z dS(u_ScreenutitlecCsñtjdkrKtƒt_|_|jjtjƒ|jj|jƒntjdkrít d}t d}t d}t d}t d}t d}|jj ||||ƒ|jj ƒt_t j |tjƒ|j||||ƒndS(Nuwidthuheightu canvwidthu canvheightu leftrightu topbottom(u_Screenu_rootuNoneu_Rootutitleu_titleu ondestroyu_destroyu_canvasu_CFGu setupcanvasu _getcanvasu TurtleScreenu__init__usetup(uselfuwidthuheightu canvwidthu canvheightu leftrightu topbottom((u+/opt/alt/python33/lib64/python3.3/turtle.pyu__init__Os      u_Screen.__init__uwidthuheightu leftrightu topbottomc Cst|jdƒsdS|jjƒ}|jjƒ}t|tƒrld|koZdknrl||}n|dkr‰||d}nt|tƒrÁd|ko¯dknrÁ||}n|dkrÞ||d}n|jj||||ƒ|jƒdS(u  Set the size and position of the main window. Arguments: width: as integer a size in pixels, as float a fraction of the screen. Default is 50% of screen. height: as integer the height in pixels, as float a fraction of the screen. Default is 75% of screen. startx: if positive, starting position in pixels from the left edge of the screen, if negative from the right edge Default, startx=None is to center window horizontally. starty: if positive, starting position in pixels from the top edge of the screen, if negative from the bottom edge Default, starty=None is to center window vertically. Examples (for a Screen instance named screen): >>> screen.setup (width=200, height=200, startx=0, starty=0) sets window to 200x200 pixels, in upper left of screen >>> screen.setup(width=.75, height=0.5, startx=None, starty=None) sets window to 75% of screen by 50% of screen and centers u set_geometryNiii( uhasattru_rootu win_widthu win_heightu isinstanceufloatuNoneu set_geometryuupdate(uselfuwidthuheightustartxustartyuswush((u+/opt/alt/python33/lib64/python3.3/turtle.pyusetupes+  +  u _Screen.setupcCs/tjdk r"tjj|ƒn|t_dS(uqSet title of turtle-window Argument: titlestring -- a string, to appear in the titlebar of the turtle graphics window. This is a method of Screen-class. Not available for TurtleScreen- objects. Example (for a Screen instance named screen): >>> screen.title("Welcome to the turtle-zoo!") N(u_Screenu_rootuNoneutitleu_title(uselfu titlestring((u+/opt/alt/python33/lib64/python3.3/turtle.pyutitle�s u _Screen.titlecCsV|j}|tjkr?dt_dt_dt_dt_ndt_ |j ƒdS(NT( u_rootu_ScreenuNoneuTurtleu_penu_screenu_canvasuTrueu TurtleScreenu_RUNNINGudestroy(uselfuroot((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_destroyžs      u_Screen._destroycCs|jƒdS(u~Shut the turtlegraphics window. Example (for a TurtleScreen instance named screen): >>> screen.bye() N(u_destroy(uself((u+/opt/alt/python33/lib64/python3.3/turtle.pyubye¨su _Screen.byec s[‡fdd†}ˆj|ƒtdr-dSy tƒWntk rVtdƒYnXdS(ulGo into mainloop until the mouse is clicked. No arguments. Bind bye() method to mouseclick on TurtleScreen. If "using_IDLE" - value in configuration dictionary is False (default value), enter mainloop. If IDLE with -n switch (no subprocess) is used, this value should be set to True in turtle.cfg. In this case IDLE's mainloop is active also for the client script. This is a method of the Screen-class and not available for TurtleScreen instances. Example (for a Screen instance named screen): >>> screen.exitonclick() csˆjƒdS(u&Screen.bye() with two dummy-parametersN(ubye(uxuy(uself(u+/opt/alt/python33/lib64/python3.3/turtle.pyuexitGracefullyÃsu+_Screen.exitonclick..exitGracefullyu using_IDLENi(uonclicku_CFGumainloopuAttributeErroruexit(uselfuexitGracefully((uselfu+/opt/alt/python33/lib64/python3.3/turtle.pyu exitonclick°s    u_Screen.exitonclickN(u__name__u __module__u __qualname__uNoneu_rootu_canvasu_CFGu_titleu__init__usetuputitleu_destroyubyeu exitonclick(u __locals__((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_ScreenIs  '  u_ScreencBsG|EeZdZdZdZdZedededdd„ZdS(uTurtleuÀRawTurtle auto-creating (scrolled) canvas. When a Turtle object is created or a function derived from some Turtle method is called a TurtleScreen object is automatically created. ushapeuundobuffersizeuvisiblec CsGtjdkrtƒt_ntj|tjd|d|d|ƒdS(Nushapeuundobuffersizeuvisible(uTurtleu_screenuNoneuScreenu RawTurtleu__init__(uselfushapeuundobuffersizeuvisible((u+/opt/alt/python33/lib64/python3.3/turtle.pyu__init__Øs uTurtle.__init__N( u__name__u __module__u __qualname__u__doc__uNoneu_penu_screenu_CFGu__init__(u __locals__((u+/opt/alt/python33/lib64/python3.3/turtle.pyuTurtleÏs cCs%tjdkrtƒt_ntjS(u5Create the 'anonymous' turtle if not already present.N(uTurtleu_penuNone(((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_getpenåsu_getpencCs%tjdkrtƒt_ntjS(u-Create a TurtleScreen if not already present.N(uTurtleu_screenuNoneuScreen(((u+/opt/alt/python33/lib64/python3.3/turtle.pyu _getscreenësu _getscreenuturtle_docstringdictcCs9i}x+tD]#}d|}t|ƒj||.py It is intended to serve as a template for translation of the docstrings into different languages. u_Screen.uTurtle.u%s.pyuwcSs/g|]%}|jdƒdtkr|‘qS(u.i(usplitu _alias_list(u.0ux((u+/opt/alt/python33/lib64/python3.3/turtle.pyu s u'write_docstringdict..udocsdict = { Niu%s : u """%s """, u """%s """ u} iÿÿÿÿiÿÿÿÿ( u_tg_screen_functionsuevalu__doc__u_tg_turtle_functionsuopenusortedukeysuwriteurepruclose(ufilenameudocsdictu methodnameukeyufukeys((u+/opt/alt/python33/lib64/python3.3/turtle.pyuwrite_docstringdictñs$        c Csqdi|jƒd6}t|ƒ}|j}x>|D]6}y||t|ƒ_Wq3td|ƒYq3Xq3WdS(uñRead in docstrings from lang-specific docstring dictionary. Transfer docstrings, translated to lang, from a dictionary-file to the methods of classes Screen and Turtle and - in revised form - to the corresponding functions. u!turtle_docstringdict_%(language)sulanguageuBad docstring-entry: %sN(uloweru __import__udocsdictuevalu__doc__uprint(ulangumodnameumoduleudocsdictukey((u+/opt/alt/python33/lib64/python3.3/turtle.pyuread_docstringss   uread_docstringsuCannot find docsdict foru;Unknown Error when trying to import %s-docstring-dictionaryc CsBd}}tj|jƒ\}}}|dd…}|dd…}|jpQg}dd„|Dƒ}dgt|ƒt|ƒ|}dd„t||ƒDƒ} |dk rÕ| jd|ƒ|jd|ƒn|dk r| jd|ƒ|jd|ƒnd j| ƒ}d |}d j|ƒ}d |}||fS( u?Get strings describing the arguments for the given object Returns a pair of strings representing function parameter lists including parenthesis. The first string is suitable for use in function definition and the second is suitable for use in function call. The "self" parameter is not included. uiNcSsg|]}d|f‘qS(u=%r((u.0uvalue((u+/opt/alt/python33/lib64/python3.3/turtle.pyu @s u"getmethparlist..cSs g|]\}}||‘qS(((u.0uargudflt((u+/opt/alt/python33/lib64/python3.3/turtle.pyu Bs u*u**u, u(%s)( uinspectugetargsu__code__u __defaults__ulenuzipuNoneuappendujoin( uobudefTextucallTextuargsuvarargsuvarkwuitems2urealArgsudefaultsuitems1((u+/opt/alt/python33/lib64/python3.3/turtle.pyugetmethparlist0s& !    ugetmethparlistcCseddl}|dkrdStd}|jd|dƒ}|jd|ƒ}|jd|ƒ}|S(u<To reduce docstrings from RawTurtle class for functions iNu exampleturtleu%s.uu \(.+ %s\):u:(ureuNoneu_CFGureplaceucompileusub(udocstrureu turtlenameu newdocstruparexp((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_turtle_docreviseOs   u_turtle_docrevisecCseddl}|dkrdStd}|jd|dƒ}|jd|ƒ}|jd|ƒ}|S(u?To reduce docstrings from TurtleScreen class for functions iNu examplescreenu%s.uu \(.+ %s\):u:(ureuNoneu_CFGureplaceucompileusub(udocstrureu screennameu newdocstruparexp((u+/opt/alt/python33/lib64/python3.3/turtle.pyu_screen_docrevise[s   u_screen_docreviseu_Screen.uu>>>>>>u6def %(key)s%(pl1)s: return _getscreen().%(key)s%(pl2)sukeyupl1upl2uTurtle.u3def %(key)s%(pl1)s: return _getpen().%(key)s%(pl2)su__main__cCstƒrtƒntƒdS(N(uisdownupuupd(((u+/opt/alt/python33/lib64/python3.3/turtle.pyu switchpen„s  u switchpencCsßtƒtdƒtƒtdƒtƒtdƒx�tdƒD]}|dkr\tƒnx(tdƒD]}t dƒt dƒqiW|dkr§t dƒt ƒntƒt dƒtƒq@Wtd ƒt d ƒtdƒtƒtdƒt dƒtdƒt dƒtd ƒtƒtd d ƒtd d ƒt dƒx<tdƒD].}t dƒt dƒt dƒtdƒqRWtdƒtƒx<tdƒD].}t dƒt dƒt dƒtdƒq¢Wt ƒdS(uDemo of old turtle.py - moduleidiiiiiZumarooniiublacki´u startstartustarturediNTF(uresetutraceruTrueuupubackwardudownuwidthurangeu begin_filluforwarduleftucoloruend_filluFalseurightuwrite(uiu_((u+/opt/alt/python33/lib64/python3.3/turtle.pyudemo1ŠsX                             udemo1cCsLtdƒtƒtdƒttddƒƒtddƒd}tdƒx(tdƒD]}tƒt |dƒqXWt dƒxt ƒr–t ƒqƒWt ƒtdƒtd ƒd}td ƒtdƒtd ƒx¤td-d ƒD]“}|dkrtƒtd d|dd|ƒnx(tdƒD]}t|ƒtdƒq+Wtƒ|d7}tdƒttƒddƒqæWtdƒtƒtdƒtdƒtƒtddƒtdƒtƒx?tdƒD]1}t ddƒtdƒtdƒtdƒqÔWtƒtdƒtƒtdƒtƒtdƒtƒ}|jdƒtƒ}|jdƒ|jdƒ|j ƒ|jdƒ|jdƒ|jƒ|jddƒ|jdƒ|jƒ|jdƒ|jddƒ|jd ƒ|jdƒtt|ƒƒd}xŽ|j|ƒdkr§|jdƒ|jdƒ|j|j|ƒƒ|jdƒ|d dkrš|j ƒ|j ƒtƒn|d7}qW|j d!d"d.d%d&ƒ|jd'ƒ|jdƒd(d)„}t!j"d ƒx!t ƒr|j ƒ|j ƒq÷W|jdƒ|j d*d"d/ƒ|j#|dƒd,S(0uDemo of some new features.iiig@iZii uwait a moment...iÿugreeni´iiiixi iFiureduyellowii2uturtleuautoii(iublueuorangeg @g333333ã?iuCAUGHT! ufontuArialuboldualignurightublackcSstƒtƒdS(N(u clearscreenubye(uxdummyuydummy((u+/opt/alt/python33/lib64/python3.3/turtle.pyubabasudemo2..babau Click me!uCourierNiþÿÿÿ(uArialiubold(uCourieri ubold($uspeedustupensizeu setheadingutowardsudistanceurturangeu switchpenucircleuwriteuundobufferentriesuundouresetultu colormodeupencoloru begin_fillu fillcolorufduend_fillupuupducolorushapeu getturtleu resizemodeuTurtleuleftuupugotoudownustamputimeusleepuonclick(uradiusu_ulaengeuiutriuturtleucountubaba((u+/opt/alt/python33/lib64/python3.3/turtle.pyudemo2¿s°                                                     udemo2(Nu__doc__u_verutkinteruTKutypesumathutimeuinspectuos.pathuisfileusplitujoinucopyudeepcopyu simpledialogu _tg_classesu_tg_screen_functionsu_tg_turtle_functionsu _tg_utilitiesu__all__u _alias_listuNoneuTrueuFalseu_CFGu config_dictu readconfiguprintutupleuVec2Du __methodDictu __methodsu __stringBodyu__forwardmethodsuFrameuScrolledCanvasuCanvasuTku_RootuobjectuTurtleScreenBaseu Exceptionu TerminatoruTurtleGraphicsErroruShapeuTbufferu TurtleScreenu TNavigatoruTPenu _TurtleImageu RawTurtleuRawPenuScreenu_ScreenuTurtleuPenu_getpenu _getscreenuwrite_docstringdicturead_docstringsu _LANGUAGEu ImportErrorugetmethparlistu_turtle_docreviseu_screen_docreviseu methodnameuevalupl1upl2udefstruexecumainloopudoneu__name__u switchpenudemo1udemo2u exitonclick(((u+/opt/alt/python33/lib64/python3.3/turtle.pyues               4 c ÿ� /&ÿÿ%ÿÿÿÍÿÿÿÿy †  "          &   &   5 c