0

I want to read file from other path and make a copy to my current path.

os.system("cd " + Path + r" && git log origin/main > D:\Project\untitled\log.txt")

D:\Project\untitled\log.txt = path to my code

How to make python locate my code path? eg:

codeLocation = {some commands}

os.system("cd " + Path + r" && git log origin/main > " + codeLocation + "\log.txt")
r3dr4bb1t
  • 64
  • 12

1 Answers1

0
codeLocation = 'D:\\Project\\untitled\\'

Then remove the \ from in front of log.txt in your next line:

os.system("cd " + Path + r" && git log origin/main > " + codeLocation + "log.txt")
brazosFX
  • 342
  • 1
  • 11