![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|
08-21-15, 03:49 PM
|
#1 |
|
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 |
|
|
08-22-15, 03:54 AM
|
#2 | |
|
Sonar Guy
![]() Join Date: Oct 2013
Posts: 382
Downloads: 64
Uploads: 0
|
Quote:
|
|
|
|
08-23-15, 02:53 AM
|
#3 |
|
Difficulties Numbing
|
Ah, yes. I could have just said that.
I develop in Linux for the ease of things, then transfer the code to Windows to polish and check it - and escape characters get me every time. I have two other bits of code and a tool (the first part of the Kapitan's toolkit) which I hope to release this evening. |
|
|
08-23-15, 04:49 PM
|
#4 | |
|
Sonar Guy
![]() Join Date: Oct 2013
Posts: 382
Downloads: 64
Uploads: 0
|
Quote:
|
|
|
|
08-23-15, 05:15 PM
|
#5 |
|
Difficulties Numbing
|
It occured to me, while thinking about turning BdU operations into a game with 'live' pieces, that, if allied shipping is scripted, it should also be possible to model the allied naval command....at least in terms of issuing convoy orders.
Determining some kind of scoring system might be problematic, but perhaps that would not matter. So, I need to investigate the manner in which allied shipping is generated. |
|
|
08-23-15, 06:04 PM
|
#6 | |
|
Sonar Guy
![]() Join Date: Oct 2013
Posts: 382
Downloads: 64
Uploads: 0
|
Quote:
You can certainly adjust any of these values with program. Scoring system may have to be determined by testers and some input here on the forums. You wont get the right on the first try. |
|
|
|
08-24-15, 01:54 AM
|
#7 |
|
Difficulties Numbing
|
Thank you for that information. I shall have to experiment.
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
