I am looking for some way to convert some string representation of some directed weighted graph with weights as strings in my case into some networkx graph.
E.g. the string
s = 'graph([p,q,¬p,¬q,p→q,q∧ ¬q],[edge(¬(¬p),¬p∧ ¬(¬p),"∧I"), edge(p,q,"→E"), edge(¬p, ¬p∧ ¬(¬p),"∧I"), edge(¬(¬p),¬p,"¬E"),edge(q,q∧ ¬q,"∧I"),edge(¬q,q∧ ¬q,"∧I"),edge(p→q,q,"→E"),edge(q∧ ¬q,¬p,"¬E"), edge(¬p∧ ¬(¬p),p,"¬E"), edge(¬p,p,"¬E")])'
should lead to something like that:

How can I realize it?
