Graph, how to?

2005-01-25 Thread jrlen balane
i'm going to use now the matplotlib in plotting a graph.

i'm currently using python 2.3(enthought edition) on win 2000/xp.
i'm using boa constructor on the GUI part.

i am using an MDIParentFrame. one of the child frame will be used for
the table part. then another child frame will be used to show the
graph, how am i going to do this? will i just import the child frame
containing the tables and then i'll be able to just get the data from
the table and use it to plot a graph?
how am i going to assign to a variable each input to the table?
can you please show me a sample code to do this?
i'm a little lost since i'm a bit new to python.

also, how am i going to assign to a variable anything that a user
inputs to a wxTxtCtrl?

any help would greatly be appreciated. thanks and more power
-- 
http://mail.python.org/mailman/listinfo/python-list


how to separate hexadecimal

2005-02-01 Thread jrlen balane
i have a 4 digit hex number (2 bytes) and i want to separate it into 2
digit hex (1 byte each) meaning i want to get the upper byte and the
lower byte since i am going to add this two.
how am i going to do this?
should i treat it just like a normal string?
please help, thanks.

ex. hexa = '0x87BE"  # what i want to do is:
  a = 0x87, b = 0xBE# so that i could do this:
  c = a + b#which should be equal to 0x145
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to separate hexadecimal

2005-02-02 Thread jrlen balane
On Wed, 02 Feb 2005 17:36:04 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote:
> jrlen balane wrote:
> > i have a 4 digit hex number (2 bytes) and i want to separate it into 2
> > digit hex (1 byte each) meaning i want to get the upper byte and the
> > lower byte since i am going to add this two.
> > how am i going to do this?
> > should i treat it just like a normal string?
> > please help, thanks.
> >
> > ex. hexa = '0x87BE"  # what i want to do is:
> >   a = 0x87, b = 0xBE# so that i could do this:
> >   c = a + b#which should be equal to 0x145
> 
> divmod does what you want:
> 
> Py> val = 0x87be
> Py> hi, lo = divmod(val, 0x100)
> Py> hex(hi), hex(lo)
> ('0x87', '0xbe')
> Py> hex(hi + lo)
> '0x145'
> 
> Cheers,
> Nick.
> 
> --
> Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
> ---
>  http://boredomandlaziness.skystorm.net
> --
> http://mail.python.org/mailman/listinfo/python-list
> 
would i be able to perform bitwise operation with the result?
say, i want to get the two's complement of the result, is this correct:

twos_complement = (~ hex(hi + lo)) + 1
-- 
http://mail.python.org/mailman/listinfo/python-list


is there a problem on this simple code

2005-03-12 Thread jrlen balane
basically what the code does is transmit data to a hardware and then
receive data that the hardware will transmit.

import serial
import string
import time
from struct import *


ser = serial.Serial()

ser.baudrate = 9600
ser.port = 0
ser
ser.close()
ser.open()

command = 67
message_no = 1
total_data = 2

item = 12000#to warm-up the hardware
hexed = hex(item)
data_hi, data_lo = divmod(item, 0x100)
checksum = -(data_hi + data_lo + 0x46) & 0xff
ser.write(pack('6B', command, message_no, total_data, data_lo,
data_hi, checksum)) #serial transmit protocol
time.sleep(1)

item = 1
no = 0
for item in range(1, 30001, 250):
no = no +1
hexed = hex(item)
data_hi, data_lo = divmod(item, 0x100)
checksum = -(data_hi + data_lo + 0x46) & 0xff
ser.write(pack('6B', command, message_no, total_data, data_lo,
data_hi, checksum))
data = ser.read(10)
(command, msg_no, no_databyte, temp1, temp2, pyra1, pyra2,
voltage, current, checksum) = unpack('10B', data)  #serial receive
protocol
print no, command, msg_no, no_databyte, temp1, temp2, pyra1,
pyra2, voltage, current, checksum
time.sleep(1)

ser.close()


===
and here is some result after running the program on Idle Python 2.3
(enthought ed.)

1 70 168 6 0 0 0 0 0 0 12
2 70 2 6 0 0 0 0 0 0 178
3 70 3 6 0 0 0 0 0 0 177
4 70 4 6 0 0 0 0 0 0 176
5 70 5 6 0 0 0 0 0 0 175
6 70 6 6 0 0 0 0 0 0 174
7 70 7 6 0 0 0 0 0 0 173
8 70 8 6 0 0 0 0 0 0 172
9 70 9 6 0 0 0 0 0 0 171
10 70 10 6 0 0 0 0 0 0 170
11 70 11 6 0 0 0 0 0 0 169
12 70 12 6 0 0 0 0 0 0 168
13 70 13 6 0 0 0 0 0 0 167
14 70 14 6 0 0 0 0 0 0 166
15 70 15 6 0 0 0 0 0 0 165

==

the result i am expecting is for the data bytes (bytes 4-9) to change
its value since i am able to control the sensors which the data were
based. i am just asking for your opinion if there is something wrong
with this program, otherwise, it could be a hardware problem.

thanks in advance.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is there a problem on this simple code

2005-03-12 Thread jrlen balane
@sir harlin
so you are saying that there is nothing wrong in this simple program.


On 12 Mar 2005 07:39:31 -0800, Harlin Seritt <[EMAIL PROTECTED]> wrote:
> hah, this code is anything but simple...
> 
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is there a problem on this simple code

2005-03-12 Thread jrlen balane
the hardware is a school project that uses a microcontroller for "light dimming"
the message command "67" will tell the microcontroller (PIC16F877) to
do a command (to control the intensity of a lamp)
the message command "70" should tell the GUI that the microcontroller
has started transmitting.
the message sent by the GUI is different from the message sent by the
microcontroller
(but i guess sir John is right, i think i should use different
variable for the data transmitted and data received)
i am currently developing this part of the project which implements
the serial communication
i've fixed the command and total_data since i know beforehand that
this will be its value.
to simplify the program, i have also fixed the message_no since the
microcontroller will still accept the transmitted data as long as the
checksum == 0.

