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 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 st

Re: hex int and string

2009-11-30 Thread jessica
On 11月27日, 下午6时59分, Marco Mariani 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/ mbt shoe

Re: hex int and string

2009-11-30 Thread 84715...@qq.com
On 11月27日, 下午6时59分, Marco Mariani 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.jerseysup.com"; targ

Re: hex int and string

2009-11-30 Thread 84715...@qq.com
On 11月27日, 下午4时54分, luca72 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 http://www.jerseysup.com"; tar

Re: hex int and string

2009-11-28 Thread Tim Roberts
Marco Mariani 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 Providenza & Boekelheid

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 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 0xd

Re: hex int and string

2009-11-27 Thread jessica
On 11月27日, 下午4时54分, luca72 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 http://www.mbthome.net/ mbt sho

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 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 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 ne

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 writes: > i'm using pyscard I don't know what that is; can you give a link to what you're referring to?

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 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 text >

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 th

Re: hex int and string

2009-11-27 Thread 84715...@qq.com
On 11月27日, 下午5时28分, 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 > > Luca >

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 wrote: > luca72 writes:

Re: hex int and string

2009-11-27 Thread Ben Finney
luca72 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 below. I can only