Thread: [TEC] In-game save date
View Single Post
Old 08-21-15, 03:49 PM   #14
ExFishermanBob
Difficulties Numbing
 
Join Date: Aug 2013
Location: AN19
Posts: 470
Downloads: 43
Uploads: 0


Default

I think you have missed my point. I know all about the saving and so on - what I was pointing out was, that in python, running under Windows a string with only single backslashes for path separators will, for certain values (particularly zero), be evaluated by python as an escape character when passed to file-handling routines.

Thus: "C:\somewhere\anywhere\but\this\0" will be interpreted as
"C:\somewhere\anywhere\but<tab>NUL" and an error will occur. \t is tab, \0 is null.

You must, therefore, in Windows (when programming in Python): use double backslashes (\\0) or forward slashes (/) or use a (so-called) "raw" string (prefixed by r: r"C:\etc") or decompose and recompose the path using the relevant python functions.

The original was easier to read.

So yes, I'm talking about the sub-directory of the "Career/name/" - which, for the first patrol, will be zero, for which see above IF you are using python in Windows and need to specify a path in a string. It catches me every single time, hence my note to others who might either encounter it for the first time, or, like me, continually forget.

For the full horror:

http://www.cisco.com/c/en/us/td/docs...n_r/frf019.pdf
ExFishermanBob is offline   Reply With Quote