好的,这很简单,我想在文件中写一段巨大的文字.我知道我能做到
f=open("blah.txt",'w')
f.write("blah blah \n")
f.write("bla blah blah ")
f.close()
Run Code Online (Sandbox Code Playgroud)
但是什么是更优雅的解决方案?
Ign*_*ams 17
f.write("""I’ve got a lovely bunch of coconuts
There they are all standing in a row
Big ones, small ones, some as big as your head
Give them a twist a flick of the wrist
That’s what the showman said""")
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6174 次 |
| 最近记录: |