Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print("line 16: mode: byte") is in the way on servers #58

Open
ghost opened this issue Mar 26, 2020 · 0 comments
Open

print("line 16: mode: byte") is in the way on servers #58

ghost opened this issue Mar 26, 2020 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 26, 2020

If you are using this on the server then you might get a problem with the print("line 16: mode: byte") part if you don't want to fork the repo to fix it you can monkey patch the print() function like this.

import os
from MyQR import myqr
import builtins


def custom_print(*args, **kwargs):
    pass


print("print called")
original_print = print
builtins.print = custom_print
print("now print is also called but should not show up")


version, level, qr_name = myqr.run(
    "https://somesite.eu",
    version=1,
    level='H',
    picture='./tmp/lab.gif',
    colorized=True,
    contrast=1.0,
    brightness=1.0,
    save_name='tmp/labout.gif',
    save_dir=os.getcwd()
)
builtins.print = original_print
print("now print should also show up agian")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants