File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ data file, the naïve solution is just to hard-code the path to that file.
5656``` python
5757from pathlib import Path
5858
59- spacings_txt = Path(" peak_spacings/LaB6.txt" ).read_text(encoding = " utf= 8" )
59+ spacings_txt = Path(" peak_spacings/LaB6.txt" ).read_text(encoding = " utf- 8" )
6060```
6161
6262But this is not a good solution because:
@@ -111,7 +111,8 @@ package.peak_spacings =
111111```
112112
113113** Or** , you can use automatic data inclusion (this is the default if you use
114- ` pyproject.toml ` ` [project] ` config in Setuptools 61+):
114+ ` pyproject.toml ` ` [project] ` config in Setuptools 61+). To enable this with
115+ ` setup.cfg ` :
115116
116117``` ini
117118[options]
@@ -139,7 +140,7 @@ import importlib_resources as resources
139140
140141ref = resources.files(" package.peak_spacings" ) / " LaB6.txt"
141142
142- spacings_txt = ref.read_text(encoding = " utf= 8" )
143+ spacings_txt = ref.read_text(encoding = " utf- 8" )
143144
144145# If you have an API that requires an on-disk file, you can do this instead:
145146with resources.as_file(ref) as path:
You can’t perform that action at this time.
0 commit comments