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.
1 parent 456c53d commit 915af61Copy full SHA for 915af61
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:
@@ -565,6 +566,13 @@ def gen_qr_code(self, qr_file_path):
565
566
qr = pyqrcode.create(string)
567
if self.conf['qr'] == 'png':
568
qr.png(qr_file_path)
569
+ if sys.platform.find('darwin') >= 0:
570
+ subprocess.call(['open', qr_file_path])
571
+ elif sys.platform.find('linux') >= 0:
572
+ subprocess.call(['xdg-open', qr_file_path])
573
+ else:
574
+ os.startfile(qr_file_path)
575
+
576
elif self.conf['qr'] == 'tty':
577
print(qr.terminal(quiet_zone=1))
578
0 commit comments