[feature request] Could you help to implement dot in svg_turtle?
See original GitHub issueWhat I did
[feature request] Could you help to implement dot in svg_turtle?
#!/usr/bin/env python
# coding=utf-8
import sys
from turtle import * # @UnusedWildImport
import svgwrite
from svg_turtle import SvgTurtle
def write_file(draw_func, filename, size):
drawing = svgwrite.Drawing(filename, size=size)
drawing.add(drawing.rect(fill='white', size=('100%', '100%')))
t = SvgTurtle(drawing)
Turtle._screen = t.screen
Turtle._pen = t
draw_func()
drawing.save()
def draw():
a = [[120.71, 50], [50, 120.71], [-50, 120.71], [-120.71, 50], [-50, -20.71], [50, -20.71], [20.71, 50],
[-20.71, 50]]
pencolor("red")
penup()
for i in range(len(a)):
goto(a[i])
down()
dot(10, "red")
penup()
def main():
write_file(draw, 'test.svg', size=('500px', '500px'))
if __name__ == '__main__':
main()
What happened
When I run this code, got this error:
Traceback (most recent call last):
File ".\data\test.py", line 32, in <module>
main()
File ".\data\test.py", line 29, in main
write_file(draw, 'test.svg', size=('500px', '500px'))
File ".\data\test.py", line 14, in write_file
draw_func()
File ".\data\test.py", line 25, in draw
dot(10, "red")
File "<string>", line 8, in dot
AttributeError: 'SvgTurtle' object has no attribute 'dot'
What I wanted to happen
Draw that dots in svg file
My environment
Describe the versions of everything you were using:
- Python 3.7.7
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to Make a Feature Request | Short.Io Help Center
1. Feature Requests - see the existed feature requests. 2. Planned - the requests that are approved and are going to be implemented....
Read more >Feature Request Template: How to Manage Suggestions at ...
Streamline and organize user feedback with this free feature request template. Available in Google Docs and Sheets (no email required).
Read more >donkirkby/svg-turtle: Use the Python turtle to write SVG files
Once it's installed, create an SvgTurtle , telling it how big to make the SVG file. Then give it some turtle commands, and...
Read more >Feature Requests: What are they and how to manage them
Feature requests are a form of product feedback you may frequently encounter as a SaaS product manager. They typically come in the form...
Read more >How we handle feature requests - Artlogic Support
Following our internal feature request meetings, viable requests are selected and then considered for inclusion in our development schedule. This schedule is ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I added the
dot()
method toSvgTurtle
, and I added abgcolor
option toSvgTurtle.create()
. That makes it easier to create the turtle object and save the file. Here’s an updated version of your example:Thank you very much. I will test it ASAP.