python_turtle海龜畫圖安裝

1、python3.7裏面自帶turtlr,如果在python_shell裏面運行,則可以直接使用此模塊。

2、如果想在dos窗口裏面運行python文件實現畫圖,則需要安裝turtle第三方庫。

下載地址:https://pan.baidu.com/s/1vpOadOjFVp99VtNVoJCoAQ

提取碼:20wo

1、解壓文件:

2、安裝

      pip install -e D:\turtle-0.0.2

安裝過程中遇到的問題:

       1、如果報pip版本過低,則需要升級pip(報錯最後邊有提示,按提示命令升級pip):

            python -m pip install --upgrade pip

       2、安裝過程中報錯visualcppbuildtools等什麼的看報錯信息,需要安裝visualcppbuildtools。

            解壓包有,直接運行即可,安裝時間在30分鐘左右。

             

3、PyCharm 5.0.3想要直接運行turtlr代碼進行畫圖,(可能要需要安裝turtle),但是必須做的就是修改__all__變量

C:\Users\123\AppData\Local\Programs\Python\Python37\Lib\turtle.py

__all__ = ['ScrolledCanvas', 'TurtleScreen', 'Screen', 'RawTurtle', 'Turtle', 'RawPen', 'Pen', 'Shape', 'Vec2D', 'back',
           'backward', 'begin_fill', 'begin_poly', 'bk', 'addshape', 'bgcolor', 'bgpic', 'bye', 'clearscreen',
           'colormode', 'delay', 'exitonclick', 'getcanvas', 'getshapes', 'listen', 'mainloop', 'mode', 'numinput',
           'onkey', 'onkeypress', 'onkeyrelease', 'onscreenclick', 'ontimer', 'register_shape', 'resetscreen',
           'screensize', 'setup', 'Terminator', 'setworldcoordinates', 'textinput', 'title', 'tracer', 'turtles',
           'update', 'window_height', 'window_width', 'write_docstringdict', 'done', 'circle', 'clear', 'clearstamp',
           'clearstamps', 'clone', 'color', 'degrees', 'distance', 'dot', 'down', 'end_fill', 'end_poly', 'fd',
           'fillcolor', 'filling', 'forward', 'get_poly', 'getpen', 'getscreen', 'get_shapepoly', 'getturtle', 'goto',
           'heading', 'hideturtle', 'home', 'ht', 'isdown', 'isvisible', 'left', 'lt', 'onclick', 'ondrag', 'onrelease',
           'pd', 'pen', 'pencolor', 'pendown', 'pensize', 'penup', 'pos', 'position', 'pu', 'radians', 'right', 'reset',
           'resizemode', 'rt', 'seth', 'setheading', 'setpos', 'setposition', 'settiltangle', 'setundobuffer', 'setx',
           'sety', 'shape', 'shapesize', 'shapetransform', 'shearfactor', 'showturtle', 'speed', 'st', 'stamp', 'tilt',
           'tiltangle', 'towards', 'turtlesize', 'undo', 'undobufferentries', 'up', 'width', 'write', 'xcor', 'ycor']

4、小海龜教程:https://www.cnblogs.com/nowgood/p/turtle.html

      

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章