Re: [Tutor] Tutor Digest, Vol 39, Issue 60

2007-05-23 Thread Leon Keylin
Janos, I tried the ODBC way and it worked! I was about to give up and do it in C# or some other language but I love Python so much I wanted it to work. Thank you SO MUCH! And thanks to all of you who helped as well! You folks are the best. Message: 6 Date: Wed, 23 May 2007 08:07:35 +0200 Fro

Re: [Tutor] creating a buffer object from a file ?

2007-05-23 Thread Iyer
thanks, alan for your helpful response. in reality what is a buffer object used for ? reading a file itself creates a string as in itself, file_handle = file ("path_to_file") file_data = file_handle.read() # file_data is a string, so why is a buffer object is needed ? the data in the binary

[Tutor] trouble with "if"

2007-05-23 Thread adam urbas
Hi all,I've been working with this new program that I wrote. I started out with it on a Ti-83, which is much easier to program than python. Now I'm trying to transfer the program to python but its proving to be quite difficult. I'm not sure what the whole indentation thing is for. And now I'

Re: [Tutor] trouble with "if"

2007-05-23 Thread Andre Engels
The problem is with types. The outcome of raw_input is a string. But if you give the line: if shape == 1: you are comparing it with a number. The text "1" is not equal to the number 1, so this evaluates to False. Instead you should do: if shape == "1": To also be able to type 'circle' instead

Re: [Tutor] trouble with "if"

2007-05-23 Thread Brian van den Broek
adam urbas said unto the world upon 05/23/2007 11:57 AM: > > Hi all, > > I've been working with this new program that I wrote. I started out > with it on a Ti-83, which is much easier to program than python. Now > I'm trying to transfer the program to python but its proving to be quite > dif

Re: [Tutor] trouble with "if"

2007-05-23 Thread Eric Walstad
adam urbas wrote: > Hi all, > > I've been working with this new program that I wrote. ... > #"User's Choice:" > shape=raw_input("> ") > > #"Select Given:" > if shape == 1: ... [EMAIL PROTECTED]:~$ python Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) [GCC 4.1.2 (Ubuntu 4.1.2-0ubunt

Re: [Tutor] two input acceptions

2007-05-23 Thread adam urbas
Sorry, Hotmail doesn't have a turn of HTML feature or if it does, I couldn't find it. I think I'm just going to take your word for it that raw_input is better because I find the entire concept quite confusing. I tried typing in your example in IDLE and it didn't do anything, except:>>And t

Re: [Tutor] two input acceptions

2007-05-23 Thread adam urbas
I figured out why it was asking for the radius of a square. It was because I had the if shape==1: thing on there. I was typing in rectangle and that was an else: function. How do i get it to accept both 1 and circle? I learned not to use else: unless I was completely sure that I could use it

Re: [Tutor] trouble with "if"

2007-05-23 Thread adam urbas
Sorry, I forgot to attach the files. Don't critique too much. If you find a mistake in the program, then I probably haven't gotten that far, since it isn't complete yet. I'm pretty much on the editing phase now.> Date: Wed, 23 May 2007 18:08:20 +0200> From: [EMAIL PROTECTED]> To: [EMAIL PROTE

Re: [Tutor] trouble with "if"

2007-05-23 Thread adam urbas
Thanks Andre. That solved most of the problems. Now all the lists will run correctly, but when I input a radius, it says:can't multiply sequence by non-int of type 'float'When it displays that, it is talking about circumference=(radius*2*3.14). I'm guessing it doesn't want me to multiply by

Re: [Tutor] trouble with "if"

2007-05-23 Thread adam urbas
Sorry, I don't think Hotmail has turn off HTML. If it does I havn't been able to find it. I think you're going to have to explain your little bit of text stuff down there at the bottom. I have no idea what most of that means. All my choice things are working now though. I think that is what

[Tutor] tkinter arrow event location

2007-05-23 Thread Teresa Stanton
Using a mouse I could use event.x to find the current location of the mouse. But if I have a canvas with a gif and I need the current location of the gif, could I bind the gif to an arrow event to get the feedback of where the gif is at any given time? If so, can someone show me how? T _

Re: [Tutor] trouble with "if"

2007-05-23 Thread Brian van den Broek
adam urbas said unto the world upon 05/23/2007 01:04 PM: > Sorry, I don't think Hotmail has turn off HTML. If it does I > havn't been able to find it. I think you're going to have to > explain your little bit of text stuff down there at the bottom. I > have no idea what most of that means. All

Re: [Tutor] trouble with "if"

2007-05-23 Thread Eric Walstad
Hi Adam, adam urbas wrote: > when I input a radius, it says: > > can't multiply sequence by non-int of type 'float' ... > > radius=raw_input("Enter Radius:") > > diameter=(radius*2) After you collect the raw_input for the radius, the radius variable contains a string, not a number (that's what

[Tutor] smtplib howto send with a subject line

2007-05-23 Thread Daniel McQuay
Hey Guys, I'm having a problem with my script that sends out an email using smtplib. Whats happening now is when it is send I get a (no subject) where the subject line should be. I checked a few places such as effbot and some other online doc but couldn't find any thing about the subject line. An

Re: [Tutor] smtplib howto send with a subject line

2007-05-23 Thread Mike Hansen
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Daniel McQuay > Sent: Wednesday, May 23, 2007 1:49 PM > To: tutor@python.org > Subject: [Tutor] smtplib howto send with a subject line > > Hey Guys, I'm having a problem with my script that sends ou

Re: [Tutor] smtplib howto send with a subject line

2007-05-23 Thread Daniel McQuay
Thanks Mike, it seems that I'll be easy to incorporate that into my script as well. I'll give it a try. I'm still open to other suggestions, though. On 5/23/07, Mike Hansen <[EMAIL PROTECTED]> wrote: > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf

Re: [Tutor] smtplib howto send with a subject line

2007-05-23 Thread Mike Hansen
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Daniel McQuay > Sent: Wednesday, May 23, 2007 3:52 PM > Cc: tutor@python.org > Subject: Re: [Tutor] smtplib howto send with a subject line > > Thanks Mike, it seems that I'll be easy to incorporate

Re: [Tutor] smtplib howto send with a subject line

2007-05-23 Thread Daniel McQuay
Thanks a lot Mike you have been very helpful. I gave that a try in a few different ways but, with the same results. I'm going to try your first example. Best Regards, On 5/23/07, Mike Hansen <[EMAIL PROTECTED]> wrote: > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PR