Re: Python - decode('hex')

2017-02-20 Thread Ganesh Pal
Got it , MRAB, Thanks for the explanation it was such a simple thing I was breaking my head over it On Tue, Feb 21, 2017 at 1:34 AM, MRAB wrote: > On 2017-02-20 19:43, Ganesh Pal wrote: > >> On Feb 21, 2017 12:17 AM, "Rhodri James" wrote: >> >> On 20/02/17 17:55, Ganesh Pal wrote: >> >> 1. T

Re: Python - decode('hex')

2017-02-20 Thread Steve D'Aprano
On Tue, 21 Feb 2017 06:43 am, Ganesh Pal wrote: > How can I make my program 2 look like program 1 I don't understand the question. If you want program 2 to look like program 1, you can edit program 2 and change it to look like program 1. But why not just use program 1? It already looks like progr

Re: Python - decode('hex')

2017-02-20 Thread MRAB
On 2017-02-20 19:43, Ganesh Pal wrote: On Feb 21, 2017 12:17 AM, "Rhodri James" wrote: On 20/02/17 17:55, Ganesh Pal wrote: 1. The only difference between both the programs the difference are just the below lines. newdata = '64000101057804'.decode('hex') and newdata = "" newdata =

Re: Python - decode('hex')

2017-02-20 Thread Ganesh Pal
On Feb 21, 2017 12:17 AM, "Rhodri James" wrote: On 20/02/17 17:55, Ganesh Pal wrote: > 1. The only difference between both the programs the difference are just > the below lines. > > newdata = '64000101057804'.decode('hex') > > and > > newdata = "" > newdata = '64000101057804' > newdata

Re: Python - decode('hex')

2017-02-20 Thread MRAB
On 2017-02-20 17:55, Ganesh Pal wrote: Hello Python world, I am on Linux and Python 2.7 , I need some help to figure out what is going wrong in the below piece of code I am trying to replace seven bytes in the hexdumfile at a given offset Program 1 works fine #!/usr/bin/python from qa.uti

Re: Python - decode('hex')

2017-02-20 Thread Rhodri James
On 20/02/17 17:55, Ganesh Pal wrote: 1. The only difference between both the programs the difference are just the below lines. newdata = '64000101057804'.decode('hex') and newdata = "" newdata = '64000101057804' newdata.decode('hex') What is happening here and how do I fix this in

Python - decode('hex')

2017-02-20 Thread Ganesh Pal
Hello Python world, I am on Linux and Python 2.7 , I need some help to figure out what is going wrong in the below piece of code I am trying to replace seven bytes in the hexdumfile at a given offset Program 1 works fine #!/usr/bin/python from qa.utils.easy_popen import run import pdb def