anymore suggestion???...
==
command = 67
message_no = 1
total_data = 2
item=1
for item in range(1, 30001, 250):
ser.open()
data_hi, data_lo = divmod(item, 0x100)
checksum = -(data_hi + data_lo + 0x46) & 0xff
ser.write(pack('6B', command, message_no, total_data, data_lo,
data_hi, checksum))
data = ser.read(10)
(command, msg_no, no_databyte, temp1, temp2, pyra1, pyra2,
voltage, current, checksum) = unpack('10B', data)  #serial receive
protocol
print command, msg_no, no_databyte, temp1, temp2, pyra1, pyra2,
voltage, current, checksum
ser.flushInput()
ser.close()

===
i've rewritten the code and deleted some unnecessary entries, now the
problem is :
21 6 64 64 192 0 0 0 175 70
70 2 6 64 64 192 0 0 0 114
70 11 6 64 64 192 0 0 0 105
0 0 104 70 2 6 64 64 192 0
70 2 6 64 64 192 0 0 0 114
128 128 103 70 2 6 64 64 192 0
70 2 6 64 64 192 0 0 0 114
16 208 246 70 2 6 64 64 192 0
70 2 6 64 64 192 0 0 0 114

===
the received data does not always start with the command "70", 
is this ok??? since i can always search first for the command "70"
before i read the remaining 9 bytes, then calculate first for the
checksum before finally accepting the received data.

am i making sense here?! please help me...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is there a problem on this simple code

2005-03-12 Thread jrlen balane
this is not working, what is wrong with this code??  what it "should"
do is find first the command "70" then read the remaining 9 bytes once
the command was found:

rx_data1=0
while (rx_data1 != 0x46):
rx_data1 = ser.read(1)
(rx_command) = unpack('1B', rx_data1)

rc_data2=ser.read(9)
(rx_msg_no, rx_no_databyte, temp1, temp2, pyra1, pyra2, voltage,
current, rx_checksum) = unpack('9B', data)
print rx_command, rx_msg_no, rx_no_databyte, temp1, temp2, pyra1,
pyra2, voltage, current, rx_checksum
===

this replaces this chunk from the original code:
data = ser.read(10)
   (command, msg_no, no_databyte, temp1, temp2, pyra1, pyra2,
voltage, current, checksum) = unpack('10B', data)  #serial receive
protocol
   print command, msg_no, no_databyte, temp1, temp2, pyra1, pyra2,
voltage, current, checksum

===

thanks again
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is there a problem on this simple code

2005-03-13 Thread jrlen balane
the assembly program for the microcontroller is created by a
classmate. he based the protocol for the serial program from a
protocol he found in the internet. unfortunately, i can't find the
fpdf file, guess i'll just ask him later when he comes back.

On 13 Mar 2005 03:28:43 -0800, John Machin <[EMAIL PROTECTED]> wrote:
> 
> jrlen balane wrote:
> > the hardware is a school project that uses a microcontroller for
> "light dimming"
> > the message command "67" will tell the microcontroller (PIC16F877) to
> > do a command (to control the intensity of a lamp)
> > the message command "70" should tell the GUI that the microcontroller
> > has started transmitting.
> > the message sent by the GUI is different from the message sent by the
> > microcontroller
> > (but i guess sir John is right, i think i should use different
> > variable for the data transmitted and data received)
> > i am currently developing this part of the project which implements
> > the serial communication
> > i've fixed the command and total_data since i know beforehand that
> > this will be its value.
> > to simplify the program, i have also fixed the message_no since the
> > microcontroller will still accept the transmitted data as long as the
> > checksum == 0.
> 
> (1) But it's NOT zero after the first time around! (2) How do you know
> what it will accept? Guessing or reading the manual? If the checksum is
> not zero, then what happens? Please quote the exact section from the
> manual.
> 
> >
> > anymore suggestion???...
> 
> YES: show the whole program; you have left out the initialisation part.
> 
> > ==
> > command = 67
> > message_no = 1
> > total_data = 2
> > item=1
> > for item in range(1, 30001, 250):
> > ser.open()
> > data_hi, data_lo = divmod(item, 0x100)
> > checksum = -(data_hi + data_lo + 0x46) & 0xff
> > ser.write(pack('6B', command, message_no, total_data, data_lo,
> > data_hi, checksum))
> > data = ser.read(10)
> > (command, msg_no, no_databyte, temp1, temp2, pyra1, pyra2,
> > voltage, current, checksum) = unpack('10B', data)  #serial receive
> > protocol
> > print command, msg_no, no_databyte, temp1, temp2, pyra1, pyra2,
> > voltage, current, checksum
> > ser.flushInput()
> > ser.close()
> >
> > ===
> > i've rewritten the code and deleted some unnecessary entries, now the
> > problem is :
> > 21 6 64 64 192 0 0 0 175 70
> > 70 2 6 64 64 192 0 0 0 114
> > 70 11 6 64 64 192 0 0 0 105
> > 0 0 104 70 2 6 64 64 192 0
> > 70 2 6 64 64 192 0 0 0 114
> > 128 128 103 70 2 6 64 64 192 0
> > 70 2 6 64 64 192 0 0 0 114
> > 16 208 246 70 2 6 64 64 192 0
> > 70 2 6 64 64 192 0 0 0 114
> >
> > ===
> > the received data does not always start with the command "70",
> > is this ok??? since i can always search first for the command "70"
> > before i read the remaining 9 bytes, then calculate first for the
> > checksum before finally accepting the received data.
> >
> > am i making sense here?! please help me...
> 
> As Dennis has told you, searching is pointless. You are losing data
> now. Before you weren't losing data. Until you fix that problem,
> fiddling with anything else is pointless. You have stopped doing
> sleep() -- why? You are now doing ser.open() and ser.flushInput() and
> ser.close() on *each* time around the loop -- why? I'd strongly suggest
> you put these back the way they were. THEN do what I told you to do:
> use a separate tx_command and rx_command. The first time through the
> loop, command is set to 70 from the received data, and then the second
> time around, you SEND 70, not 67!!! Fix that, and then show us what you
> get. DON'T try searching for a 70. Don't thrash around trying multiple
> changes at once -- make changes one at a time so you can see the
> effects.
> 
> Do you have a part number for the manual which describes the 67 and 70
> "commands" and the check-sum? Is the manual on the internet anywhere?
> 
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


how to delete the close button (the X on the right most corner of the window) on a window

