error occur when using py2exe

Steve Holden sholden at holdenweb.com
Tue Jul 31 13:12:08 EDT 2001


<engsol at teleport.com> wrote in message
news:3b66e351.4492439 at news.onemain.com...
> On Mon, 30 Jul 2001 23:23:02 +0800 (CST), "sdf" <wqh-2 at 263.net> wrote:
>
> >I type the following,but error appear.
>
> >I put the the myscript.py file  under d:/python21/program/
>
> >I think I must give a directory to the setup ,but when I use
>
> >setup(name="myscript",scripts=["/program/myscript.py"],)
>
> >error also jump out. How can I fix it
>
> Don't you need to 'escape' the path slashes?
>
> "C:\\dir\\file.py" for example?
>
> engsol (python newbie)

Backslashes ("\") need escaping as you suggest, but forward slashes ("/")
have no special semantics inside string literals, and can therefore be used
without any escaping. In *most* (but, annoyingly, not quite all) contexts,
your Windows Python programs can use forward slashes instead of backward
ones inside paths, and still be perfectly well understood. This is how the
original poster was handling the problem.

Nice to see a newbie jumping in to help, though. Your instincts are fine.
Keep up the good work!

regards
 Steve
--
http://www.holdenweb.com/








More information about the Python-list mailing list