Re: Reading Fortran binary files

2005-01-10 Thread Michael Fuhr
e Int. Have you looked at the struct module? http://www.python.org/doc/2.4/lib/module-struct.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python serial data aquisition

2005-01-09 Thread Michael Fuhr
1 left 7 positions (not 8) and OR it with byte2 (giving 1001 0011 0101). value = ((ord(byte1) & 0x1f) << 7) | (ord(byte2) & 0x7f) If the actual byte and/or bit order is different then you'll have to modify the expression, but this should at least give you ideas. -- Michael Fu

Re: printing line numbers for debugging purpose

2005-01-08 Thread Michael Fuhr
e using an exception handler. See also the traceback module. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: passing parameters to menu commands (looping througha list)

2005-01-07 Thread Michael Fuhr
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: > l_dec_list = ['ATR','IN'] > > for i in l_dec_list: > l_dec.add_command(label = i, command= lambda: self.__Dec(i)) Give the lambda an argument with a default: l_dec.add_command(label=i, command=l

Re: python versions of perl modules

2004-12-30 Thread Michael Fuhr
y becase they no longer have to wait for somebody else to solve their problems. It also leads to greater confidence that the answer is correct because they no longer have to trust that somebody else knows what they're talking about or is telling the truth. -- Michael Fuhr http://www.fu

Re: python versions of perl modules

2004-12-30 Thread Michael Fuhr
ords like "python", "pcap", "packet", and other terminology related to what you're trying to do. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -- http://mail.python.org/mailman/listinfo/python-list

Re: cosmetic Tkinter question

2004-12-26 Thread Michael Fuhr
#x27;re not, and it looks a little gross. How do I > get them to align? You can see what's happening if you create the frames with options like relief=RIDGE, bd=1. Read up on how the packer works and how to control layout with expand, fill, and anchor. -- Michael Fuhr http://www.fuhr.org

Re: Redirecting stdin, stdout, and stderr to a window

2004-12-16 Thread Michael Fuhr
write, and assign instances of that method to the input and output filehandles. For example, you could write a class with a write() method that displays text in a window, then assign an instance of that class to sys.stdout. Subsequent calls to 'print' would send output to the win

Re: Regular Expression

2004-12-15 Thread Michael Fuhr
; Lot's of good solutions for the problem. In the special case where you want the current load average numbers for the box running the program and you have Python 2.3 or later, you could use os.getloadavg(). -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Named pipes in threads

2004-12-12 Thread Michael Fuhr
are you trying to do? Perhaps if you backed up and described the "what" we could make better recommendations about the "how." -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -- http://mail.python.org/mailman/listinfo/python-list

Re: socket.makefile & AF_UNIX

2004-12-10 Thread Michael Fuhr
s like readline() depends on the format of the data that the other end will send. If it's binary then you might need to use s.recv(). -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Mean, median, and mode

2004-12-06 Thread Michael Fuhr
return values. I like. :) > > Thank you, I'm just using a paradigm (exploiting lambdas) that I picked > up while going through various functional programming modules. print median([1, 2, 3, 4, 5, 6]) 4 Shouldn't the median be 3.5? -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Help With Hiring Python Developers

2004-12-05 Thread Michael Fuhr
work in the good-ol'-boy network (although that might be part of it), but that by making it difficult for anybody else, you're ensuring that only good programmers ever work on the code. Tell that to the poor slob who gets stuck with the job because the department can't or won't hir

Re: question on regular expressions

2004-12-03 Thread Michael Fuhr
s causes the pattern to replace everything up to the last '%5C' before a comma or the end of the string. Regular expressions aren't the only way to do what you want. Python has standard modules for parsing URLs and file paths -- take a look at urlparse, urllib/urllib2, and os.path. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ -- http://mail.python.org/mailman/listinfo/python-list