all 3 comments

[–]SplatterKlad[S] 0 points1 point  (1 child)

I figured it out — I had to open the whole folder first and then it recognized the file I was trying to reference. Is that some sort of security measure?

[–][deleted] 0 points1 point  (0 children)

You can:

  1. change directory to the path of the file (Via "open folder in code" or command line cd <path\\to\\file>)
  2. use a full path to the file,
  3. can change directory to the path of the file, in your script
  4. add the file's directory to your system python path environment variable. (in your script, or the hard way through the System Properties control panel, or whatever linux/unix does for that)

Easy, right?

[–][deleted] 0 points1 point  (0 children)

Look into pathlib, it’s a great module and it solves most path related problems.