lincolnloop / python-qrcode

Python QR Code image generator
https://pypi.python.org/pypi/qrcode
Other
4.36k stars 666 forks source link

Add a --output command line option #172

Closed pedro-w closed 3 years ago

pedro-w commented 5 years ago

I was trying to use qrcode with Windows Powershell and it proved surprisingly difficult to pipe binary data out of qr and into a file without PowerShell altering it in some way, for example LF->CRLF and Unicode encodings. To help this I added an extra option to specify the output file. Now you can do

qr --output=code.png "some data"

instead of

qr "some data" > code.png

If you omit the output option, output goes to standard out, so qr works exactly as before.