Is there a way to tostring() a Document? #708
Answered
by
abey79
bjuan210302
asked this question in
Q&A
-
With an existing I there any way of achieving this? The only thing I can think of is straight up copying the |
Beta Was this translation helpful? Give feedback.
Answered by
abey79
Mar 13, 2024
Replies: 1 comment 1 reply
-
import io
import vpype as vp
string_io = io.StringIO()
doc = vp.Document()
vp.write_svg(string_io, doc)
print(string_io.getvalue()) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
bjuan210302
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
write_svg
takes aTextIO
as argument. So you can pass aStringIO
(docs):