2005-03-13 Thread jrlen balane
i am working on an MDIParentFrame and MDIChildFrame. Now, what i want
to do is make the ChildFrame not that easy to close by removing the
close button (the X on the right most corner of the window) if this is
possible...

how am i going to do this?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to delete the close button (the X on the right most corner of the window) on a window

2005-03-14 Thread jrlen balane
I am using BOA Constructor in building a GUI


On 13 Mar 2005 21:19:07 -0800, Harlin Seritt <[EMAIL PROTECTED]> wrote:
> What GUI toolkit are you using? I think this is the point Jeremy is
> making.
> 
> Harlin Seritt
> 
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is there a problem on this simple code

2005-03-14 Thread jrlen balane
why is it that here:

1)rx_data = ser.read(10)
(rx_command, rx_msg_no, rx_no_databyte, temp1, temp2, pyra1,
pyra2, voltage, current, rx_checksum) = unpack('10B', rx_data)
print rx_command, rx_msg_no, rx_no_databyte, temp1, temp2, pyra1,
pyra2, voltage, current, rx_checksum
 
>>> type (rx_command)


but here:

2)rx_data_command = ser.read()
(rx_command) = unpack('1B', rx_data_command)

>>> type (rx_command)


how can i make rx_command of type 'int' if i am to use 2)?

@sir John
the reason why my first post all starts with '70' , which is what i
really wanted to happen, is that it is buffered. the microcontroller
sends data at a very fast rate, that the program just retrieve data
from the buffer. so basically, they are not "real time". but there are
also cases where the command is in other position. the good thing is,
it remains in that position throughout...

i want to make the program show data in "real time" so everytime i am
able to read data, i immediately use flushInput(), to erase data from
the buffer.

so i what i want to do now is to search for the rx_command first
('70') just so i know where my data should start.

the checksum will be validated, but first, i must know where my checksum is!
if (rx_checksum != -(temp1 + temp2 + pyra1 + pyra2 + voltage + current
+  rx_command +   rx_message_no + rx_no_databyte) & 0xff):
#then discard message, loop again to search for rx_command

plase help...

On 13 Mar 2005 13:06:16 -0800, John Machin <[EMAIL PROTECTED]> wrote:
> 
> Jan Rienyer Gadil wrote:
> > @ sir Peter
> > so you mean that it is correct (at least on the unpack() part)
> 
> No he doesn't mean that at all. All it means is that minor scuffles
> have broken out among the spectators. Don't worry about them, batons &
> water cannon will fix them; you concentrate on the football match :-)
> 
> >
> > when i run this program on IDLE , Python 2.3 (enthought edition),
> > nothing is outputted on the shell, until i decide to close the shell,
> > wherein it tells me if i would like to kill a process...
> 
> So you did some elementary debugging, like putting in some print
> statements at various places, as shown below, and what happened?
> 
> >
> > import serial
> > import string
> 
> Redundant.
> 
> > import time
> > from struct import *
> >
> > ser = serial.Serial()
> >
> > ser.baudrate = 9600
> > ser.port = 0
> > ser
> 
> What is the above line meant to do? It actually does nothing.
> 
> > ser.close()
> > ser.open()
> >
> > command = 67
> > message_no = 1
> > total_data = 2
> >
> > item = 1
> 
> Redundant.
> >
> 
> print "DEBUG: before outer loop"
> 
> 
> > for item in range(1, 30001, 250):
> 
> print "DEBUG: inside outer loop; item =", repr(item)
> 
> >data_hi, data_lo = divmod(item, 0x100)
> >checksum = -(data_hi + data_lo + 0x46) & 0xff
> 
> You obviouly haven't taken the advice to generalise your checksum
> calculation.
> 
> >ser.write(pack('6B', command, message_no, total_data, data_lo,
> > data_hi, checksum))
> >
> >rx_data1=0
> 
> print "DEBUG: before inner loop"
> 
> >while (rx_data1 != 0x46):
> >rx_data1 = ser.read(1)
> >(rx_command) = unpack('1B', rx_data1)
> 
> print "DEBUG: inside inner loop; rx_data1 =", repr(rx_data1), ";
> rx_command =", repr(rx_command)
> 
> And if you had have done that, you would/should have realised that you
> have a:
> !! CODING BUG !!
> ser.read(1) will return a STRING, so even if you get the byte you are
> looking for, rx_data1 will refer to 'F' == chr(70) == chr(0x46) ==
> '\x46' none of which are == 0x46, and you will loop forever (if the
> hardware is continuously outputting data) or hang waiting for data from
> the hardware.
> 
> !! DESIGN BUG !!
> HOWEVER, as Dennis and I have been trying to tell you, it is WRONG to
> be looping trying to sync on the first character in the packet. You
> need to fix your data loss problem, not try to kludge your way around
> it. I'll say it again, but only once: go back to the code of your
> original posting. That code was not losing data. Among whatever else is
> needed to revert to the first-shown code, put back the sleep() between
> iterations.
> As advised earlier, make sure that you use separate rx_command and
> tx_command so that you don't accidentally start sending 70 as the
> command.
> Then show us what happened.
> 
> > rx_data2=ser.read(9)
> > (rx_msg_no, rx_no_databyte, temp1, temp2, pyra1, pyra2, voltage,
> >  current, rx_checksum) = unpack('9B', data)
> 
> !! CODING BUG !!
> You read into "rx_data2" but unpack from "data". The result, when you
> reach it after fixing the earlier bug, will be either an exception or
> an utter nonsense, depending on what "data" is bound to at the time (if
> anything).
> 
> >  print rx_command, rx_msg_no, rx_no_databyte, temp1, temp2,
> pyra1,
> >  pyra2, voltage, current, rx_checksum
> >
> 
> You obviously haven't taken the advice from Dennis and myself to
>

Re: is there a problem on this simple code

2005-03-14 Thread jrlen balane
@sir John
could you please show me how to do this exactly? it's in the "tip of
my toungue" but i just can get it, please...


