def to_pickle(graph, file, protocol=HIGHEST_PROTOCOL):
"""Writes this graph to a pickle object with :func:`networkx.write_gpickle`. Note that the pickle module has some
incompatibilities between Python 2 and 3. To export a universally importable pickle, choose 0, 1, or 2.
:param BELGraph graph: A BEL graph
:param str or file: A file or filename to write to
:param int protocol: Pickling protocol to use
.. seealso:: https://docs.python.org/3.6/library/pickle.html#data-stream-format
"""
raise_for_not_bel(graph)
write_gpickle(graph, file, protocol=protocol)
评论列表
文章目录