Created
May 12, 2015 17:49
-
-
Save CodeMan99/ffb65d362d9d184dcc88 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python 3.4.3+ (3.4:dc10c52c6539, Apr 9 2015, 23:04:55) | |
[GCC 4.8.2] on linux | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> """Hello | |
... There | |
... | |
... I have some blank lines | |
... | |
... as well as a trailing newline. | |
... """.split("\n") | |
['Hello', 'There', '', 'I have some blank lines', '', 'as well as a trailing newline.', ''] | |
>>> from io import StringIO | |
>>> StringIO("""Hello | |
... There | |
... | |
... I have some blank lines | |
... | |
... as well as a trailing newline. | |
... """).readlines() | |
['Hello\n', 'There\n', '\n', 'I have some blank lines\n', '\n', 'as well as a trailing newline.\n'] | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment