parent
f2349dcff0
commit
23d0ccb994
4 changed files with 17 additions and 8 deletions
@ -0,0 +1,7 @@ |
||||
# Or else pip install cannot find README.adoc on the setup.py |
||||
include README.adoc |
||||
include README.html |
||||
|
||||
# These actually add the file. |
||||
include china_dictatorship/README.adoc |
||||
include china_dictatorship/README.html |
@ -1,7 +1,11 @@ |
||||
#!/usr/bin/python3 |
||||
|
||||
import pkg_resources |
||||
try: |
||||
import importlib.resources as importlib_resources |
||||
except ImportError: |
||||
# In PY<3.7 fall-back to backported `importlib_resources`. |
||||
import importlib_resources |
||||
|
||||
readme_html_path = pkg_resources.resource_filename('china_dictatorship', 'README.html') |
||||
with open(readme_html_path) as f: |
||||
print(f.read()) |
||||
with importlib_resources.path('china_dictatorship', 'README.html') as readme_html_path: |
||||
with open(readme_html_path) as f: |
||||
print(f.read()) |
||||
|
Loading…
Reference in new issue