-1

I am working on a project and to make a new path I needed backslash as a string.

So far I've tried S = "\", but it didn't work.

This code snippet might help you to understand the situation.

dir_num = "1566510932"
reduced_base_directory = phosphogly_ws_len_path + r"\" + dir_num + r".result" + r"\" + dir_num + r".fas."

1 Answers1

0

You can give it an extra slash:

S="\\"
jasonwubz
  • 341
  • 3
  • 6
  • 2
    @DiptoPaulDip No, it doesn't. It produces a string whose string *representation* contains a double backslash. – chepner Aug 22 '19 at 22:50