segno
segno copied to clipboard
[feature request] Process input from file/standard input
In order to replace existing QR code generators, it would be helpful to be able to process input from a provided file and/or standard input as well (even though it's possible to store said input in an environment variable first, of course).
Please provide an example which works with existing QR Code generators and which does not work with Segno.
Is there a way to read input from files? For instance, cat input.txt | segno
?
I am able to do this with python-qrcode (eg. cat input.txt | qr
)
I tried this, which works but doesn't seem to encode newline characters into the QR code.
segno `cat input.txt`
I tried this, which works but doesn't seem to encode newline characters into the QR code.
segno `cat input.txt`
@1oh1 As a quick workaround, try segno "$(cat 'input.txt')"
instead. The double quotes will ensure that the entire file contents are passed as a single argument, including newline characters (tested with Segno v1.4.1; of course, you can use backticks as well).
Had a small patch that allows piping: https://github.com/rhyw/segno/pull/1
Broke some tests though. Haven't yet had much time to fix.
Had a small patch that allows piping: rhyw#1
Broke some tests though. Haven't yet had much time to fix.
Thanks, I'll take a look