我有几种方法可以写入stderr: # Note: this first one does not work in Python 3 print >> sys.stderr, "spam" sys.stderr.write("spam\n") os.write(2, b"spam\n") from __future__ import print_function print("spam", file=sys.stderr) 它似乎与Python#13 †的禅相矛盾,那么首选方法是什么 […]