On 14 Mar 2005 14:06:15 -0800, John Machin <[EMAIL PROTECTED]> wrote:
> 
> jrlen balane wrote:
> > why is it that here:
> >
> > 1)rx_data = ser.read(10)
> > (rx_command, rx_msg_no, rx_no_databyte, temp1, temp2, pyra1,
> > pyra2, voltage, current, rx_checksum) = unpack('10B', rx_data)
> > print rx_command, rx_msg_no, rx_no_databyte, temp1, temp2, pyra1,
> > pyra2, voltage, current, rx_checksum
> >
> > >>> type (rx_command)
> > 
> >
> > but here:
> >
> > 2)rx_data_command = ser.read()
> 
> Are you sure you have really have read() -- which will read all
> available data -- or read(1) -- which will read just one byte???
> 
> > (rx_command) = unpack('1B', rx_data_command)
> >
> > >>> type (rx_command)
> > 
> >
> > how can i make rx_command of type 'int' if i am to use 2)?
> 
> unpack returns a tuple. In 1) you unpack it. In 2) you don't unpack it.
> 
> either do this:
> 
> (rx_command,) = unpack('1B', rx_data_command) # unpack tuple
> 
> or this:
> 
> rx_command = unpack('1B', rx_data_command)[0] # grab 1st element of
> tuple
> 
> or, simply, to get what you want, just do this:
> 
> rx_command = ord(ser.read(1))
> 
> >
> > @sir John
> > the reason why my first post all starts with '70' , which is what i
> > really wanted to happen, is that it is buffered. the microcontroller
> > sends data at a very fast rate, that the program just retrieve data
> > from the buffer. so basically, they are not "real time". but there
> are
> > also cases where the command is in other position. the good thing is,
> > it remains in that position throughout...
> 
> It wasn't doing that before; In the second posting with examples, there
> were some that were a MIXTURE of (a) 70 as the first byte of 10 (b) 70
> as the fourth byte of 10 (128 128 103 70 2 6 64 64 192 0)
> 
> >
> > i want to make the program show data in "real time" so everytime i am
> > able to read data, i immediately use flushInput(), to erase data from
> > the buffer.
> 
> How large is the buffer?
> 
> >
> > so i what i want to do now is to search for the rx_command first
> > ('70') just so i know where my data should start.
> 
> OK, so NOW you are saying that the microcontroller is pumping out data
> continuously, it's not one response to each of your "67" commands???
> 
> In that case what I'd suggest you do is to read 19 bytes from the
> serial port (with time-out, I'd suggest; give up if you don't get 19
> bytes returned), and for each k in range(9), test for:
> 
> (a) byte[k] == 70
> (b) byte[k+2] == 6
> (c) checksum(byte[k:k+10]) == 0
> 
> If you don't get a valid data packet, give up.
> 
> This should snatch one valid data packet (if there are any) from the
> torrent.
> 
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is there a problem on this simple code

2005-03-15 Thread jrlen balane
rx_data = ser.read(19)
byte[] = unpack('19B', rx_data)

for k in range(9):
if byte[k] == 70
if byte[k+2] == 6
if byte[k+9] ==
-(byte[k]+byte[k+1]+byte[k+2]+byte[k+3]+byte[k+4]+byte[k+5]+byte[k+6]+byte[k+7]+byte[k+8])
& 0xff
print byte[k:k+9]

what i am doing here is creating an array from based on the unpacked data
then i am searching for the array member that is equal to "70" since
it is going to be my reference. once i find it, i'll based my received
data from that point. then if the succeding tests are confirmed, i can
get my data.

