Are open(file, “wt” or “rt”) different objects?
问题 When you do: file = open("my file","wt") and file = open("my file" , "rt") These both create file objects that we use file methods on. But are they creating different file objects? And if they are creating different file objects would it be fair to say that the "wt" one is mutable, while the "rt" one is immutable? 回答1: No, that would not be fair to say. You are creating instances of the same standard file type, which proxies file manipulation calls to the operating system. The mode defines