Browse Source

Fix os.startfile can't work on mac os.

liuwons 9 years ago
parent
commit
d5a0e815d6
1 changed files with 2 additions and 2 deletions
  1. 2 2
      wxbot.py

+ 2 - 2
wxbot.py

@@ -10,7 +10,7 @@ import time
 import re
 import re
 import random
 import random
 from requests.exceptions import *
 from requests.exceptions import *
-import os
+import webbrowser
 import HTMLParser
 import HTMLParser
 
 
 
 
@@ -712,7 +712,7 @@ class WXBot:
         qr = pyqrcode.create(string)
         qr = pyqrcode.create(string)
         if self.conf['qr'] == 'png':
         if self.conf['qr'] == 'png':
             qr.png(qr_file_path, scale=8)
             qr.png(qr_file_path, scale=8)
-            os.startfile(qr_file_path)
+            webbrowser.open(qr_file_path)
         elif self.conf['qr'] == 'tty':
         elif self.conf['qr'] == 'tty':
             print(qr.terminal(quiet_zone=1))
             print(qr.terminal(quiet_zone=1))