Closed hamidsana closed 1 year ago
Hi, this module doesn't recognize a Path object yet so dw.open()
is expecting a string to describe the file name. If your dxd_key
variable is already a string then you can probably use it directly:
for dxd_key in dxd_list:
with dw.open(dxd_key) as f:
Otherwise, I think you can convert the Path to a string like this:
for dxd_key in dxd_list:
with dw.open(str(Path(dxd_key))) as f:
It's a good idea to add support for Path in a future version of this module. Thanks for pointing it out!
Hi, this is my code: . . import dwdatareader as dw print(dw.version, dw.getVersion()) for dxd_key in dxd_list: with dw.open(Path(dxd_key)) as f:
and this is the error I get. any idea? AttributeError: 'WindowsPath' object has no attribute 'encode'