arbitrary vire connection / search and replace

Posted by fatai on Stack Overflow See other posts from Stack Overflow or by fatai
Published on 2011-01-01T10:22:13Z Indexed on 2011/01/01 11:53 UTC
Read the original article Hit count: 224

Filed under:
|
|
|
|
  • input :["vire_connection",[1, 2, [ 3, [ 4, "connect"]]], ["connect", [3 , 5] ] ]
  • output:["vire_connection",[ 1, 2, [ 3, [ 4, [ 3, 5 ] ] ] ] ], [ [ 3 , 5] ] ]

after connection ( simply copying [3,5] to other wanted position ) , remove connect word

  • input :["vire_connection", [ [ [ ["connect", [ 3, 4 ] ] ] ] ], [ 2, "connect"]]
  • output :["vire_connection",[[[[[3,4]]]]], [ 2, [ 3 , 4 ]]]

after connection ( simply copying [3,4] to other wanted position ) , remove connect word

how can I do ?

© Stack Overflow or respective owner

Related posts about python

Related posts about algorithm