2
file_name = file_path.split('\')

Gives me an error because \' is to represent a single quote in python.

I want to split a file name using single backslash.

martineau
  • 112,593
  • 23
  • 157
  • 280
Shiv
  • 21
  • 1

1 Answers1

2

Use a double \:

file_name = file_path.split('\\')
Ann Zen
  • 25,080
  • 7
  • 31
  • 51