Re: [Tutor] Pictures

2011-04-27 Thread Wayne Werner
On Wed, Apr 27, 2011 at 10:41 PM, wrote: > Hello, > > I'm still quite new at this but I'm trying to get a list of the pictures > adress (... .jpg) of a page of a website. > > I thought of using the import urllib and import re, trying to fetch the > website, parse it, and collect the adresses but

[Tutor] Pictures

2011-04-27 Thread l . leichtnam
Hello, I'm still quite new at this but I'm trying to get a list of the pictures adress (... .jpg) of a page of a website. I thought of using the import urllib and import re, trying to fetch the website, parse it, and collect the adresses but I don't know how to do it... Can you help me? Thank

Re: [Tutor] NameError?

2011-04-27 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Brad Desautels wrote: Hello, I am working on a problem for my computer science class. This program is supposed to change the expression of the face when the appropriate button is clicked. It seems logical that it should work, however, when I click one of the buttons, I

[Tutor] NameError?

2011-04-27 Thread Brad Desautels
Hello, I am working on a problem for my computer science class. This program is supposed to change the expression of the face when the appropriate button is clicked. It seems logical that it should work, however, when I click one of the buttons, I get "NameError: global name 'window' is not defined

Re: [Tutor] Just started Python

2011-04-27 Thread Johnson Tran
Ahh, I was wondering about why it didn't show the error message on the first variable. Makes sense, thanks again. Sent from my iPhone On Apr 27, 2011, at 5:05 PM, Alan Gauld wrote: > > "Johnson Tran" wrote >> Okay so my final program is: > > It works but you can improve it slightly with a

Re: [Tutor] Just started Python

2011-04-27 Thread Alan Gauld
"Johnson Tran" wrote Okay so my final program is: It works but you can improve it slightly with a simple change. model=raw_input("What kind of car do you drive?") gallons=raw_input("How many gallons have you driven?") miles=raw_input("How many miles have you driven?") try: number1 = f

Re: [Tutor] Just started Python

2011-04-27 Thread Johnson Tran
Yeah, I'll be honest I did not really understand the float concept, thanks for explaining that =). So basically model does not have to be defined in try: because it does not need to be told to be put into point number? Okay so my final program is: model=raw_input("What kind of car do you drive?

Re: [Tutor] Just started Python

2011-04-27 Thread Edgar Almonte
yes i just forget remove the previous one On Wed, Apr 27, 2011 at 5:39 PM, Steve Willoughby wrote: > On 27-Apr-11 14:35, Edgar Almonte wrote: >> >> try this : >> >> >> >>  model=raw_input("What kind of car do you drive?") >>  gallons=raw_input("How many gallons have you driven?") >>  number1 = f

Re: [Tutor] Just started Python

2011-04-27 Thread Alan Gauld
"Johnson Tran" wrote Thanks for the reply Alan and Noah, I really appreciate the help. I am really trying to understand this although still cannot seem to grasp it all. Lets step back a stage. Do you understand what float() does? I have modified my program although now it seems to be givi

Re: [Tutor] Just started Python

2011-04-27 Thread Steve Willoughby
On 27-Apr-11 14:35, Edgar Almonte wrote: try this : model=raw_input("What kind of car do you drive?") gallons=raw_input("How many gallons have you driven?") number1 = float (gallons) miles=raw_input("How many miles have you driven?") number2 = float (miles) try: number1 = float (

Re: [Tutor] Just started Python

2011-04-27 Thread Edgar Almonte
try this : model=raw_input("What kind of car do you drive?") gallons=raw_input("How many gallons have you driven?") number1 = float (gallons) miles=raw_input("How many miles have you driven?") number2 = float (miles) try: number1 = float (gallons) number2 = float (miles) except ValueEr

Re: [Tutor] Just started Python

2011-04-27 Thread Noah Hall
On Wed, Apr 27, 2011 at 9:17 PM, Johnson Tran wrote: > Thanks for the reply Alan and Noah, I really appreciate the help. I am really > trying to understand this although still cannot seem to grasp it all. I have > modified my program although now it seems to be giving me the wrong answer > with

Re: [Tutor] Just started Python

2011-04-27 Thread Johnson Tran
Thanks for the reply Alan and Noah, I really appreciate the help. I am really trying to understand this although still cannot seem to grasp it all. I have modified my program although now it seems to be giving me the wrong answer with the correct answer when I input any value. I have program:

Re: [Tutor] Just started Python

2011-04-27 Thread Alan Gauld
"Johnson Tran" wrote I started out with a short program below and I thought it was working although I cannot seem to figure out how to use the except ValueError so that when the user puts an invalid answer the program does not read with an error. You have to replace the line that says 'p

Re: [Tutor] Just started Python

2011-04-27 Thread Noah Hall
On Wed, Apr 27, 2011 at 1:32 PM, Johnson Tran wrote: > Program::: > model=raw_input("What kind of car do you drive?") > number_string1=raw_input("How many gallons have you driven?") > number1 = float (number_string1) There's no validation for the variables when you try to convert them (see bottom

[Tutor] Just started Python

2011-04-27 Thread Johnson Tran
Hi All, I am a complete beginner so my question will probably be pretty noob but: I started out with a short program below and I thought it was working although I cannot seem to figure out how to use the except ValueError so that when the user puts an invalid answer the program does not read wi