On Wed, 25 Oct 2017, Schaff, Frederik wrote:
I am using python 3. Here is the gretl output, using the script of
Jack (i.e. with dotdir as path - the problem is general, however).
----
Array of strings, length 4
[1] " File "C:\Users\Frederik\AppData\Roaming\gretl\gretltmp.py", line
3"
[2] " a =
next(walk("C:\Users\Frederik\AppData\Roaming\gretl"))[1]"
[3] " ^"
[4] "SyntaxError: (unicode error) 'unicodeescape' codec can't decode
bytes..."
---
Microsoft's backslash path-separation is a minefield for text
processing. You're much better off using forward slashes (which work
fine). If you get a backslash-separated path from gretl, or elsewhere,
you can fix it using strsub:
string path = $dotdir
string bslash = "\"
path = strsub(path, bslash, "/")
Allin