Browse Source

fixed generate qrcode error, and update dependance

gjwang 9 years ago
parent
commit
523c3e90fb
2 changed files with 3 additions and 6 deletions
  1. 1 0
      README.md
  2. 2 6
      wxbot.py

+ 1 - 0
README.md

@@ -8,6 +8,7 @@ Python包装的网页微信API。可以很容易地实现微信机器人。
 ```bash
 pip install requests
 pip install pyqrcode
+pip install pypng
 ```
 
 ## Demo

+ 2 - 6
wxbot.py

@@ -75,12 +75,8 @@ class WXBot:
 
     def gen_qr_code(self):
         string = 'https://login.weixin.qq.com/l/' + self.uuid
-        qr = pyqrcode.QRCode()
-        qr.border = 1
-        qr.add_data(string)
-        qr.make(fit=True)
-        img = qr.make_image()
-        img.save('qr.jpg')
+        qr = pyqrcode.create(string)
+        qr.png('qr.jpg')
 
     def wait4login(self, tip):
         time.sleep(tip)