Trouble converting hex to decimal?

2005-02-05 Thread Earl Eiland
I'm trying to process the IP packet length field, as recorded by pcap (Ethereal) and recovered using pcapy. When I slice out those bytes, I get a value that shows in '\x00' format, rather than '0x00'. Neither int() nor eval() are working. How do I handle thi

Can't get pcap file scanner to terminate normally

2005-02-09 Thread Earl Eiland
I'm using pcapy to scan a packet capture file. I've tried a variety of tests to end the loop at EOF, but can't seem to avoid the program terminating with a pcapy.PcapError. I've tested for empty lists (while Raw == [] or Passed == []:) and strings (while Raw ==""] or Passed == "":) as well as the

passing lists

2005-03-02 Thread Earl Eiland
I have a program in which I'm passing a list to functions. When I reference an element in a function to which it is passed, I get the error message "unsubscriptable object". When printing the list contents in that same function, I get "xxx is ". How do I pass a lis

Re: passing lists

2005-03-02 Thread Earl Eiland
passing something that is not a list to your function. > > As it stands, you don't give enough information to give an actual answer. > > Peace > Bill Mill > bill.mill at gmail.com > > > On Wed, 02 Mar 2005 14:05:18 -0700, Earl Eiland <[EMAIL PROTECTED

Re: passing lists

2005-03-03 Thread Earl Eiland
t;/home/earl/ResearchProjects/IntrusionResistance/NewPhasee2/Parser.py", l ine 132, in Match Last_Passed = Raw_packet_queue[0][0][1] TypeError: unsubscriptable object On Wed, 2005-03-02 at 15:34, Steve Holden wrote: > Earl Eiland wrote: > > def Match(..., Raw_packet_queue, ...

SOLVED: passing lists

2005-03-03 Thread Earl Eiland
It turns out that the function call was passing arguments in a different order than they were being received. Thanks, everyone, for your help. earl -- http://mail.python.org/mailman/listinfo/python-list

There's GOT to be a better way!

2005-03-03 Thread Earl Eiland
I'm writing my first program where I call custom modules. The 'global' command doesn't seem to apply, so how do I change a variable internally in a module without passing it down n layers, and then back out again? Earl -- http://mail.python.org/mailman/listinfo/python-list

Re: There's GOT to be a better way!

2005-03-03 Thread Earl Eiland
On Thu, 2005-03-03 at 15:11, Steve Holden wrote: > Earl Eiland wrote: > > I'm writing my first program where I call custom modules. The 'global' > > command doesn't seem to apply, so how do I change a variable internally > > in a module without passing

Re: There's GOT to be a better way!

2005-03-03 Thread Earl Eiland
On Thu, 2005-03-03 at 16:43, Steve Holden wrote: > Earl Eiland wrote: > > On Thu, 2005-03-03 at 15:11, Steve Holden wrote: > > > >>Earl Eiland wrote: > >> > >>>I'm writing my first program where I call custom modules. The 'global' >

Re: There's GOT to be a better way!

2005-03-03 Thread Earl Eiland
On Thu, 2005-03-03 at 16:46, Steven Bethard wrote: > Earl Eiland wrote: > > module.py > > def A(): > > test = 1 > > for x in range(10): B() > > > > def B(): > > test = test + 1 > > >

autoexecution in Windows

2005-03-07 Thread Earl Eiland
How does one make a Python program auto-execute in Windows? Earl -- http://mail.python.org/mailman/listinfo/python-list

Re: autoexecution in Windows

2005-03-07 Thread Earl Eiland
In Linux, if I make the first line #!/path/to/Python, all I have to do to execute the program is type ./FileName (assuming my pwd is the same as FileName). what's the Windows equivalent? Earl On Mon, 2005-03-07 at 13:36, F. Petitjean wrote: > Le Mon, 07 Mar 2005 13:25:35 -0700, Earl

Re: autoexecution in Windows

