How to run python code in terminal mac

broken image

It's a string.How do you change backslashes with forward slashes in Python? How do I remove an extra path in Python? a = 'dfdfd\dafdfd' print(a) a.replace( .

broken image

The directory path does not begin with a slash or a drive letter, so it is called a relative path. But in Python, forward slashes always work, even on Windows. Windows uses backward slashes to denote subdirectories, while Linux use forward slashes.

broken image

The directory path uses a forward slash without mentioning operating system.

broken image