Quoting values to put them into generated code can be tricky to get your head around.
The string you're building to execute doesn't quote the filename string in the Python code. The Python interpreter is seeing:
x = C:\blah\blah + profile-value
So it's complaining about the colon. It needs to see:
x = r'C:\blah\blah' + r'profile-value'
So the C# should be something like:
py.Execute("x = r'" + filePath + "' + r'" + profile + "'", s);
It probably makes more sense to just do the full path construction in C# and simplify the Python string you're building, although maybe that's because the code you're posting about is a simplification of the real problem.