On Thu, Jun 28, 2012 at 1:55 PM, James Chapman <ja...@uplinkzero.com> wrote:
> Thanks Tim, while this works, I need the name to be stored in a variable as
> it's dynamic.
>
> In other words, how do I rewrite
> open(u"blah£.txt")
>
> to be
> filename = "blah£.txt"
> open(filename)

You have to create a unicode-string, not a byte-string.  So, like this:

filename = u"blah£.txt"
open(filename)

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

Reply via email to