Easiest way to read/write a file's content in Python

后端 未结 9 2143
走了就别回头了
走了就别回头了 2020-12-01 17:32

In Ruby you can read from a file using s = File.read(filename). The shortest and clearest I know in Python is

with open(filename) as f:
    s =          


        
9条回答
提交回复
热议问题