win32pipe.popen4 howto example

2008-10-29 Thread yaipa
trying to remind myself that running a subprocess under Win32 isn't a pain in the ass... ];^) ### #!/usr/bin/env python ''' original author credits: chris levis original sources found: http://mail.python.org/pipermail/python-list/2

Re: Sequence iterators with __index__

2008-06-27 Thread yaipa
On Jun 24, 4:19 pm, schickb <[EMAIL PROTECTED]> wrote: > On Jun 24, 3:45 pm, Matimus <[EMAIL PROTECTED]> wrote: > > > > > > I think it would be useful if iterators on sequences had the __index__ > > > method so that they could be used to slice sequences. I was writing a > > > class and wanted to re

XOR Binascii Hex Strings using the PyCrypto module

2007-02-16 Thread yaipa
I snipped this bit of code out of Andrew Kuchling 'pyCrypto' test fixture. Having a need to XOR Binascii Hex strings in my current project, I found it very helpful to cut down on a bit of code clutter. So if you have a need for a Crypto module, this one seems to work off the self without much ef

Switching a Dataprobe iP-415/815 (basic) using TCP

2006-08-10 Thread yaipa
>< #!/usr/bin/env python import socket import sys, time # -- # File: dataprobe.py # Author: Alan Haffner # Date: 2006-08-10 # Rev. .60 # # Tested on Linux only # # Usage: dataprobe.py # # $> dataprobe.py 5P 4 # $>

putting an Icon in "My Computer"

2005-11-03 Thread yaipa
All, I've been asked by my boss to put an Icon in WinXP's "My Computer" for a utility we use around the shop. My tool of choice is of course Python and therefore what I am using to attempt my given task. I have no trouble putting Icons in the WinXP Toolbar using Python, but have totally failed t

Re: creating .NET clients with python

2005-03-03 Thread yaipa
t is what you want to do. Cheers, --Alan Guy Robinson wrote: > Thanks Alan, > > Are you saying I can create python .net clients with PythonNet. My understanding > is I can only use .net clients from python not the other way around. > > Do you have an example showing creating a .n

Re: creating .NET clients with python

2005-03-03 Thread yaipa
Guy, I can tell you that pythonNet is quite far along, rel 1, Beta 4 actually. here is a c.l.p link to the three major releases. http://groups-beta.google.com/group/comp.lang.python/browse_frm/thread/ddfc68767901007c/445f2052948d93e2?q=pythonnet&_done=%2Fgroup%2Fcomp.lang.python%2Fsearch%3Fgroup

Re: Redirecting stdout/err under win32 platform

2005-01-30 Thread yaipa
David, Googling comp.lang.python /w this string "stderr win32" yielded 109 results. So I think if you poke around a bit you will find your answer in the archives. Sorry for no direct help tonight... Cheers, --Alan David Douard wrote: > Hi everybody, > > let me explain by problem: > I am working

Re: finding/replacing a long binary pattern in a .bin file

2005-01-19 Thread yaipa
Pattern* in the .bin file to be updated and the string method did both in one shot. Cheers, --Alan John Lenton wrote: > On Wed, Jan 12, 2005 at 10:36:54PM -0800, yaipa wrote: > > What would be the common sense way of finding a binary pattern in a > > .bin file, say some 200 byt

Re: finding/replacing a long binary pattern in a .bin file

2005-01-19 Thread yaipa
Bengt, Thanks for the input, sorry, your diff threw me the first time I looked at it, but then I went back and tried it later. Yes it works fine and I've tucked it away for later use. For this particular Use Case String.replace seems to get the job done in short order and the tool needs to be ma

Re: finding/replacing a long binary pattern in a .bin file

2005-01-19 Thread yaipa
Thanks Francois, It worked as expected. --- source_data = open("source_data.bin", 'rb').read() search_data = open("search_data.bin", 'rb').read() replace_data = open("replace_data.bin", 'rb').read() outFile = open("

Re: finding/replacing a long binary pattern in a .bin file

2005-01-14 Thread yaipa
Bengt, and all, Thanks for all the good input. The problems seems to be that .find() is good for text files on Windows, but is not much use when it is binary data. The script is for a Assy Language build tool, so I know the exact seek address of the binary data that I need to replace, so maybe

finding/replacing a long binary pattern in a .bin file

2005-01-12 Thread yaipa
What would be the common sense way of finding a binary pattern in a .bin file, say some 200 bytes, and replacing it with an updated pattern of the same length at the same offset? Also, the pattern can occur on any byte boundary in the file, so chunking through the code at 16 bytes a frame maybe a

Re: what would you like to see in a 2nd edition Nutshell?

2004-12-30 Thread yaipa
Alex Martelli wrote: > I'm considering proposing to O'Reilly a 2nd edition of "Python in a > Nutshell", that I'd write in 2005, essentially to cover Python 2.3 and > 2.4 (the current 1st edition only covers Python up to 2.2). > > What I have in mind is not as complete a rewrite as for the 2nd vs 1