pombreda / pydot

Automatically exported from code.google.com/p/pydot
MIT License
0 stars 0 forks source link

Add the ability to write to a file-object #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be nice to have the ability to send in a file-object, instead of a 
path-name, to pydot.Dot.write.

Use-case:

import tempfile
import pydot

g = pydot.Dot([...])
[...]

temp = tempfile.TemporaryFile()
g.write_png(temp)

[... Use temp as input for further processing]

Original issue reported on code.google.com by fredrik....@gmail.com on 15 Jan 2012 at 8:51

GoogleCodeExporter commented 9 years ago
Instead of write() or write_*() you can use create() and create_*() with the 
same output formats and the call will return a string with the produced 
content. It might make the further processing easier.

Original comment by ero.carr...@gmail.com on 16 Jan 2012 at 12:01

GoogleCodeExporter commented 9 years ago
Ahh, sorry! Didn't look that far :/ Thanks for the tip! And don't forget to 
close the issue ;) (I dont seem to have the rights to do that)

Original comment by fredrik....@gmail.com on 16 Jan 2012 at 10:30

GoogleCodeExporter commented 9 years ago
Great to hear that it worked!

Original comment by ero.carr...@gmail.com on 17 Jan 2012 at 12:05