6 changed files with 15 additions and 14 deletions
@ -1,11 +1,4 @@
|
||||
#!/usr/bin/python3 |
||||
|
||||
try: |
||||
import importlib.resources as importlib_resources |
||||
except ImportError: |
||||
# In PY<3.7 fall-back to backported `importlib_resources`. |
||||
import importlib_resources |
||||
|
||||
with importlib_resources.path('china_dictatorship', 'README.html') as readme_html_path: |
||||
with open(readme_html_path) as f: |
||||
print(f.read()) |
||||
import china_dictatorship |
||||
print(china_dictatorship.get_data(), end='') |
||||
|
@ -0,0 +1,8 @@
|
||||
try: |
||||
import importlib.resources as importlib_resources |
||||
except ImportError: |
||||
# In PY<3.7 fall-back to backported `importlib_resources`. |
||||
import importlib_resources |
||||
|
||||
def get_data(): |
||||
return importlib_resources.read_text(__name__, 'README.html') |
Loading…
Reference in new issue