str.splitlines
method should give you exactly that.
>>> data = """a,b,c
... d,e,f
... g,h,i
... j,k,l"""
>>> data.splitlines()
['a,b,c', 'd,e,f', 'g,h,i', 'j,k,l']
More Related Contents:
- Using quotation marks inside quotation marks
- Python 2.7 getting user input and manipulating as string without quotations
- How To Get All The Contiguous Substrings Of A String In Python?
- Most pythonic way to interleave two strings
- Strip spaces/tabs/newlines – python
- Python string literal concatenation
- How do I check if raw input is integer in python 2.7?
- Why python’s list slicing doesn’t produce index out of bound error? [duplicate]
- What is a clean way to convert a string percent to a float?
- pandas: replace string with another string
- What does !r do in str() and repr()?
- Byte Array to Hex String
- How can I copy a Python string?
- What does “table” in the string.translate function mean?
- What does backward-slash b do in Python?
- python program doesn’t work
- How do I concatenate items in a list to a single string?
- Skip the headers when editing a csv file using Python
- Stripping non printable characters from a string in python
- Python __str__ versus __unicode__
- “OSError: [Errno 1] Operation not permitted” when installing Scrapy in OSX 10.11 (El Capitan) (System Integrity Protection)
- Numpy: Fix array with rows of different lengths by filling the empty elements with zeros
- How does the max() function work on list of strings in python?
- Print Combining Strings and Numbers
- How to get char from string by index?
- How do i use subprocesses to force python to release memory?
- Format string dynamically [duplicate]
- Python: import module from another directory at the same level in project hierarchy
- Is it possible to draw a matplotlib boxplot given the percentile values instead of the original inputs?
- What is internal representation of string in Python 3.x