Re: [Tutor] need help with sending email

2007-01-05 Thread shawn bright
this is really cool. working too, we have one provider now that it does not work with, but i think its them this time. thanks for your help on this shawn On 1/5/07, Christopher Arndt <[EMAIL PROTECTED]> wrote: shawn bright schrieb: > lo there all. > > i am in a tight spot be

[Tutor] question about pydev

2007-01-09 Thread shawn bright
hey there gents, i was wondering if anyone uses pydev ? its a plugin for eclipse. Has lots of cool stuffs, but i don't like the way it does code snippets, when i paste one that is kinda long, it messes up the indentation. anyone know a way around this ? i have posted this question on the pydev sou

[Tutor] question about *args and functions

2007-01-26 Thread shawn bright
lo there all, if i have a function that sometimes needs a value passed to it and sometimes not, is this where i use *args ? like this def some_function(req_var, req_var2, un_req_var): do some stuff return value how would i use this if sometimes i need to process un_req_var and sometimes

Re: [Tutor] question about *args and functions

2007-01-26 Thread shawn bright
nction(req_var, req_var2, un_req_var=None): if un_req_var != None: dosomething else: dosomethingelse Wesley Brooks. On 26/01/07, shawn bright <[EMAIL PROTECTED]> wrote: > lo there all, > > if i have a function that sometimes needs a value passed to it and sometimes

Re: [Tutor] Best IDE for Python

2007-01-27 Thread shawn bright
i think pydev ( an eclipse plugin ) can too. shawn On 1/27/07, Dick Moores <[EMAIL PROTECTED]> wrote: At 07:12 PM 1/24/2007, Shadab Sayani wrote: Hi, I am using vim editor to code my project in python.Is there a good IDE where in I type the name of the class object and then dot then all the a

[Tutor] question about a list of lists

2007-01-28 Thread shawn bright
lo there all. i have a list of lists that i want to build, only if an item is not in the list already. kinda like this new_list = [] for item in lists: # item will look something like [var1, var2, var3] if item[0] in new_list ( only the first element of each list ) like new_list[0][0] basicl

Re: [Tutor] question about a list of lists

2007-01-29 Thread shawn bright
Thanks Kent, i am going with option A, the helper set, because i also need to count the occurances and this seems to be the easiest solution. thanks for your help. shawn On 1/28/07, Kent Johnson <[EMAIL PROTECTED]> wrote: shawn bright wrote: > lo there all. > > i have a lis

Re: [Tutor] question about importing threads

2007-02-09 Thread shawn bright
nt modules that would need to use it? Or does this go along with what you wrote a while back about having classes that depend on each other ? One runs as a thread, the other responds to gui input. thanks for any tips. shawn On 12/31/06, Alan Gauld <[EMAIL PROTECTED]> wrote: "shawn brig

Re: [Tutor] question about importing threads

2007-02-11 Thread shawn bright
lan G. On 12/31/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > > "shawn bright" <[EMAIL PROTECTED]> wrote > > > Yes, the thing is getting to be a pain to deal with at this size, i > > am > > in-process of splitting out the classes into their own files.

Re: [Tutor] question about importing threads

2007-02-11 Thread shawn bright
great, saves me 15 lines. thanks sk On 2/11/07, Kent Johnson <[EMAIL PROTECTED]> wrote: shawn bright wrote: > one last queston. if i have a class that i import as a module, say a > script that emails me when something goes wrong. > so i have a file called my_own_email.py an

[Tutor] how to read one bit of a byte

2007-02-20 Thread shawn bright
lo there all, i am reading a binary file with open('myfile', 'rb') then i do a read(1) to read one byte. cool so far. but how do i read the individual bits of a byte i mean if i have a = read(1) how do i know what the msb of a is ? i need to know because i have to see if the msb is set and i

Re: [Tutor] how to read one bit of a byte

2007-02-20 Thread shawn bright
great, thanks for this. appreciate it a lot. sk On 2/20/07, Luke Paireepinart <[EMAIL PROTECTED]> wrote: shawn bright wrote: > lo there all, > > i am reading a binary file with open('myfile', 'rb') > > then i do a read(1) to read one byte. cool so

