We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f824fff + 915af61 commit 044dfe2Copy full SHA for 044dfe2
wxbot.py
@@ -10,6 +10,7 @@
10
import re
11
import random
12
from requests.exceptions import *
13
+import os,subprocess,sys
14
15
16
class WXBot:
@@ -578,6 +579,13 @@ def gen_qr_code(self, qr_file_path):
578
579
qr = pyqrcode.create(string)
580
if self.conf['qr'] == 'png':
581
qr.png(qr_file_path)
582
+ if sys.platform.find('darwin') >= 0:
583
+ subprocess.call(['open', qr_file_path])
584
+ elif sys.platform.find('linux') >= 0:
585
+ subprocess.call(['xdg-open', qr_file_path])
586
+ else:
587
+ os.startfile(qr_file_path)
588
+
589
elif self.conf['qr'] == 'tty':
590
print(qr.terminal(quiet_zone=1))
591
0 commit comments