please help(again) :(


On Tue, 15 Mar 2005 08:05:04 GMT, Dennis Lee Bieber
<[EMAIL PROTECTED]> wrote:
> On 14 Mar 2005 17:04:13 -0800, "John Machin" <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
> 
> >
> > jrlen balane wrote:
> > > @sir John
> > > could you please show me how to do this exactly? it's in the "tip of
> > > my toungue" but i just can get it, please...
> > >
> >
> > You've had far too much help already for a school project. Asking for
> > someone to write the code for you is "over the fence".
> 
> The repetition /is/ getting tedious, isn't it...
> 
> At the least, getting a formal definition of the protocol the
> microcontroller uses would be nice. If it is continuously sending "70"
> status reports, WITHOUT handshaking (RTS/CTS), then I'd strongly
> recommend making the reader code a separate thread -- hopefully one
> won't lose bytes during other processing. When a valid status report is
> found, put it onto a Queue, which the main code can read when ever it
> finds time.
> 
> Heck, at this point in time... I'd remove everything involved
> with /sending/ commands. Start with coding something that only reads the
> status from the microcontroller (since it sounds like the controller is
> always sending). When the reader works correctly, then start trying to
> add the command writer.
> 
> --
>  > == <
>  >   [EMAIL PROTECTED]  | Wulfraed  Dennis Lee Bieber  KD6MOG <
>  >  [EMAIL PROTECTED] |   Bestiaria Support Staff   <
>  > == <
>  >   Home Page: <http://www.dm.net/~wulfraed/><
>  >Overflow Page: <http://wlfraed.home.netcom.com/><
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is there a problem on this simple code

2005-03-15 Thread jrlen balane
did some editing:

rx_data = ser.read(19)
byte[0:18] = unpack('19B', rx_data)

   for k in range(9):
   if byte[k] == 70:
   if byte[k+2] == 6:
   if byte[k+9] ==
-(byte[k]+byte[k+1]+byte[k+2]+byte[k+3]+byte[k+4]+byte[k+5]+byte[k+6]+byte[k+7]+byte[k+8])
& 0xff:
   print byte[k:k+9]

heres the error:
Traceback (most recent call last):
  File "C:\Python23\practices\serialnewesttest2.py", line 28, in -toplevel-
byte[0:18] = unpack('19B', rx_data)
error: unpack str size does not match format

what i am doing here is creating an array from based on the unpacked data
then i am searching for the array member that is equal to "70" since
it is going to be my reference. once i find it, i'll based my received
data from that point. then if the succeding tests are confirmed, i can
get my data.

please help(again) :(
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is there a problem on this simple code

2005-03-15 Thread jrlen balane
will this be correct???
what i want to happen is saved every received data (6 data bytes) to
an array for each one.

for k in range (rx_len-9):
 if byte[k] == 70 and byte [k+2] == 6 and sum(byte[k:k+10]) & 0xff == 0:
  #print byte[k:k+10]

   temp1.append(byte[k+3])
   temp2.append(byte[k+4])
   pyra1.append(byte[k+5])
   pyra2.append(byte[k+6])
   voltage.append(byte[k+7])
   current.append(byte[k+8])

   if time.sleep(300) == True:
 temp1 = []
 temp2 = []
 pyra1 = []
 pyra2 = []
 voltage = []
 current = []

and after x minutes of of receiving data, the arrays will be emptied
of its contents.

thanks again for the help. 
On 15 Mar 2005 02:13:40 -0800, John Machin <[EMAIL PROTECTED]> wrote:
> 
> jrlen balane wrote:
> > did some editing:
> >
> 
> The error means that you received less than 19 bytes of data.
> 
> > rx_data = ser.read(19)
> !rx_len = len(rx_data)
> !print 'rx_len', rx_len
> > byte[0:18] = unpack('19B', rx_data)
> !# trash the above, do this
> !byte = [ord(x) for x in rx_data]
> !print 'received', byte
> !if rx_len < 10:
> !   print 'it is not pumping data out as fast as we assumed!'
> !   sys.exit(1)
> >
> !for k in range(rx_len - 9):
> >if byte[k] == 70:
> >if byte[k+2] == 6:
> >if byte[k+9] ==
> >
> -(byte[k]+byte[k+1]+byte[k+2]+byte[k+3]+byte[k+4]+byte[k+5]+byte[k+6]+byte[k+7]+byte[k+8])
> > & 0xff:
> 
> Yuk!
> 
> (1) use 'and'
> (2) when you find yourself typing repetitive crap like that, your brain
> should be shrieking "There must be a better way!!"
> 
> if byte[k] == 70 \
> and byte[k+2] == 6 \
> and sum(byte[k:k+10]) & 0xff == 0:
> 
> >print byte[k:k+9] <<<<<<=== you probably mean 10,
> not nine
> > 
> > heres the error:
> > Traceback (most recent call last):
> >   File "C:\Python23\practices\serialnewesttest2.py", line 28, in
> -toplevel-
> > byte[0:18] = unpack('19B', rx_data)
> > error: unpack str size does not match format
> >
> > what i am doing here is creating an array from based on the unpacked
> data
> > then i am searching for the array member that is equal to "70" since
> > it is going to be my reference. once i find it, i'll based my
> received
> > data from that point. then if the succeding tests are confirmed, i
> can
> > get my data.
> >
> > please help(again) :(
> 
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is there a problem on this simple code

2005-03-15 Thread jrlen balane
ok heres the code, i'm trying on IDLE:

import sys
import serial
import sys, os
import serial
import string
import time
from struct import *

data_file = open('C:/Documents and Settings/nyer/Desktop/IRRADIANCE.txt', 'r')
data = data_file.readlines()

def process(list_of_lines):
data_points = []
for line in list_of_lines:
data_points.append(int(line))
return data_points

irradiance = process(data)

ser = serial.Serial()
ser.baudrate = 9600
ser.port = 0
ser

ser.open()
tx_command = 67
tx_no_databyte = 2
tx_message_no = 1
tx_len = len (irradiance)

for j in range (tx_len)  :
start_time = time.time()

temp1 = []
temp2 = []
pyra1 = []
pyra2 = []
voltage = []
current = []

current_time = time.time()

while( current_time >= start_time + 300):

data_hi, data_lo = divmod(irradiance[j], 0x100)
tx_checksum = -(data_hi + data_lo + tx_command + tx_message_no
+ tx_no_databyte) & 0xff
ser.write(pack('6B', tx_command, tx_message_no,
tx_no_databyte, data_lo, data_hi, tx_checksum))

rx_data = ser.read(19)
rx_len = len(rx_data)
byte = [ord(x) for x in rx_data]

if rx_len < 10:
#print 'it is not pumping data out as fast as we assumed'
sys.exit(1)

for k in range (rx_len-9):
if byte[k] == 70 and byte [k+2] == 6 and sum(byte[k:k+10])
& 0xff == 0:
#print byte[k:k+10]

temp1.append(byte[k+3])
temp2.append(byte[k+4])
pyra1.append(byte[k+5])
pyra2.append(byte[k+6])
voltage.append(byte[k+7])
current.append(byte[k+8])
print temp1, temp2, pyra1, pyra2, voltage, current

current_time = time.time()  

while theres no error in the output, there is also no response from
the hardware or maybe communication is off.

could somebody out there help me.

by the way, here is a working code: though here the data to be
transmitted is just incrementing and not read from a text file:

import serial
import string
import time
from struct import *
import os

ser = serial.Serial()

ser.baudrate = 9600
ser.port = 0
ser.timeout = 1
ser


ser.open()
tx_command = 67
tx_message_no = 1
tx_no_databyte = 2
item=1
for item in range(1, 30001, 10):

data_hi, data_lo = divmod(item, 0x100)
tx_checksum = -(data_hi + data_lo + tx_command + tx_message_no +
tx_no_databyte) & 0xff
ser.write(pack('6B', tx_command, tx_message_no, tx_no_databyte,
data_lo, data_hi, tx_checksum))
#print tx_command, tx_message_no, tx_total_data, data_lo, data_hi,
tx_checksum


rx_data = ser.read(19)
rx_len = len(rx_data)
#print 'rx_len', rx_len
byte = [ord(x) for x in rx_data]
#print 'received', byte


if rx_len < 10:
print 'it is not pumping data out as fast as we assumed'
sys.exit(1)

for k in range (rx_len-9):
if byte[k] == 70 and byte [k+2] == 6 and sum(byte[k:k+10]) & 0xff == 0:
print byte[k:k+10]
===
outputs:
[70, 2, 6, 54, 197, 253, 230, 231, 211, 26]
[70, 3, 6, 54, 197, 253, 230, 231, 211, 25]
[70, 3, 6, 54, 197, 253, 230, 231, 210, 26]
[70, 3, 6, 54, 197, 253, 230, 231, 210, 26]
[70, 3, 6, 54, 197, 253, 230, 231, 211, 25]
[70, 3, 6, 54, 197, 253, 230, 231, 210, 26]
[70, 3, 6, 54, 197, 253, 230, 231, 211, 25]
[70, 3, 6, 54, 197, 253, 230, 231, 210, 26]
[70, 3, 6, 54, 197, 253, 230, 231, 211, 25]
...
...

On Wed, 16 Mar 2005 07:34:44 +0800, jrlen balane <[EMAIL PROTECTED]> wrote:
> will this be correct???
> what i want to happen is saved every received data (6 data bytes) to
> an array for each one.
> 
> for k in range (rx_len-9):
>  if byte[k] == 70 and byte [k+2] == 6 and sum(byte[k:k+10]) & 0xff == 0:
>   #print byte[k:k+10]
> 
>temp1.append(byte[k+3])
>temp2.append(byte[k+4])
>pyra1.append(byte[k+5])
>pyra2.append(byte[k+6])
>voltage.append(byte[k+7])
>current.append(byte[k+8])
> 
>if time.sleep(300) == True:
>  temp1 = []
>  temp2 = []
>  pyra1 = []
>  pyra2 = []
>  voltage = []
>  current = []
> 
> and after x minutes of of receiving data, the arrays will be emptied
> of its contents.
> 
> thanks again for the help.
> On 15 Mar 2005 02:13:40 -0800, John Machin <[EMAIL PROTECTED]> wrote:
> >
> > jrlen balane wrote:
> > > did some editing:
> > >
> >
> > The error means that you recei

Re: is there a problem on this simple code

2005-03-15 Thread jrlen balane
please post your suggestions? please ...


On Wed, 16 Mar 2005 08:33:23 +0800, jrlen balane <[EMAIL PROTECTED]> wrote:
> ok heres the code, i'm trying on IDLE:
> 
> import sys
> import serial
> import sys, os
> import serial
> import string
> import time
> from struct import *
> 
> data_file = open('C:/Documents and Settings/nyer/Desktop/IRRADIANCE.txt', 'r')
> data = data_file.readlines()
> 
> def process(list_of_lines):
> data_points = []
> for line in list_of_lines:
> data_points.append(int(line))
> return data_points
> 
> irradiance = process(data)
> 
> ser = serial.Serial()
> ser.baudrate = 9600
> ser.port = 0
> ser
> 
> ser.open()
> tx_command = 67
> tx_no_databyte = 2
> tx_message_no = 1
> tx_len = len (irradiance)
> 
> for j in range (tx_len)  :
> start_time = time.time()
> 
> temp1 = []
> temp2 = []
> pyra1 = []
> pyra2 = []
> voltage = []
> current = []
> 
> current_time = time.time()
> 
> while( current_time >= start_time + 300):
> 
> data_hi, data_lo = divmod(irradiance[j], 0x100)
> tx_checksum = -(data_hi + data_lo + tx_command + tx_message_no
> + tx_no_databyte) & 0xff
> ser.write(pack('6B', tx_command, tx_message_no,
> tx_no_databyte, data_lo, data_hi, tx_checksum))
> 
> rx_data = ser.read(19)
> rx_len = len(rx_data)
> byte = [ord(x) for x in rx_data]
> 
> if rx_len < 10:
> #print 'it is not pumping data out as fast as we assumed'
> sys.exit(1)
> 
> for k in range (rx_len-9):
> if byte[k] == 70 and byte [k+2] == 6 and sum(byte[k:k+10])
> & 0xff == 0:
> #print byte[k:k+10]
> 
> temp1.append(byte[k+3])
> temp2.append(byte[k+4])
> pyra1.append(byte[k+5])
> pyra2.append(byte[k+6])
> voltage.append(byte[k+7])
> current.append(byte[k+8])
> print temp1, temp2, pyra1, pyra2, voltage, current
> 
> current_time = time.time()
> 
> while theres no error in the output, there is also no response from
> the hardware or maybe communication is off.
> 
> could somebody out there help me.
> 
> by the way, here is a working code: though here the data to be
> transmitted is just incrementing and not read from a text file:
> 
> import serial
> import string
> import time
> from struct import *
> import os
> 
> ser = serial.Serial()
> 
> ser.baudrate = 9600
> ser.port = 0
> ser.timeout = 1
> ser
> 
> ser.open()
> tx_command = 67
> tx_message_no = 1
> tx_no_databyte = 2
> item=1
> for item in range(1, 30001, 10):
> 
> data_hi, data_lo = divmod(item, 0x100)
> tx_checksum = -(data_hi + data_lo + tx_command + tx_message_no +
> tx_no_databyte) & 0xff
> ser.write(pack('6B', tx_command, tx_message_no, tx_no_databyte,
> data_lo, data_hi, tx_checksum))
> #print tx_command, tx_message_no, tx_total_data, data_lo, data_hi,
> tx_checksum
> 
> 
> rx_data = ser.read(19)
> rx_len = len(rx_data)
> #print 'rx_len', rx_len
> byte = [ord(x) for x in rx_data]
> #print 'received', byte
> 
> if rx_len < 10:
> print 'it is not pumping data out as fast as we assumed'
> sys.exit(1)
> 
> for k in range (rx_len-9):
> if byte[k] == 70 and byte [k+2] == 6 and sum(byte[k:k+10]) & 0xff == 
> 0:
> print byte[k:k+10]
> =======
> outputs:
> [70, 2, 6, 54, 197, 253, 230, 231, 211, 26]
> [70, 3, 6, 54, 197, 253, 230, 231, 211, 25]
> [70, 3, 6, 54, 197, 253, 230, 231, 210, 26]
> [70, 3, 6, 54, 197, 253, 230, 231, 210, 26]
> [70, 3, 6, 54, 197, 253, 230, 231, 211, 25]
> [70, 3, 6, 54, 197, 253, 230, 231, 210, 26]
> [70, 3, 6, 54, 197, 253, 230, 231, 211, 25]
> [70, 3, 6, 54, 197, 253, 230, 231, 210, 26]
> [70, 3, 6, 54, 197, 253, 230, 231, 211, 25]
> ...
> ...
> 
> On Wed, 16 Mar 2005 07:34:44 +0800, jrlen balane <[EMAIL PROTECTED]> wrote:
> > will this be correct???
> > what i want to happen is saved every received data (6 data bytes) to
> > an array for each one.
> >
> > for k in range (rx_len-9):
> >  if byte[k] == 70 and byte [k+2] == 6 and sum(byte[k:k+10]) & 0xff == 0:
> >   #print byte[k:k+10]
> >
> >temp1.append(byte[k+3])
> >temp2.append(byte[k+4])
> >pyra1.append(byte[

how to read a tab delimited file

2005-03-15 Thread jrlen balane
how would i read a tab delimited file? at the same time put what i
read in an array, say for example that i know that the file is an
array with column= 5 and row=unknown.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to read a tab delimited file

2005-03-15 Thread jrlen balane
if i am going to do this, how should i continue:
how would i know the end of file?


table_data = open(filename, 'r')
table_data.readlines()


On Tue, 15 Mar 2005 23:37:50 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote:
> jrlen balane wrote:
> > how would i read a tab delimited file? at the same time put what i
> > read in an array, say for example that i know that the file is an
> > array with column= 5 and row=unknown.
> 
> Use the "csv" module.  Although that stands for "comma
> separated values", it readily supports alternative
> delimiters such as TAB.
> 
> -Peter
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list


reading from a txt file

2005-03-29 Thread jrlen balane
how should i modify this data reader:
(assumes that there is only one entry per line followed by '\n')

data_file = open(os.path.normpath(self.TextFile.GetValue()), 'r')
data = data_file.readlines()

self.irradianceStrings = map(str, data)
self.irradianceIntegers = map(int, data)
self.IrradianceExecute.SetValue(''.join(self.irradianceStrings))



so that i can read the text file created by this:

self.filename = "%s\%s.txt"
%(os.path.normpath(self.SaveFolder.GetValue()),time.strftime("%Y%m%d%H%M"))

self.table_file = open(self.filename,"a")
self.table_file.write('%f\t'%self.temp11)
self.table_file.write('%f\t'%self.temp22)
self.table_file.write('%f\t'%self.pyra11)
self.table_file.write('%f\t'%self.pyra22)
self.table_file.write('%f\t'%self.voltage11)
self.table_file.write('%f\t'%self.current11)
self.table_file.write('\n') 
self.table_file.close()
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is there a problem on this simple code

2005-03-30 Thread jrlen balane
a simple question regarding threading and timer:

if i put my timer control inside the thread, will the thread be exited
every time there is a timer event???

please help...

def someThreadHere()
 ...
 someTimer.start(3000)
 

def someTimerEvent()
 .


 
On Wed, 16 Mar 2005 07:38:09 GMT, Dennis Lee Bieber
<[EMAIL PROTECTED]> wrote:
> On Wed, 16 Mar 2005 09:47:01 +0800, jrlen balane <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
> 
> > please post your suggestions? please ...
> >
>Since we don't have your hardware, nor have you been able supply
> the formal documentation of the protocol in use, all we can do is
> comment on coding styles and obvious errors in the code... If there is
> an flaw in the implementation of the protocol, we have no way to tell.
> 
> >
> 
> > > import sys
> > > import serial
> > > import sys, os
> > > import serial
> 
>How about cleaning that up... You've imported serial twice, and
> sys twice.
> 
> > > data_file = open('C:/Documents and Settings/nyer/Desktop/IRRADIANCE.txt', 
> > > 'r')
> > > data = data_file.readlines()
> > >
> > > def process(list_of_lines):
> > > data_points = []
> > > for line in list_of_lines:
> > > data_points.append(int(line))
> > > return data_points
> > >
> > > irradiance = process(data)
> 
>Well, this is legal, though confusing to stuff a function
> definition between lines of the main program. Common is to put the
> "def"s after the "imports" (though defining "constants" may be okay in
> there)
> 
>If "process" is only used once, it might not even be worth the
> "def"...
> 
> > >
> > > ser = serial.Serial()
> > > ser.baudrate = 9600
> > > ser.port = 0
> > > ser
>Delete that -- you've been told that it is meaningless for days
> now... If you don't want to take advice, why ask?
> 
> > >
> > > ser.open()
> > > tx_command = 67
> > > tx_no_databyte = 2
> > > tx_message_no = 1
> > > tx_len = len (irradiance)
> > >
> > > for j in range (tx_len)  :
> > > start_time = time.time()
> > >
> > > temp1 = []
> > > temp2 = []
> > > pyra1 = []
> > > pyra2 = []
> > > voltage = []
> > > current = []
> > >
> > > current_time = time.time()
> > >
> > > while( current_time >= start_time + 300):
> > >
>If current time is < start+300, the entire loop will be skipped
> -- a condition that is quite likely to happen unless you have a /very/
> slow machine.
> 
> > > data_hi, data_lo = divmod(irradiance[j], 0x100)
> > > tx_checksum = -(data_hi + data_lo + tx_command + tx_message_no
> > > + tx_no_databyte) & 0xff
> > > ser.write(pack('6B', tx_command, tx_message_no,
> > > tx_no_databyte, data_lo, data_hi, tx_checksum))
> > >
> > > rx_data = ser.read(19)
> > > rx_len = len(rx_data)
> > > byte = [ord(x) for x in rx_data]
> > >
> > > if rx_len < 10:
> > > #print 'it is not pumping data out as fast as we assumed'
> > > sys.exit(1)
> > >
> > > for k in range (rx_len-9):
> > > if byte[k] == 70 and byte [k+2] == 6 and sum(byte[k:k+10])
> > > & 0xff == 0:
> > > #print byte[k:k+10]
> > >
> > > temp1.append(byte[k+3])
> > > temp2.append(byte[k+4])
> > > pyra1.append(byte[k+5])
> > > pyra2.append(byte[k+6])
> > > voltage.append(byte[k+7])
> > > current.append(byte[k+8])
> > > print temp1, temp2, pyra1, pyra2, voltage, current
> > >
>All these are lists, do you really mean to print the entire list
> each time, or only the most recent data value?
> 
> > > current_time = time.time()
> > >
> > > while theres no error in the output, there is also no response from
> > > the hardware or maybe communication is off.
> > >
> > > could somebody out there help me.
> > >
> 
> > > by the way, here is a working code: though here the data to be
> > > transmitted is just incrementing and no

Re: is there a problem on this simple code

2005-03-31 Thread jrlen balane
hi! could anyone give their input on my previous post about timer and
threading...]
pleaseee...

my program seemed to just run first the thread then when it encounters
error on the thread that's the time that other part of the program got
the chance to be executed
even the timer even is not executed while the thread is running


On Thu, 31 Mar 2005 05:39:11 +0800, jrlen balane <[EMAIL PROTECTED]> wrote:
> a simple question regarding threading and timer:
> 
> if i put my timer control inside the thread, will the thread be exited
> every time there is a timer event???
> 
> please help...
> 
> def someThreadHere()
> ...
> someTimer.start(3000)
> 
> 
> def someTimerEvent()
> .
> 
> On Wed, 16 Mar 2005 07:38:09 GMT, Dennis Lee Bieber
> <[EMAIL PROTECTED]> wrote:
> > On Wed, 16 Mar 2005 09:47:01 +0800, jrlen balane <[EMAIL PROTECTED]>
> > declaimed the following in comp.lang.python:
> >
> > > please post your suggestions? please ...
> > >
> >Since we don't have your hardware, nor have you been able supply
> > the formal documentation of the protocol in use, all we can do is
> > comment on coding styles and obvious errors in the code... If there is
> > an flaw in the implementation of the protocol, we have no way to tell.
> >
> > >
> >
> > > > import sys
> > > > import serial
> > > > import sys, os
> > > > import serial
> >
> >How about cleaning that up... You've imported serial twice, and
> > sys twice.
> >
> > > > data_file = open('C:/Documents and 
> > > > Settings/nyer/Desktop/IRRADIANCE.txt', 'r')
> > > > data = data_file.readlines()
> > > >
> > > > def process(list_of_lines):
> > > > data_points = []
> > > > for line in list_of_lines:
> > > > data_points.append(int(line))
> > > > return data_points
> > > >
> > > > irradiance = process(data)
> >
> >Well, this is legal, though confusing to stuff a function
> > definition between lines of the main program. Common is to put the
> > "def"s after the "imports" (though defining "constants" may be okay in
> > there)
> >
> >If "process" is only used once, it might not even be worth the
> > "def"...
> >
> > > >
> > > > ser = serial.Serial()
> > > > ser.baudrate = 9600
> > > > ser.port = 0
> > > > ser
> >Delete that -- you've been told that it is meaningless for days
> > now... If you don't want to take advice, why ask?
> >
> > > >
> > > > ser.open()
> > > > tx_command = 67
> > > > tx_no_databyte = 2
> > > > tx_message_no = 1
> > > > tx_len = len (irradiance)
> > > >
> > > > for j in range (tx_len)  :
> > > > start_time = time.time()
> > > >
> > > > temp1 = []
> > > > temp2 = []
> > > > pyra1 = []
> > > > pyra2 = []
> > > > voltage = []
> > > > current = []
> > > >
> > > > current_time = time.time()
> > > >
> > > > while( current_time >= start_time + 300):
> > > >
> >If current time is < start+300, the entire loop will be skipped
> > -- a condition that is quite likely to happen unless you have a /very/
> > slow machine.
> >
> > > > data_hi, data_lo = divmod(irradiance[j], 0x100)
> > > > tx_checksum = -(data_hi + data_lo + tx_command + tx_message_no
> > > > + tx_no_databyte) & 0xff
> > > > ser.write(pack('6B', tx_command, tx_message_no,
> > > > tx_no_databyte, data_lo, data_hi, tx_checksum))
> > > >
> > > > rx_data = ser.read(19)
> > > > rx_len = len(rx_data)
> > > > byte = [ord(x) for x in rx_data]
> > > >
> > > > if rx_len < 10:
> > > > #print 'it is not pumping data out as fast as we assumed'
> > > > sys.exit(1)
> > > >
> > > > for k in range (rx_len-9):
> > > > if byte[k] == 70 and byte [k+2] == 6 and sum(byte[k:k+10])
> > > > & 0xff == 0:
> > > > #print byte[k:k+10]
> > > >
> > > > temp1.

Re: is there a problem on this simple code

2005-03-31 Thread jrlen balane
i would just like to apologize for my mistake, rest assured everything
was taken in helpful way.


On Thu, 31 Mar 2005 17:40:06 GMT, Dennis Lee Bieber
<[EMAIL PROTECTED]> wrote:
> On Thu, 31 Mar 2005 10:56:07 -0500, Peter Hansen <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
> 
> > jrlen balane wrote:
> > > hi! could anyone give their input on my previous post about timer and
> > > threading...]
> > > pleaseee...
> >
> 
> >
> > 1. It's most annoying that you are not taking even a bit
> > of time to "prune" the useless quoted material from your
> > messages (notice how I've done it in this one).  From
> > a netiquette point of view, that's considered rude and reduces
> > the level of respect you will be shown.
> 
> I didn't even notice the posts myself, as I've got size filters
> in place -- from when we were getting a lot of spam posting of binaries
> and HTML; these posts were too large for my filters to let in. (Okay,
> they /were/ also sent to my email address; I didn't reply there as the
> CC: to the Python list was also visible -- I'd rather have handled the
> stuff here)
> 
> > 1.6. Always start a new thread when you have a new request.
> > One reason you might not have got replies to this latest
> > request yet is that you posted it as a followup to the
> 
> Especially for a thread that is two weeks stale... 
> 
> 
> >
> > More importantly, your code can't be executed, so
> > we're just shooting in the dark if we try to figure
> > out how you are getting "someTimerEvent" to execute,
> > if indeed it is a function.  The "def" statements
> > don't have colons after them, so we're not even sure
> > you are asking about how to do something, or perhaps
> > you have code that is just not compiling because it
> > is syntactically incorrect.
> >
> To add to the pseudo-code (since there isn't enough there to
> even code a test case, assuming one corrects the : matter), assuming it
> is the "regular" timing module, the time /delay/ is NOT an argument of
> the start() method, but rather of the instance creation. As I recall,
> they are one-shots and not repeating timers. From a quick read, a timer
> is, itself, a thread -- at the simplest level then, I would conclude
> that a time is nothing more than a thread with the pseudo-code of:
> 
> sleep(delay)
> eventFunction()
> 
> --
>  > == <
>  >   [EMAIL PROTECTED]  | Wulfraed  Dennis Lee Bieber  KD6MOG <
>  >  [EMAIL PROTECTED] |   Bestiaria Support Staff   <
>  > == <
>  >   Home Page: <http://www.dm.net/~wulfraed/><
>  >Overflow Page: <http://wlfraed.home.netcom.com/><
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list