Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #56261
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Subject | Re: Odd-length string |
| Date | 2013-10-06 15:56 +0100 |
| References | <0f1b6cd6-3025-4bdc-8f80-73a51a7ed241@googlegroups.com> <dc7e43a4-2f40-4275-8754-7e947f886fd9@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.784.1381071381.18130.python-list@python.org> (permalink) |
On 06/10/2013 15:37, markotaht@gmail.com wrote:
> I fixed this problem but encountered new problem. Problem was that some parts that came throug my decryption were 00 or 0 the first symbol so the program didnt show them.
>
> NEw problem is : Traceback (most recent call last):
> File "C:\Users\Marko\Desktop\hacker.org\XOR cypher.py", line 35, in <module>
> print("Key-" + str(võti) + ": " + str("".join(tulemus2)))
> TypeError: sequence item 0: expected str instance, bytes found
>
> If i take away the join command i get this: Key-00000000: [b'u', b'o', b'\x00', b'\x1d', b' ', b'|', b'N', b'\x0f', b'9', b'j', b'K', b'J', b'&', b'#', b'A', b'K', b'5', b'k', b'_', b'\x1e', b',', b'j', b'\x0c', b'\x08', b'i', b'(', b'\x06', b'\\', b'r', b'3', b'\x1f', b'V', b's', b'9', b'\x1d']
>
> the Key-00000000 is the key im using to decrypt the code. everything else is generated byt the decrytion process and the unhexlify command. So my guess is, the join command cant handle the b"u" type of format. how can i get rid of the b.
>
> Or does anyone have a better idea how to translate HEX into ASCII and sort out the lines that make sense
>
Will you please be kind enough to quote your replies in context.
--
Roses are red,
Violets are blue,
Most poems rhyme,
But this one doesn't.
Mark Lawrence
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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