python 2 and 3 compatible now
This commit is contained in:
parent
0fe65f4b4d
commit
543ebfbb89
@ -1,6 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
#!/usr/bin/env python
|
||||
# -*- coding:utf-8-*-
|
||||
|
||||
from __future__ import print_function #print function python 2 and 3 compatible
|
||||
|
||||
try:
|
||||
#import urllib.request as urllib_request #for python 3
|
||||
import email
|
||||
import hashlib
|
||||
import imaplib
|
||||
@ -9,6 +13,10 @@ import os.path
|
||||
import requests
|
||||
import sys
|
||||
import time
|
||||
except ImportError:
|
||||
#import urllib2 as urllib_request # for python 2
|
||||
import simplejson as json
|
||||
print('Error importing lib as pyhton3, switching to python 2 libraries')
|
||||
|
||||
msg_ids = {}
|
||||
|
||||
|
19
test.py
19
test.py
@ -1,12 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
#!/usr/bin/env python
|
||||
|
||||
from builtins import input #pour rendre input python2 and 3 compatible
|
||||
import emails_sms_free
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
url = "https://smsapi.free-mobile.fr/sendmsg"
|
||||
user= raw_input("Please enter usr: ")
|
||||
print "you entered", user
|
||||
password= raw_input("Please enter password: ")
|
||||
print "you entered", password
|
||||
msg = raw_input("Please enter msg: ")
|
||||
print "you entered", msg
|
||||
send(url, user, password, msg, 1)
|
||||
user= input("Please enter usr: ")
|
||||
print("you entered" + str(user))
|
||||
password= input("Please enter password: ")
|
||||
print("you entered"+ str(password))
|
||||
msg = input("Please enter msg: ")
|
||||
print("you entered"+ str(msg))
|
||||
end = emails_sms_free.send(url, user, password, msg)
|
||||
|
Loading…
Reference in New Issue
Block a user