jamesscottbrown / pyyed

A simple Python library to export networks to yEd
BSD 3-Clause "New" or "Revised" License
82 stars 38 forks source link

Added support to output graph to file on storage #13

Closed lundstrj closed 5 years ago

lundstrj commented 5 years ago

Added a write_to_file function to enable easy file output of the demo graphs in demo.py

lundstrj commented 5 years ago

Not a big fan?

GitJer commented 5 years ago

Actually, I am. I was looking for an example of how to write a graph to a file when I arrived in your pull request. I did comment on something, but I think I deleted that a little later when I noticed that 'write_graph' is already part of the graph class.

lundstrj commented 5 years ago

A fair point indeed! I changed the code to use graph_write instead (after checking that the code in ElementTree outputs a string).

Fair warning, I'm on a borrowed laptop without development tools so I just edited the code with the in browser editor. Haven't actually executed it.

(If you like this better, I'll update the readme pull request to match.)

jamesscottbrown commented 5 years ago

I have edited the README to add an example of writing to a file.