Stefan Müller

actinidiaFX

About Me

Connect

LOCATION
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

python syntax error for valid code March 12, 2023, 8:22 p.m.

Hi tamte and SWest,

Thank you both very much for your help!

The 4 backslashes indeed do the trick and printing the result returns what you would expect. I actually had tried it with 3 backslashes but considering tamte's explanation it makes sense why it has to be 4.

Cheers,

Stefan

python syntax error for valid code March 5, 2023, 5:19 p.m.

Hello,

I get a syntax error with the following lines of code in a python sop:

test = 'my\string'
test.replace('\\', '/')


Python error: File "<stdin>", line 2
test.replace('\', '/')
^
SyntaxError: EOL while scanning string literal

I'm pretty sure the code is correct and it works when executing it in my Linux terminal. However, before logging a bug I wanted to check if I'm missing something obvious, or if it's just me the code isn't working for.

Thank you,
Stefan