Seo's pointing out that you're building up a string as-if the user had typed it 
into the console, and that string contains non-escaped characters.  So you're 
putting in the equivalent of:

sys.path.append('
'C:\Documents and Settings\Administrator\My Documents\Visual Studio 
2005\Projects\CNU2Demo\CNU2Demo\Bin\Debug')

If you typed this at the console then the \B in \Bin\Debug would turn into the 
backspace escape character, and the path wouldn't be correct.  If you change 
this to:

ipEngine1.Execute("sys.path.append(r'" + Paths.MiscDirs.myapppath + "')");

then you should get the right behavior (note you have the @ don't escape 
character for C#, and I just moved that to being in the embedded string that 
you're passing to Python (the r string form).  You could also still have the @ 
but in the sample code you're not really using it.

Alternately you could do the escaping yourself.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of JoeSox
Sent: Saturday, June 03, 2006 2:41 AM
To: Discussion of IronPython
Subject: Re: [IronPython] sys.path.append bug?

On 6/3/06, Sanghyeon Seo <[EMAIL PROTECTED]> wrote:
> 2006/6/3, JoeSox <[EMAIL PROTECTED]>:
> > It appears the "CNU2Demo\x08in\\Debug" should read "CNU2Demo\\bin\\Debug"
>
> Well,
>
> >>> '\b'
> '\x08'
>
> If you use PythonEngine.Execute, you should escape Python string.

Seo,

I don't understand what you are saying because I used .Execute and it stored 
the value incorrectly.

Later, Joe
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to