2005-03-07 Thread Earl Eiland
O.K. I stand corrected. "auto-execute is the wrong term. Earl On Mon, 2005-03-07 at 14:03, rbt wrote: > Earl Eiland wrote: > > How does one make a Python program auto-execute in Windows? > > > > Earl > > > > No program (python or other) can just arbitrar

capturing text from a GUI window

2005-03-08 Thread Earl Eiland
Anyone know how to capture text from GUI output? I need to process information returned via a GUI window. Earl -- http://mail.python.org/mailman/listinfo/python-list

Re: capturing text from a GUI window

2005-03-09 Thread Earl Eiland
On Tue, 2005-03-08 at 14:27, [EMAIL PROTECTED] wrote: > Earl Eiland wrote: > > Anyone know how to capture text from GUI output? I need to process > > information returned via a GUI window. > > > > Earl > > Assuming Windows, then these guys have an interesting t

executing non-Python conde

2005-03-11 Thread Earl Eiland
parameters. (Although there is a reference to global and local dictionaries that I don't understand.) Surely there is a way to do this! Earl Eiland -- http://mail.python.org/mailman/listinfo/python-list

Re: executing non-Python conde

2005-03-11 Thread Earl Eiland
So where do I find win32process. It's not a builtin (at least import win32process fails) A search of python.org fails. A search of sourceforge fails. A google search brings up lots of stuff, but I didn't find the module. Earl Eiland On Fri, 2005-03-11 at 09:02, Larry Bates wrote: >

blocking a program until a non-Python process terminates

2005-03-12 Thread Earl Eiland
I'm running an .exe in Python, using subProcess.Popen. The executable writes data to a file I process later on in the program. Unfortunately, my program returns the error "no such file...". How do I block execution until the external executable terminates? Earl -- http://mail.python.org/mailm

error sending path to Win OS

2005-03-12 Thread Earl Eiland
7;\' + Filename.split('.') + '.ext') generates a syntax error. Earl Eiland -- http://mail.python.org/mailman/listinfo/python-list

Re: error sending path to Win OS

2005-03-14 Thread Earl Eiland
le or directory: 'Test_Data\\Book1.rk' What am I doing wrong? Earl On Sat, 2005-03-12 at 15:16, Michael Hoffman wrote: > Earl Eiland wrote: > > os.path.getsize(Inputdirectory + '\\' + Filename) works, but > > os.path.getsize(Inputdirectory + '\\'

Re: error sending path to Win OS

2005-03-14 Thread Earl Eiland
le or directory: 'Test_Data\\Book1.rk' What am I doing wrong? Earl On Sat, 2005-03-12 at 15:16, Michael Hoffman wrote: > Earl Eiland wrote: > > os.path.getsize(Inputdirectory + '\\' + Filename) works, but > > os.path.getsize(Inputdirectory + '\\'

program hangs when external process crashes

2005-03-18 Thread Earl Eiland
th.join(InputDirectory, x) + ' -apply -quit' PROC = subprocess.Popen(Command_String) PROC.wait() Occasionally, WinRK crashes, and this program hangs at PROC.wait(). What can I do about this? Earl Eiland -- http://mail.python.org/mailman/listinfo/python-list

program hangs when external process crashes

2005-03-19 Thread Earl Eiland
th.join(InputDirectory, x) + ' -apply -quit' PROC = subprocess.Popen(Command_String) PROC.wait() Occasionally, WinRK crashes, and this program hangs at PROC.wait(). What can I do about this? Earl Eiland -- http://mail.python.org/mailman/listinfo/python-list

subprocess 'wait' method causes .py program to hang.

2005-03-19 Thread Earl Eiland
on program doesn't detect the error condition, and hangs. What can I do about this? Earl Eiland -- http://mail.python.org/mailman/listinfo/python-list

python versions of perl modules

2004-12-30 Thread Earl Eiland
I need to process some tcpdump files. PERL has Net::Pcap and NetPacket, but I would rather work in PYTHON. Do PYTHON equivialnts of these two modules exist? Earl Eiland -- http://mail.python.org/mailman/listinfo/python-list

python versions of perl modules

2004-12-30 Thread Earl Eiland
I need to process a tcpdump file. PERL has Net::Pcap and NetPacket for this purpose. What does PYTHON have? I haven't found anything. Earl Eiland -- http://mail.python.org/mailman/listinfo/python-list

possible bug?

2005-03-22 Thread Earl Eiland
I've been having trouble with a program hanging when using the subprocess modules "wait()" method. Replacing it with with a loop that used "poll()" solved the problem. Earl -- http://mail.python.org/mailman/listinfo/python-list

Re: possible bug?

2005-03-22 Thread Earl Eiland
while PROC.poll() == None: time.sleep(1) has not hung on approximately 7,000 calls to WinRK. Earl On Tue, 2005-03-22 at 09:35, Jeff Epler wrote: > On Tue, Mar 22, 2005 at 07:16:11AM -0700, Earl Eiland wrote: > > I've been having trouble with a program hanging when using the > >

Re: possible bug?

2005-03-22 Thread Earl Eiland
I'm running ActivePython PythonWin 2.4, and get the error message"'AributeError: 'module' object has no attribute 'SIGALRM'". The example provided in the ActivePython documents use signal.SIGALRM, so I'm not sure what's going on... Earl On Tue, 2005-03-22 at 12:43, Jeff Epler wrote: > I wrote a

Re: possible bug?

2005-03-22 Thread Earl Eiland
Well, your program ran successfully. Perhaps WinRK is not well behaved. How can a process terminate in such a way that poll() can read it, but wait() won't? Earl On Tue, 2005-03-22 at 13:49, Jeff Epler wrote: > hm, I guess SIGALRM doesn't exist on Windows. You can run the program > without th

Re: possible bug?

2005-03-24 Thread Earl Eiland
me to recover from the failure. It doesn't eliminate it. Earl On Thu, 2005-03-24 at 00:16, Tim Roberts wrote: > Earl Eiland <[EMAIL PROTECTED]> wrote: > > >I'm running the following code on Windows 2000, 5.00.2195: > > > >for x in Files: > >

terminating an inactive process

2005-04-02 Thread Earl Eiland
I'm running a PyWin program that executes another program using subprocess.Popen(). Unfortunately, this other program isn't well behaved, and frequently terminates without terminating its process. After this happens enough times, all my memory is tied up, and the machine crashes. Using subproces

Re: There's GOT to be a better way!

2005-04-09 Thread Earl Eiland
On Thu, 2005-03-03 at 16:43, Steve Holden wrote: > Earl Eiland wrote: > On Thu, 2005-03-03 at 15:11, Steve Holden wrote: > > Earl Eiland wrote: > > I'm writing my first program where I call custom modules. The 'global' > command doesn't seem to apply,

error using process module Process class

2005-05-10 Thread Earl Eiland
When executing the following code snippet import process ... ... for x in Files: Command_String = 'C:\Program Files\WinRK\WinRK.exe -create ' + os.path.join(InputDirectory, os.path.splitext(x)[0]) + ' -set compression_method ppmz -setg include_paths none -add ' + os.path.join(InputDirector

command string good in subprocess.Popen(string) fails in process.Process(string)

2005-05-16 Thread Earl Eiland
The command string consists of "filename.exe instruction1 instruction2 ..." It works in subprocess, but in process, returns the error "can't find the file instruction1". How do I pass command line instructions in process.Process? I tried a list ['filename.exe', 'instruction1 instruction2 ...']

Re: command string good in subprocess.Popen(string) fails in process.Process(string)

2005-05-16 Thread Earl Eiland
at work fine on Windows. Under the hood they are using the Win32 API WaitForSingleObject() and TerminateProcess() functions." http://starship.python.net/~tmick/"; On Mon, 2005-05-16 at 07:27, Peter Hansen wrote: > Earl Eiland wrote: > > The command string consists of "