import reprint(re.split(r',(?![^[]*\])', 'word1[a,b,c],word2[e,f,g],word3'))
Standard input is empty
['word1[a,b,c]', 'word2[e,f,g]', 'word3']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!