![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
08-21-15, 03:49 PM
|
#14 |
|
Difficulties Numbing
|
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 |
|
|
| Thread Tools | |
| Display Modes | |
|
|
