Browse Source

Added utf8 for accent in print and a test file

MalcolmMielle 5 years ago
parent
commit
0fe65f4b4d
3 changed files with 14 additions and 2 deletions
  1. 0
    0
      __init__.py
  2. 2
    2
      emails_sms_free.py
  3. 12
    0
      test.py

+ 0
- 0
__init__.py View File


+ 2
- 2
emails_sms_free.py View File

@@ -1,4 +1,5 @@
1 1
 #!/usr/bin/env python3
2
+# -*- coding:utf-8-*-
2 3
 
3 4
 import email
4 5
 import hashlib
@@ -53,8 +54,7 @@ def send(url, user, password, msg, i=0):
53 54
 
54 55
 def get_emails(imap_server, imap_user, imap_password, inbox, uid):
55 56
     global msg_ids
56
-
57
-    print('Connecting to '+imap_server+'… ', end='')
57
+    print('Connecting to '+imap_server+'… ', end=' ')
58 58
     conn = imaplib.IMAP4_SSL(imap_server)
59 59
     print('Connected')
60 60
     to_send = []

+ 12
- 0
test.py View File

@@ -0,0 +1,12 @@
1
+#!/usr/bin/env python3
2
+import emails_sms_free 
3
+
4
+if __name__ == '__main__':
5
+	url = "https://smsapi.free-mobile.fr/sendmsg"
6
+	user= raw_input("Please enter usr: ")
7
+	print "you entered", user
8
+	password= raw_input("Please enter password: ")
9
+	print "you entered", password
10
+	msg = raw_input("Please enter msg: ")
11
+	print "you entered", msg
12
+	send(url, user, password, msg, 1)