On 06/09/16 03:18, monik...@netzero.net wrote:
> I put 
>
> print( os.getcwd() )
>
> into my script, and got 
>
> C:\Users\Monika\Documents\PythonWeb\class3code\class3code

Is that the directory you expected? Is it where your html file lives?

> So I put into my script:
>
> base_url = 
> 'C:\Users\Monika\Documents\PythonWeb\class3code\class3code\button.html' 
> instead of base_url = 'button.html'
> and ran it andI got a popup message in python:
>
> (unicode error) 'unicodesscape' codec can't decode bytes in position 2-3; 
> truncated  \UXXXXXXXXescape

Because you are using a single backslash Python sees the \U as a Unicode
indicator. Either change the backslashes to forward slashes or put an 'r'
in front of the string to make it raw:

base_url = r'C:\Users\Monika\Documents\.....'


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to