Does Python convert str to path type?
I am trying to interact with some existing code that saves the configuration and expects a file path that is of type 'path.path'. The code expects the file path to be returned from the pygtk browser window (via another function). I want to call the save_config function elsewhere in my code with a filepath based on different inputs built from string items.
When I try to run the code, I can build the file path correctly, but it is a string type and the save function expects a path.path type.
Is there a way to convert a string to a path type? I tried searching, but could only find reverse case (string path). I also tried using os.path.join()
but also returns a string.
edit: It's python 2.7, if that matters.
source to share