Reputation: 174
I have tried the command below in both windows and mac:
python --version > file.txt
which will create a text file but the file it creates is empty.
Upvotes: 1
Views: 611
Reputation: 6269
python --version
outputs to stderr
not stdout
so to capture it to file use this command:
python --version 2>file.txt
Upvotes: 1