Re: [Tutor] how to read one bit of a byte

2007-02-21 Thread shawn bright
even better, thanks much for this. shawn On 2/21/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > Luke Paireepinart wrote: > > shawn bright wrote: > >> lo there all, > >> > >> i am reading a binary file with open('myfile', 'rb'

[Tutor] stumped again adding bytes

2007-02-21 Thread shawn bright
Hey all, thanks for the help yesterday on finding out if an msb is set or not. i am now kinda stumped with discovering the value of two bytes together. ok, if i have two bytes that together make a number, how do i find that number? i know that i do not add them. like byte_a = 39 byte_b = 138 to

Re: [Tutor] stumped again adding bytes

2007-02-21 Thread shawn bright
the numbers so, i guess a better question is how to get 2599 from the ord(a) and ord(b), how do i put the two bytes together to make one number? thanks for your help On 2/21/07, Luke Paireepinart <[EMAIL PROTECTED]> wrote: > shawn bright wrote: > > Hey all, thanks for the help yeste

Re: [Tutor] how to read one bit of a byte

2007-02-21 Thread shawn bright
Hey thanks for all the help guys, i am at least pulling some values that make sense. i feel more like i am on my way. thanks again shawn On 2/21/07, Alan Gauld <[EMAIL PROTECTED]> wrote: > > "Kent Johnson" <[EMAIL PROTECTED]> wrote > > This is also a good application of bitwise operations. > > >

Re: [Tutor] stumped again adding bytes

2007-02-23 Thread shawn bright
the struct module, but can't figgure out how to do this type of thing with it. thanks shawn On 2/21/07, Luke Paireepinart <[EMAIL PROTECTED]> wrote: > shawn bright wrote: > > oh, sorry, i meant how to get the 0x0A27 out of two bytes > > a = 0x27 and b = 0x8A > I don

Re: [Tutor] stumped again adding bytes

2007-02-23 Thread shawn bright
ist of the 2nd half of the 2nd byte as the most significant , i would take the second byte with my bitmask then shift it right by 4 then add the third byte to that am i getting this right like x = ((byte2 & 240) << 4) + byte 3 i think ? shawn On 2/23/07, Luke Paireepinart <[EMAIL

Re: [Tutor] stumped again adding bytes

2007-02-23 Thread shawn bright
whoops, meant this to the list, sorry Luke. On 2/23/07, shawn bright <[EMAIL PROTECTED]> wrote: > Thanks for your help, Luke. > i am trying to get a grasp on how all this works, which is the msb, lsb, etc.. > > if i use i bitmask of 240 it will mask the most significant 4 bits

Re: [Tutor] stumped again adding bytes

2007-02-24 Thread shawn bright
TED]> wrote: > > "shawn bright" <[EMAIL PROTECTED]> wrote > > > if i use i bitmask of 240 it will mask the most significant 4 bits > > When using bitmasks its much easier to think in hex (or octal). > there are exactly 2 hex digits per byte so you only need to

[Tutor] question about forwarding mail with poplib

2007-02-28 Thread shawn bright
Hello there all, i am poplib to retrieve mail from a pop server here on my local machine. i need to be able to forward every message i get to another email address. i looked through the poplib page on the reference online but i can't find anything there to help me out with this. Also, the message

[Tutor] how to send command line args to py script

2007-03-11 Thread shawn bright
lo there all, i was wondering how to make a python script accept command line arguments. i mean, i have used python scripts from the command line in linux and passed something to it and it knows what to do. like in a function, if i want to do something like this def add_two_numbers(a, b): x

Re: [Tutor] how to send command line args to py script

2007-03-11 Thread shawn bright
ript with the formatting "python (filename).py 1 1", not > "python (filename).py -1 -1", that'll get you negative numbers. > > shawn bright wrote: > > lo there all, > > > > i was wondering how to make a python script accept command line arguments. >

Re: [Tutor] how to send command line args to py script

2007-03-11 Thread shawn bright
OK, will do. Looks like my future will involve more of this kind of thing. thanks shawn On 3/11/07, Dave Kuhlman <[EMAIL PROTECTED]> wrote: > On Sun, Mar 11, 2007 at 09:07:41PM -0500, shawn bright wrote: > > Well, for your first response, its great, > > thanks a lot. > &

[Tutor] question about gui tool-kits

2007-04-05 Thread shawn bright
lo there all, i have been working with pygtk2 for a while now, and, though i do like the look and feel of a GTK2 app, i would like to do some stuff with wx. I know, it doesn't look as cool, but , i may have need to work on something that i can port to a windows box, and i think that wx would be a

[Tutor] how to get response from os.system()

2008-03-16 Thread shawn bright
Lo there all, I am needing to get a response back from a system command. i can do this: os.system('mailq | wc -l") if i do this in the terminal mailq | wc -l , it will spit out a number. How do i get that number as a python variable ? OK, thanks. shawn

Re: [Tutor] how to get response from os.system()

2008-03-16 Thread shawn bright
thanks all, appreciate it much. shawn On Sun, Mar 16, 2008 at 6:10 PM, Nathan McBride <[EMAIL PROTECTED]> wrote: > Yup I use the pexpect module for a lot however couldn't get 'pexpect.run' to > work with mysqldump piping to gzip > > > -Original Message- > From: Jeff Younker <[EMAIL PROT

[Tutor] send and receive HTTP POST

2008-04-30 Thread shawn bright
Hey there all, I have been spending some time trying to get my head around how to send info by POST and read the result. These are examples of what i need to read and write . I think i can pull off the writing part, but how do i call it? POST /soap/SMS.asmx HTTP/1.1 Host: api.upsidewireless.com

Re: [Tutor] send and receive HTTP POST

2008-05-01 Thread shawn bright
Thanks, sorry i was late getting back to you, but gmail thought this was spam. Go figure. Anyway, SOAPpy is doing great. Thanks shawn On Wed, Apr 30, 2008 at 2:05 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > > POST /soap/SMS.asmx HTTP/1.1 > > Host: api.upsidewireless.com > > Content-Type: t

[Tutor] how to see a number as two bytes

2008-10-20 Thread shawn bright
hey there all, i have a script that needs to send a number as two bytes. how would i be able to see a number expressed as a hi byte and a lo byte? thanks shawn ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Fwd: how to see a number as two bytes

2008-10-20 Thread shawn bright
D]> > Date: Mon, Oct 20, 2008 at 11:00 AM > Subject: Re: [Tutor] how to see a number as two bytes > To: shawn bright <[EMAIL PROTECTED]> > > > high, low = ((num % 2**16) >> 8, num % 2**8) or something thereabouts. > > On Mon, Oct 20, 2008 at 10:47 AM, shawn br

Re: [Tutor] Fwd: how to see a number as two bytes

2008-10-20 Thread shawn bright
left, > 01101011 > and that is your low value. > > On Mon, Oct 20, 2008 at 11:04 AM, shawn bright <[EMAIL PROTECTED]> wrote: >> so using this, if num ==6, then i should get 2 and 88 ? >> thanks, just checking to make sure i get what you wrote. >> sha

Re: [Tutor] Fwd: how to see a number as two bytes

2008-10-20 Thread shawn bright
reasonable but I can't be sure. > > On Mon, Oct 20, 2008 at 11:20 AM, shawn bright <[EMAIL PROTECTED]> wrote: >> jeez, i screwed up, i ment num = 600, not 6 >> thanks >> >> On Mon, Oct 20, 2008 at 11:16 AM, Luke Paireepinart >> <[EMAIL P

Re: [Tutor] how to see a number as two bytes

2008-10-21 Thread shawn bright
Thanks for all your help on this, gents. found what works. shawn On Mon, Oct 20, 2008 at 6:06 PM, Alan Gauld <[EMAIL PROTECTED]>wrote: > "shawn bright" <[EMAIL PROTECTED]> wrote > > i have a script that needs to send a number as two bytes. >> how would i b

[Tutor] how to read over serial port

2008-11-01 Thread shawn bright
Hey there all, I have a gps device that talks to the computer over a serial port. i am using the pyserial module and getting values in. Here is my delima, i am supposed to read a message in that starts with a $ (this is all ascii). but when i do a ser.read(16) and i try to print it to a screen,

Re: [Tutor] how to read over serial port

2008-11-01 Thread shawn bright
the fields of data. thanks for any suggestions on this. shawn On Sat, Nov 1, 2008 at 11:02 PM, bob gailer <[EMAIL PROTECTED]> wrote: > shawn bright wrote: >> >> Hey there all, >> >> I have a gps device that talks to the computer over a serial port. >> i a

Re: [Tutor] how to read over serial port

2008-11-02 Thread shawn bright
same problem. Just don't know how to read it. thanks shawn On Sun, Nov 2, 2008 at 9:38 AM, Brian C. Lane <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > shawn bright wrote: >> Hey there all, >> >> I have a gps device that tal

Re: [Tutor] how to read over serial port

2008-11-03 Thread shawn bright
Hey all, sorry, but am i supposed to be using 'rb' to read this? thanks sk On Sun, Nov 2, 2008 at 11:50 AM, shawn bright <[EMAIL PROTECTED]> wrote: > Thanks all, > Yeah, checked the settings, and when i have the thing talk to a > program that just prints out whatever

Re: [Tutor] how to read over serial port

2008-11-03 Thread shawn bright
d(i)) i get the same weird characters. should these be read some other way? thanks, shawn On Mon, Nov 3, 2008 at 8:14 AM, shawn bright <[EMAIL PROTECTED]> wrote: > Hey all, sorry, but am i supposed to be using 'rb' to read this? > thanks > > sk > > On Sun, N

