Skip to content
  • Tiago Peixoto's avatar
    Add support for running arbitrary C++ code from python · 866bb994
    Tiago Peixoto authored
    It is now possible to run arbitrary "inline" C++ code from python, using
    scipy.weave, as such:
    
            g = graph_tool.Graph()
            g.load("foo.xml")
            value = 2.0
            g.run_action('cout << num_vertices(g) << " " << value << endl;',
                         ["value"]);
    
    The code gets compiled the first time, and is reused after that. Python
    local and global variables can be passed to C++, as shown above, by
    specifying a list of passed variables as the second argument.
    866bb994