3 ms·
I don't think I follow the stderr comment. Isn't it just: Perl print STDERR "foo" Python print(file=sys.stderr, "foo") Those look fairly similar. I
by 8organicbits 4y ago
I don't think I follow the stderr comment. Isn't it just:
Perl
print STDERR "foo"
Python
print(file=sys.stderr, "foo")
Those look fairly similar. I prefer that print() is obviously a function call and file is a named parameter so the purpose is clear.
- tus666 4y agoWell in Perl there is... warn("foo") In Python you have to at least: - remember not to forget to import sys - remember the file= syntax for the print statement - type about 10 extra characters Bunch of annoying stuff when you are hurriedly debugging something...
- tyingq 4y agoThe file=sys.stderr came with Python 3. Because of that, I tend to see sys.stderr.write("foo\n") more often.
- jerdfelt 4y agoPython 2 was even more terse with it's print statement print >>sys.stderr, "foo"