Re: Spoiler to Python Challenge (help!!!)

2005-10-04 Thread Christos Georgiou
On Tue, 27 Sep 2005 10:42:20 -0500, rumours say that Terry Hancock <[EMAIL PROTECTED]> might have written: >This works: > bz2.decompress(eval(repr(user))) >'huge' >This may have some security issues, though, since it evaluates essentially >any expression given for user. I'd be interested to

Re: Spoiler to Python Challenge (help!!!)

2005-09-29 Thread Ian Vincent
Terry Hancock <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > bz2.decompress(eval('"' + user + '"')) > > Sorry about that. I was trying the other as an alternative, > but in fact, it doesn't work. So ignore that. Excellent! Thanks. -- http://mail.python.org/mailman/listinfo/pytho

Re: Spoiler to Python Challenge (help!!!)

2005-09-28 Thread Terry Hancock
On Tuesday 27 September 2005 10:42 am, Terry Hancock wrote: > >>> bz2.decompress(eval(repr(user))) > 'huge' Actually, it doesn't -- I sent you the wrong version of the email. THIS works (and is what actually produced the output above). >>> bz2.decompress(eval('"' + user + '"')) Sorry about that

Re: Spoiler to Python Challenge (help!!!)

2005-09-28 Thread Ian Vincent
Terry Hancock <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > Took me a long time to figure out what you meant. ;-) > > So the string actually contains the backslashes, not the escaped > characters. > > This works: > bz2.decompress(eval(repr(user))) > 'huge' Unfortunately, it d

Re: Spoiler to Python Challenge (help!!!)

2005-09-28 Thread Ian Vincent
"Terry Reedy" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > please, line = line[20:-1], etc, is easier to read and understand ;-) Thanks, i'll put that in. -- http://mail.python.org/mailman/listinfo/python-list

Re: Spoiler to Python Challenge (help!!!)

2005-09-27 Thread Terry Hancock
On Tuesday 27 September 2005 08:32 am, Ian Vincent wrote: > I have a webpage with a BZ2 compressed text embedded in it looking like: > > 'BZh91AY&SYA\xaf\x82\r\x00\x00\x01\x01\x80\x02\xc0\x02\x00 \x00!\x9ah3M > \x07<]\xc9\x14\xe1BA\x06\xbe\x084' > > Now, if I simply copy and paste this into Pytho

Re: Spoiler to Python Challenge (help!!!)

2005-09-27 Thread Terry Reedy
"Ian Vincent" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > line = line[20:] > line = line[:-1] please, line = line[20:-1], etc, is easier to read and understand ;-) tjr -- http://mail.python.org/mailman/listinfo/python-list

Spoiler to Python Challenge (help!!!)

2005-09-27 Thread Ian Vincent
Damn this is annoying me. I have a webpage with a BZ2 compressed text embedded in it looking like: 'BZh91AY&SYA\xaf\x82\r\x00\x00\x01\x01\x80\x02\xc0\x02\x00 \x00!\x9ah3M \x07<]\xc9\x14\xe1BA\x06\xbe\x084' Now, if I simply copy and paste this into Python and decompress it - it works a treat. H