0

I cant seem to write something like : "C:\Users\alon4\Desktop\Learning Material\Odyssey\Lab a2\Magnetism\data" As a string to print or otherwise, i think its something to do with the slashes

1 Answers1

0

There can be 3 ways :

1) Either use r (raw strings) before the actual string : For example : r"C:\Users\alon4\Desktop\Learning Material\Odyssey\Lab a2\Magnetism\data"

2) Or use // like: For example : "C:\\Users\\alon4\\Desktop\\Learning Material\\Odyssey\\Lab a2\\Magnetism\data"

3) Use slashes: "C:/Users/alon4/Desktop/Learning Material/Odyssey/Lab a2/Magnetism/data" (As suggested by Óscar López)

Abhay Salvi
  • 890
  • 3
  • 15
  • 39