The Little Guy Posted March 3, 2009 Share Posted March 3, 2009 In Python 2.5, I could just do this: root = "C:\Users\Administrator\Desktop\webserver\htdocs" and it would create a string, now in 3.0, I get an error: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-4: truncated \UXXXXXXXX escape What does that mean, and what do I do to fix it? Quote Link to comment https://forums.phpfreaks.com/topic/147704-python-25-30/ Share on other sites More sharing options...
corbin Posted March 5, 2009 Share Posted March 5, 2009 Change all of the \ to \\. Quote Link to comment https://forums.phpfreaks.com/topic/147704-python-25-30/#findComment-777742 Share on other sites More sharing options...
trq Posted March 6, 2009 Share Posted March 6, 2009 Better still use a raw string.... root = r'C:\Users\Administrator\Desktop\webserver\htdocs' Quote Link to comment https://forums.phpfreaks.com/topic/147704-python-25-30/#findComment-777988 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.