<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body><div style="text-align: left;">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:<br><br>>>><br><br>>>><br></div><br>And then it told me that it didn't know what the >>("LOL") was. It really disliked the >> bit. I understand the concept though, I think. I have been using the raw_input though. If I change it from <br><br>var=raw_input()<br>>>("LOL")<br><br>to <br><br>var=raw_input("LOL")<br><br>then it displays<br><br>>>><br>LOL<br><br>>>><br><br>Not sure what that means, but yeah. Well thanks anyway.<br><br>Adam<br><br><br><hr id="stopSpelling">> Date: Sat, 19 May 2007 01:47:51 +0100<br>> From: finalyugi@sapo.pt<br>> To: adamurbas@hotmail.com; tutor@python.org<br>> Subject: Re: [Tutor] two input acceptions<br>> <br>> adam urbas escreveu:<br>> > Thanks for the help. I've made quite some progress since I first posted this email. I have a question though, what did you mean when you were talking about the raw_input( )? How can the regular input( ) be used evilly? If you could explain in depth, I would be very grateful. I have a new question related to my program area.py., I guess it's the same one as before. When I run the program and input the rectangle option, it asks me for a radius, unless I input 1, instead of rectangle. How do I program it to accept both 1 and rectangle?> Date: Sat, 12 May 2007 18:55:20 +0100> From: finalyugi@sapo.pt> To: adamurbas@hotmail.com> CC: tutor@python.org> Subject: Re: [Tutor] (no subject)> > adam urbas escreveu:> > Hi,I just started python today and I would like a few pointers, if you don't mind. I tried using a tutorial, but was only able to get the correct results for the most basic problems. # Area calculation programprint “Welcome to the Area calculation program”print “––<br>> –––––––––––”print# Print out the menu:print “Please select a shape:”print “1 Rectangle”print “2 Circle”# Get the user’s choice:shape = input(“> “)# Calculate the area:if shape == 1: height = input(“Please enter the height: “) width = input(“Please enter the width: “) area = height*width print “The area is”, areaelse: radius = input(“Please enter the radius: “) area = 3.14*(radius**2) print “The area is”, areaI've been trying to get this to work. I was on a forum on Google and they said to put:input("press ENTER to continue")at the end. I did, but it didn't work. It runs the program but just shuts itself off when its done and i don't even get to select any of the option things that i'm s> upposed to be able to select. It just turns on then back off and I don't even get to see anything. Could someone help me out.ThanksAdam> > _________________________________________________________________> > Create the ultimate e-mail address book. Import your cont<br>> acts to Windows Live Hotmail.> > www.windowslive-hotmail.com/learnmore/managemail2.html?locale=en-us&ocid=TXT_TAGLM_HMWL_reten_impcont_0507> > > > > > ------------------------------------------------------------------------> > > > _______________________________________________> > Tutor maillist - Tutor@python.org> > http://mail.python.org/mailman/listinfo/tutor> > First, welcome to the world of Python. :D> Second. please give a title when you start a new thread on a mailing list.> Third, format your posts and code. Since Python uses indented code, it's > kinda hard to read it when it's all in one line (Don't worry, I'll paste > it indented in a file attached to this email :D )> > Now for the code.> > After arranging the code, the first thing I noticed were this characters “ ”> > I tried running the code, and if gave me a error there, so I just > replace then with " ", and voilá, the code worked :D . So the lesson > here is always use either " " or ' ' in the code.> > Oh, a<br>> lso another thing. Don't use input() to get the user input, because > that command can run code and it may be evilly used. Always use > raw_input() instead :D .> > Anyway, I hope I helped you,> > > -- > _> ASCII ribbon campaign ( )> - against HTML email X> & vCards / \<br>> > _________________________________________________________________<br>> > Create the ultimate e-mail address book. Import your contacts to Windows Live Hotmail.<br>> > www.windowslive-hotmail.com/learnmore/managemail2.html?locale=en-us&ocid=TXT_TAGLM_HMWL_reten_impcont_0507<br>> <br>> First of all, what email client are you using?<br>> Because the text is getting all weird and difficult to read (it's all in <br>> one line, with no paragraphs and things like that).<br>> <br>> Now, the thing about input() and why it's not a good policy to use is <br>> that, unlike raw_input(), what type in a input() is executed by Python <br>> (in raw_input() is stored as a string).<br>> <br>> Example:<br>> <br>> var = raw_input()<br>> >> list("LOL")<br>> <br>> Now we have a variable called var which contains the string that says <br>> 'list("LOL")'<br>> You can confirm that by typing:<br>> print var<br>> >> 'list("LOL")<br>> <br>> There, no harm done. Now let's try the same thing using the input() command:<br>> <br>> var = input()<br>> >> list("LOL")<br>> <br>> Now let's type "print var" again as we did before.<br>> <br>> print var<br>> >> ['L', 'O'. 'L']<br>> <br>> Now what happened? Because you used the input() command, what you type <br>> was interpreted by Python, instead of being stored in a string and since <br>> the list() command is used to create a list, Python did just that. He <br>> created a list. Now, in this example, no harm was done. But image <br>> someone typing the command os.system("command to delete some file or run <br>> some file"). That would send a delete command to the terminal, or <br>> install some file (it could even be a virus).<br>> <br>> Ok, it's a little harder to explain, but the thing you should is that <br>> usually raw_input() = GOOD, input() = BAD.<br>> <br>> <br>> <br>> <br>> Now, I couldn't quite understand the second problem.<br>> Please explain a little better.<br>> <br>> PS: Now I know why I see all posts messed up. It's because you're <br>> sending your emails as a HTML, and I deactivated that on my email <br>> client. I don't know if Hotmail (I believe you send you emails from <br>> there) as an option to turn off HTML. If it was please use it :D<br>> (Besides being nice, you can get more responses if you do that. Not <br>> everyone has an HTML capable email client.)<br>> <br>> PS2 (no, not the console): I just noticed you didn't send the email back <br>> to the mailing list. You should select reply to all (or a similar <br>> option) when replying to mailing list, so that other people can learn too.<br>> <br>> <br>> <br>> -- <br>> _<br>> ASCII ribbon campaign ( )<br>> - against HTML email X<br>> & vCards / \<br><br /><hr />Create the ultimate e-mail address book. Import your contacts to Windows Live Hotmail. <a href='www.windowslive-hotmail.com/learnmore/managemail2.html?locale=en-us&ocid=RMT_TAGLM_HMWL_reten_impcont_0507' target='_new'>Try it!</a></body>
</html>