my_string = """This is my first line,
this is my second line, and...
...this is my fourth line!"""
最初の行(This is my first line,
)を別の文字列に保存するにはどうすればよいですか? 、文字列の最初の行を読み取るにはどうすればよいですか?
my_string.split('\n', 1)[0]
を効率の便宜上:
AttributeError: 'str' object has no attribute 'readline'