s = '#|txt1#|txt2#|txt3#|txt4'res = filter(None, s.split('#|'))print(res)
Standard input is empty
['txt1', 'txt2', 'txt3', 'txt4']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!