[Baypiggies] how can I change the input parameter in my executable while calling from either os.system or os.popen calls?

David Elsen elsen.david08 at gmail.com
Thu Aug 21 18:31:12 CEST 2008


Eric,
Thanks. It should work, I guess. I will check and trouble you again if it
does not work.
David

On Wed, Aug 20, 2008 at 7:31 PM, Eric Walstad <eric at ericwalstad.com> wrote:

> Hi David
>
> On Wed, Aug 20, 2008 at 5:53 PM, David Elsen <elsen.david08 at gmail.com>
> wrote:
> ...
> >              read_cmd = './testtool  offset'
> >              read_content = os.popen(read_cmd).read()
> >
> > reg1 = reg (0x50)
> >
> > reg1.reg_read(0x50)
> >
> > Basically I wanted to pass the offset as input parameter to my executable
> > "testtool" and run the testtool for offset.
>
> Will this work for you?
> >>> for offset in range(75, 86):
> ...     read_cmd = './testtool %#x' % offset
> ...     print read_cmd
> ...
> ./testtool 0x4b
> ./testtool 0x4c
> ./testtool 0x4d
> ./testtool 0x4e
> ./testtool 0x4f
> ./testtool 0x50
> ./testtool 0x51
> ./testtool 0x52
> ./testtool 0x53
> ./testtool 0x54
> ./testtool 0x55
> >>>
>
> See also:
> http://docs.python.org/lib/typesseq-strings.html
>
> hth, Eric.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20080821/8295810b/attachment.htm>


More information about the Baypiggies mailing list