Skip to content

Is there a way to tostring() a Document? #708

Answered by abey79
bjuan210302 asked this question in Q&A
Discussion options

You must be logged in to vote

write_svg takes a TextIO as argument. So you can pass a StringIO(docs):

import io
import vpype as vp

string_io = io.StringIO()
doc = vp.Document()
vp.write_svg(string_io, doc)
print(string_io.getvalue())

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bjuan210302
Comment options

Answer selected by bjuan210302
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #707 on March 13, 2024 07:05.