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: Debian GNU/Linux 8 (desktop, home laptop, work laptop), Raspbian GNU/Linux 8 (nameserver), Ubuntu 14.04.3 LTS (HTPC), PC-BSD 10.2 (testbed), Android 4.2.1 (tablet)