Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个pygraph数据结构,我想修改它。我想执行以下操作:
我无法在文档/代码中找到如何执行这些操作。可能吗?如何?
复制:
要在 python 中复制结构,您需要使用复制模块
from copy import deepcopy copy_graph = deepcopy(original_graph)
遍历
有一个关于如何遍历图形的示例:
from pygraph.algorithms.searching import depth_first_search st, pre, post = depth_first_search(copy_graph)
html 并替换为文本框