I am trying to get the current working directory and add it to a file path with os.getcwd
. Because windows uses forward slashes in the directory path, I need to change all of these slashes to back slashes for it to work in python.
What I've tried:
import os
old = getcwd()
new = old.replace("\", "/")
file_path = (new + "folder/filename")
print(file_path
The above is throwing an error of SyntaxError: EOL while scanning string literal