You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the write_html method accepts the name of a file and writes the HTML representation there. I'd like to be able to write to other kinds of streams besides files, for example:
from pyvis.network import Network
import sys
nt = Network("500px", "800px")
nt.write_html(sys.stdout)
Perhaps write_html can accept a file object instead of a string. For convenience, the show method could still take a string as before. Alternatively, write_html can check the type of its argument. If it's a string, the function behaves as it does now. If its a file object, the function writes to it.
Thanks for the great package!
The text was updated successfully, but these errors were encountered:
norweeg
added a commit
to norweeg/pyvis
that referenced
this issue
Apr 3, 2024
Currently, the
write_html
method accepts the name of a file and writes the HTML representation there. I'd like to be able to write to other kinds of streams besides files, for example:Perhaps
write_html
can accept a file object instead of a string. For convenience, theshow
method could still take a string as before. Alternatively,write_html
can check the type of its argument. If it's a string, the function behaves as it does now. If its a file object, the function writes to it.Thanks for the great package!
The text was updated successfully, but these errors were encountered: