import re
-from html.entities import name2codepoint
+import sys
+try:
+ from html.entities import name2codepoint
+except ImportError:
+ from htmlentitydefs import name2codepoint
def htmlentitydecode(s):
return re.sub(
try:
ret = eval('\n'.join(inputs), globals_, locals_)
if ret:
- print(ret)
+ print(str(ret))
return
except SyntaxError:
pass
+def printNicely(string):
+ if hasattr(sys.stdout, 'buffer'):
+ sys.stdout.buffer.write(string.encode('utf8'))
+ print()
+ else:
+ print(string.encode('utf8'))
+
__all__ = ["htmlentitydecode", "smrt_input"]