Re: hex int and string

2009-11-30 Thread 84715...@qq.com
On 11月27日, 下午4时54分, luca72 lucabe...@libero.it wrote: hello i have a problem i have this str = 'D3' and i need to trasform in 0xd3 type int and not type string how i can do this? if i do hex(int(str,16) ) i obtain a string and this is not what i need. thanks Luca p stronga title=sport

Re: hex int and string

2009-11-30 Thread 84715...@qq.com
On 11月27日, 下午6时59分, Marco Mariani ma...@sferacarta.com wrote: Ben Finney wrote: i'm using pyscard I don't know what that is; can you give a link to what you're referring to? Simple story: he has seen the examples with hex literals and didn't know what they were. p stronga title=sport

Re: hex int and string

2009-11-30 Thread jessica
On 11月27日, 下午6时59分, Marco Mariani ma...@sferacarta.com wrote: Ben Finney wrote: i'm using pyscard I don't know what that is; can you give a link to what you're referring to? Simple story: he has seen the examples with hex literals and didn't know what they were. http://www.mbthome.net/

Re: hex int and string

2009-11-30 Thread jessica
On 11月28日, 上午11时41分, 84715...@qq.com 84715...@qq.com wrote: On 11月27日, 下午4时54分, luca72 lucabe...@libero.it wrote: hello i have a problem i have this str = 'D3' and i need to trasform in 0xd3 type int and not type string how i can do this? if i do hex(int(str,16) ) i obtain a

Re: hex int and string

2009-11-28 Thread Tim Roberts
Marco Mariani ma...@sferacarta.com wrote: luca72 wrote: i have checked and pyscard accept also the decimal notation, I'm not sure you ever understood what the problem was, or where, but I'm happy you feel like you've solved it. +1 QOTW. Great reply. -- Tim Roberts, t...@probo.com

hex int and string

2009-11-27 Thread luca72
hello i have a problem i have this str = 'D3' and i need to trasform in 0xd3 type int and not type string how i can do this? if i do hex(int(str,16) ) i obtain a string and this is not what i need. thanks Luca -- http://mail.python.org/mailman/listinfo/python-list

Re: hex int and string

2009-11-27 Thread Ben Finney
luca72 lucabe...@libero.it writes: str = 'D3' Be careful when choosing names. Here you have clobbered the existing string type binding to the name ‘str’. and i need to trasform in 0xd3 type int and not type string how i can do this? You already have the answer; you used it in your example

Re: hex int and string

2009-11-27 Thread luca72
i'm using pyscard and for send a command he need a list like this: cmd = [0xdd,0xff, etc] the problem is that i get a text like dd and i need to trasform it in 0xdd for the list and if i use hex i have a sting that is not what i need Luca On 27 Nov, 10:22, Ben Finney

Re: hex int and string

2009-11-27 Thread 84715...@qq.com
On 11月27日, 下午5时28分, luca72 lucabe...@libero.it wrote: i'm using pyscard and for send a command he need a list like this: cmd = [0xdd,0xff, etc] the problem is that i get a text like dd and i need to trasform it in 0xdd for the list and if i use hex i have a sting that is not what i need

Re: hex int and string

2009-11-27 Thread Lie Ryan
On 11/27/2009 8:28 PM, luca72 wrote: i'm using pyscard and for send a command he need a list like this: cmd = [0xdd,0xff, etc] the problem is that i get a text like dd and i need to trasform it in 0xdd for the list and if i use hex i have a sting that is not what i need # Do you know that

Re: hex int and string

2009-11-27 Thread luca72
i have checked and pyscard accept also the decimal notation, Thanks Luca On 27 Nov, 10:38, Lie Ryan lie.1...@gmail.com wrote: On 11/27/2009 8:28 PM, luca72 wrote: i'm using pyscard and for send a command he need a list like this: cmd = [0xdd,0xff, etc] the problem is that i get a

Re: hex int and string

2009-11-27 Thread Ben Finney
(Please don't top-post; it makes the message difficult to follow. Instead, post inline to the quoted material you're responding to, and remove material that you're not responding to.) luca72 lucabe...@libero.it writes: i'm using pyscard I don't know what that is; can you give a link to what

Re: hex int and string

2009-11-27 Thread Peter Otten
luca72 wrote: i'm using pyscard and for send a command he need a list like this: cmd = [0xdd,0xff, etc] Note that 0xdd is exactly the same as 221: 0xdd == 221 True It's just an alternative way to write an integer literal that is sometimes more convenient. Therefore you don't need the

Re: hex int and string

2009-11-27 Thread Marco Mariani
luca72 wrote: i have checked and pyscard accept also the decimal notation, I'm not sure you ever understood what the problem was, or where, but I'm happy you feel like you've solved it. -- http://mail.python.org/mailman/listinfo/python-list

Re: hex int and string

2009-11-27 Thread Marco Mariani
Ben Finney wrote: i'm using pyscard I don't know what that is; can you give a link to what you're referring to? Simple story: he has seen the examples with hex literals and didn't know what they were. -- http://mail.python.org/mailman/listinfo/python-list

Re: hex int and string

2009-11-27 Thread jessica
On 11月27日, 下午4时54分, luca72 lucabe...@libero.it wrote: hello i have a problem i have this str = 'D3' and i need to trasform in 0xd3 type int and not type string how i can do this? if i do hex(int(str,16) ) i obtain a string and this is not what i need. thanks Luca

Re: hex int and string

2009-11-27 Thread jessica
On 11月27日, 下午5时35分, 84715...@qq.com 84715...@qq.com wrote: On 11月27日, 下午5时28分, luca72 lucabe...@libero.it wrote: i'm using pyscard and for send a command he need a list like this: cmd = [0xdd,0xff, etc] the problem is that i get a text like dd and i need to trasform it in 0xdd