I don’t know why you thought it appropriate to resurrect a long-dead thread, but:
By “mysplit()” you probably mean “mystring.split()”. In case you really have a file that’s in this rather peculiar format, you should proceed in two or three steps: first strip brackets from the line, then split the line, and lastly, if necessary, strip quotes from each element in the list. And actually even before the first step you should right-strip the line ending chars from the string read from a file.
Originally Posted by ackpython
But in actual practice you probably wouldn’t encounter this kind of formatting, and if you did, you might even – cautiously! – employ Python’s own parser to do this.
mylist2 = [item.strip("'") for item in mystring.rstrip().strip('').split(', ')]
My armada: openSUSE 13.2 (home desktop, home laptop, work desktop), Ubuntu 14.04 LTS (server), OpenELEC 5.0 (HTPC), Debian GNU/Linux 7.7.0 (mini laptop), Android 4.2.1 (tablet)