0

I have a script that I want to run everywhere, on any computer, regardless of where my files are placed

I saw some same question there but it wont solved my problem

I have some variables with path writed like this:

filePath = "C:\ProgramData\OutilTestObjets3D\MaquetteCB-2019\DataSet\ONLYIVENOTFIXED.txt"

how I can make it work like script work whenever my folder "outilTestObjets3D" is, and not only in the c:ProgramData....

  • Possible duplicate of [Relative paths in Python](https://stackoverflow.com/questions/918154/relative-paths-in-python) – tituszban Sep 03 '19 at 10:00
  • what's the expected path to your script and how it relates to .txt location? – Oleh Rybalchenko Sep 03 '19 at 10:06
  • there is the path to my script : C:\ProgramData\OutilTestObjets3D\MaquetteCB-2019\DataSet\DIAGTOOL\diagnosticTool.py its in the same directory of my .txt location –  Sep 03 '19 at 11:35
  • @OlehRybalchenko –  Sep 03 '19 at 11:43
  • I'd suggest reading about ["current working directories"](https://stackoverflow.com/q/45591428/1358308), i.e. you shouldn't be referencing "absolute paths", just "relative paths". google should be able to suggest lots of docs/tutorials from these keywords – Sam Mason Sep 03 '19 at 13:02

0 Answers0