0

I'm trying to run a python script using Sublime Text 3. I'm trying to just use Ctrl+b and type the parameters in the box that comes up, but I can't for the life of me figure out how to format the Windows file paths. I keep getting a FileNotFoundError

I've tried:

"C:\dir1\dir 2\file.ext"
"C:\\dir1\\dir 2\\file.ext"
"C:/dir1/dir 2/file.ext"

Because some of my directories have spaces in them, I'm enclosing the whole thing in double quotes no matter which slash style I try. What am I missing here? None of these works.

With the first, for example, I'm getting FileNotFoundError: [Errno 2] No such file or directory: 'C:\\dir1\\dir 2\\file.ext,' [Finished in 0.3s]

The file is most definitely there and spelled correctly.

In case it matters, I'm using docopt to parse the input parameters

PurpleVermont
  • 1,179
  • 4
  • 18
  • 46
  • Try escaping the spaces with a single \ - for example, `C:/dir1/dir\ 2/file.ext` – MattDMo Nov 11 '21 at 18:01
  • @MattDMo sadly, didn't do it.; Something (docopt?) is escaping backslashes for me, so entering it like that ended up with `C:/dir1/dir\\ 2/file.ext` as the parameter value and still `FileNotFoundError` – PurpleVermont Nov 11 '21 at 18:06
  • Can we see your entire build system to be able to see what you're entering here in context? The last two are both valid ways to represent the path if they're being put in the build, but it matters if you're using `shell_cmd` versus `cmd` in how you lay things out, for example. – OdatNurd Nov 11 '21 at 18:51
  • @OdatNurd can you remind me how to access the build system to show it? – PurpleVermont Nov 11 '21 at 19:42
  • `View Package File` from the command palette, then filter on `sublime-build`; the file will have a name that reflects what you pick in the menu. – OdatNurd Nov 11 '21 at 19:54

0 Answers0