Re: [Tutor] how to read over serial port

2008-11-03 Thread shawn bright
#x27;J' 's' '\xde' '\xc0' '\xce' '\xcc' '\x06' '\n' '\x00' '\x00' ' ' '\xaf' 'J' 's' '\xde' '\xc0' so, what do i do now? and thanks for the info

Re: [Tutor] how to read over serial port

2008-11-03 Thread shawn bright
, Jerry Hill <[EMAIL PROTECTED]> wrote: > On Mon, Nov 3, 2008 at 4:08 PM, shawn bright <[EMAIL PROTECTED]> wrote: >> yes, they look like this >> �� >> >> so i used your print repr(chr(ord(i))) and got this > > Note that that's the

Re: [Tutor] how to read over serial port

2008-11-03 Thread shawn bright
, Nov 3, 2008 at 10:14 PM, Brian C. Lane <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > shawn bright wrote: >> Forgot some info, >> i hooked the device up and used a serial terminal and got back stuff like >> this >> !^V$G(

[Tutor] serial port, revisited, but closer

2008-11-05 Thread shawn bright
Hey all, I am back again with the serial port stuff, i have verified that all the baud rate and settings are ok, had my unit talk directly to a serial port reader and it is looking good, however, i still am not seeming to be able to read this. I had a question that might make me a clue. if i do t

[Tutor] best way to run several processes over and over

2008-12-05 Thread shawn bright
Hey all. I have a rather large app that uses 14 threads that all run at the same time. i use threading.Thread().start() to set them off. each one runs somthing like this def run(): while 1: do a bunch of stuff time.sleep(60) i have the option i guess of having fewer thread

[Tutor] how to run a process forever

2008-12-10 Thread shawn bright
Hey gents, I have an interesting problem. I need to have a python script start when a computer boots up, and i need it to run forever. I also am going to run a script by cron that will check to see if the process is running, if not, i need a python script to execute the script. What would be a go

Re: [Tutor] how to run a process forever

2008-12-10 Thread shawn bright
cesses (so I'm told). > -HTH, > Wayne > On Wed, Dec 10, 2008 at 12:28 PM, Steve Willoughby <[EMAIL PROTECTED]> > wrote: >> >> On Wed, Dec 10, 2008 at 12:23:48PM -0600, shawn bright wrote: >> > Hey gents, >> > >> > I have an interesting problem

Re: [Tutor] how to run a process forever

2008-12-10 Thread shawn bright
cool thanks for the help. -shawn On Wed, Dec 10, 2008 at 1:29 PM, Steve Willoughby <[EMAIL PROTECTED]> wrote: > On Wed, Dec 10, 2008 at 01:15:18PM -0600, shawn bright wrote: >> Sorry, was not very specific in my request. >> >> say i have a script like >> >

<    1   2