diff --git a/MyQR/myqr.py b/MyQR/myqr.py index 458bb4e..9f9198b 100644 --- a/MyQR/myqr.py +++ b/MyQR/myqr.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +import tempfile import os from MyQR.mylibs import theqrmodule from PIL import Image @@ -84,8 +85,9 @@ def combine(ver, qr_name, bg_name, colorized, contrast, brightness, save_dir, sa qr_name = os.path.join(save_dir, os.path.splitext(os.path.basename(bg_name))[0] + '_qrcode.png') if not save_name else os.path.join(save_dir, save_name) qr.resize((qr.size[0]*3, qr.size[1]*3)).save(qr_name) return qr_name - - tempdir = os.path.join(os.path.expanduser('~'), '.myqr') + + + tempdir = os.path.join(tempfile.gettempdir(), '.myqr') try: if not os.path.exists(tempdir): @@ -129,4 +131,4 @@ def combine(ver, qr_name, bg_name, colorized, contrast, brightness, save_dir, sa finally: import shutil if os.path.exists(tempdir): - shutil.rmtree(tempdir) \ No newline at end of file + shutil.rmtree(tempdir)