[codecs] to read file

This commit is contained in:
mzwiessele 2015-10-12 08:51:10 +01:00
parent 6baf4e7449
commit c6efa62e36
2 changed files with 7 additions and 11 deletions

View file

@ -42,14 +42,10 @@ import numpy as np
def read(fname):
try:
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
return unicode(f.read(), 'utf-8')
except NameError:
#python 3
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
return f.read()
import codecs
with codecs.open('README.md', 'r', 'utf-8') as f:
print(f.read())
def read_to_rst(fname):
try:
import pypandoc