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
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
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
"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
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
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
#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
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
; 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
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
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
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
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
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
14 matches
Mail list logo