Removing certain parts of a list structure in python -


i'm making interface in python tkinter lets end-user insert information gets saved problem structure in .r file.

the program lets user load .r files contains same type of structure editing. example structure:

global <- list( const=' #define max 60 #define min 2.8 double alpha[max]; double omega[min]; ', foobar=' double foo(double *condition, double num) { return foo2(foo3(vars));    }' ) 

say user wanted edit item in list named foobar. how can make function removes foobar part?

in other words: remove information between first , last parentheses in following example.

foo=("this is(( a() text)(( unmatching ((parentheses()(") 


Comments