I use pathlib to open textfiles that exists in a different directory, but get this error
TypeError:`"Unsupported operand type for +:'WindowsPath' and 'str'"
when I try opening a shelved file that exist in a score folder in the current directory like this.
from pathlib import *
import shelve
def read_shelve():
data_folder = Path("score")
file = data_folder / "myDB"
myDB = shelve.open(file)
return myDB
What am I doing wrong or is there another way to achieve this?