Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #56257

Re: Odd-length string

From Roy Smith <roy@panix.com>
Newsgroups comp.lang.python
Subject Re: Odd-length string
Date 2013-10-06 09:46 -0400
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <roy-7CB56C.09460306102013@news.panix.com> (permalink)
References <0f1b6cd6-3025-4bdc-8f80-73a51a7ed241@googlegroups.com>

Show all headers | View raw


In article <0f1b6cd6-3025-4bdc-8f80-73a51a7ed241@googlegroups.com>,
 markotaht@gmail.com wrote:

> print("Key-" + str(võti) + ": " + str(unhexlify("".join(tulemus))))
> 
> IM getting this error on this line. This is the print line of a decryption 
> program. I wanti it to convert the tulemus which is in HEX to ASCII so i 
> could read it. I could use online translators for the line, but since i have 
> 255 lines of the HEX codes, it would be higly unefficient.
> 
> How to i fix the Oddlenght string?

Some basic advice on asking for help:

1) Don't tell us what the error was, show us.  Run your program, then 
cut-and-paste the entire stack trace into your post.

2) Tell us what version of Python you're using.  I'm assume one of the 
Python 3 versions, since you put ()'s after print, but don't make people 
guess.

3) Reduce the problem down to the smallest possible amount of code.  Do 
you get the error when you do:

print(str(unhexlify("".join(tulemus))))

what about

print(unhexlify("".join(tulemus)))

or

print("".join(tulemus))

or 

print(str(võti))

every little thing you can hack away and still generate the error gets 
you (and us!) one step closer to understanding what's happening.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Odd-length string markotaht@gmail.com - 2013-10-06 06:10 -0700
  Re: Odd-length string Roy Smith <roy@panix.com> - 2013-10-06 09:46 -0400
  Re: Odd-length string Peter Otten <__peter__@web.de> - 2013-10-06 16:31 +0200
  Re: Odd-length string markotaht@gmail.com - 2013-10-06 07:37 -0700
    Re: Odd-length string Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-06 15:56 +0100
    Re: Odd-length string Terry Reedy <tjreedy@udel.edu> - 2013-10-06 15:50 -0400
    Re: Odd-length string Piet van Oostrum <piet@vanoostrum.org> - 2013-10-06 20:59 -0400

csiph-web