I’m trying to get the current directory using the OS module, like that:
However, when I do this, the directory comes with \, like
'C:\Users\...', and I need to use directory with \\ or /.
Is that anyway to get the directory with
You can just replace the
/. Note that the former must be escaped with another
\, like below:
import os directory = os.getcwd().replace('\\', '/')