-1

While adding an absolute path to my script because it has a \f in it the code won't run properly.

C:\Users\showoi\Desktop\website\repository\fileAdder\softwarelisting.xlsx

The file is in the same directory as the script but using a relative path won't work. No misspellings or anything.

Charlie Clark
  • 18,477
  • 4
  • 49
  • 55
showoi
  • 1

2 Answers2

0

Use python r string

path=r'C:\Users\showoi\Desktop\website\repository\fileAdder\softwarelisting.xlsx'
AziMez
  • 2,014
  • 1
  • 6
  • 16
0

Use one of the following ways:

  • r"C:\Users\showoi\Desktop\website\repository\fileAdder\softwarelisting.xlsx"

  • "C:\\Users\\showoi\\Desktop\\website\\repository\\fileAdder\\softwarelisting.xlsx"

  • "C:/Users/showoi/Desktop/website/repository/fileAdder/softwarelisting.xlsx