encode print to utf-8
This commit is contained in:
@@ -2,10 +2,9 @@ from datetime import datetime, timedelta
|
|||||||
|
|
||||||
def log(value):
|
def log(value):
|
||||||
|
|
||||||
try: print( str(datetime.now()) + ' ' + value)
|
try:
|
||||||
|
print(str(datetime.now()) + ' ' + value.encode("utf-8"))
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
print((str(datetime.now()) + ' ' + value).encode('ascii', 'ignore').decode('ascii'))
|
print(str(datetime.now()) + ' print error')
|
||||||
return print(str(datetime.now()) + ' print error')
|
|
||||||
|
|
||||||
#print(u' '.join(( str(datetime.now()), value)).encode('utf-8').strip())
|
#print(u' '.join(( str(datetime.now()), value)).encode('utf-8').strip())
|
||||||
Reference in New Issue
Block a user