Re: [Tutor] Medical Decision-Making Question

2011-06-17 Thread Steven D'Aprano
Fred G wrote: Thanks guys for all the feedback. re Jim's comments: I completely agree that the difference b/t "slight" fever and "returning" fever, etc will pose some problems. My hunch is that initially I'll just do something like make "fever" be the only one for now Any qualitative rating s

Re: [Tutor] Break stament issue

2011-06-17 Thread Steven D'Aprano
Susana Iraiis Delgado Rodriguez wrote: Hello members!! Steven, I already changed the settings in the IDE to avoid the trouble when I type the code. In the other hand I added the pass statement so the script keep working even though it finds an error, but the scripts ignore the pass statement. Co

Re: [Tutor] Step Value

2011-06-17 Thread Steven D'Aprano
Vincent Balmori wrote: Here is my updated code. As simple as this may be, I am a little lost again. I appreciate the help and explanations to try to push me to get this on my own, but at this point (especially after one week) this is when me being given the answer with an explanation will help me

[Tutor] Main Function

2011-06-17 Thread Vincent Balmori
I answered another question that says "Modify the guess_number program so that the program's code is in a function called main(). Don't forget to call main() so you can play the game." It seems to be working fine, but I would like to have a second opinion if there was a better way to put it togeth

Re: [Tutor] Need script help with concept

2011-06-17 Thread Noah Hall
On Sat, Jun 18, 2011 at 2:13 AM, Corey Richardson wrote: > "Noah Hall" wrote > >> Of course, if you mean *completely in-place replace* the question, >> then you >> will need something like ncurses (if on Linux)  - >> http://docs.python.org/library/curses.html > > There also exists urwid, which is

Re: [Tutor] Seattle PyCamp 2011

2011-06-17 Thread Noah Hall
On Sat, Jun 18, 2011 at 2:15 AM, Steven D'Aprano wrote: > Noah Hall wrote: > >> Just a note, but are these questions jokes? >> >>> Know how to use a text editor (not a word processor, but a text editor)? >>> Know how to use a browser to download a file? >>> Know how to run a program installer? >>

Re: [Tutor] Need script help with concept

2011-06-17 Thread Corey Richardson
"Noah Hall" wrote Of course, if you mean *completely in-place replace* the question, then you will need something like ncurses (if on Linux) - http://docs.python.org/library/curses.html There also exists urwid, which is multiplatform, and is also less painful to use. I hear there is a port

Re: [Tutor] Seattle PyCamp 2011

2011-06-17 Thread Steven D'Aprano
Noah Hall wrote: Just a note, but are these questions jokes? Know how to use a text editor (not a word processor, but a text editor)? Know how to use a browser to download a file? Know how to run a program installer? If not, then I'd consider removing them. This isn't 1984. I think the que

Re: [Tutor] Need script help with concept

2011-06-17 Thread Alan Gauld
"Noah Hall" wrote Of course, if you mean *completely in-place replace* the question, then you will need something like ncurses (if on Linux) - http://docs.python.org/library/curses.html Well, for this you could just use a lot of print statements(in a loop) or print a lot of newlines... cur

Re: [Tutor] Weird tkFont behavior

2011-06-17 Thread Alan Gauld
"Steve Willoughby" wrote I've been getting happier to see the improvements to what you can do with just plain Tkinter since the last time I used it seriously. I agree, Tkinter still gets a lot of bad feedback about its look but with ttk that's no longer justified. wxPython still has the edg

Re: [Tutor] Step Value

2011-06-17 Thread ALAN GAULD
>> def ask_number(question, low, high, step = 1): >> """Ask for a number within a range.""" >> response = None >> while response not in range(low, high, step): >> response = int(input(question)) >> return response > > With the only comment being that you don't really need the > resp

Re: [Tutor] Seattle PyCamp 2011

2011-06-17 Thread Noah Hall
On Sat, Jun 18, 2011 at 12:46 AM, Chris Calloway wrote: > University of Washington Marketing and the Seattle Plone Gathering host the > inaugural Seattle PyCamp 2011 at The Paul G. Allen Center for Computer > Science & Engineering on Monday, August 29 through Friday, September 2, > 2011. > > Regis

[Tutor] Seattle PyCamp 2011

2011-06-17 Thread Chris Calloway
University of Washington Marketing and the Seattle Plone Gathering host the inaugural Seattle PyCamp 2011 at The Paul G. Allen Center for Computer Science & Engineering on Monday, August 29 through Friday, September 2, 2011. Register today at http://trizpug.org/boot-camp/seapy11/ For beginner

Re: [Tutor] Step Value

2011-06-17 Thread Andre Engels
On Fri, Jun 17, 2011 at 11:03 PM, Alan Gauld wrote: > > "Vincent Balmori" wrote > >> Here is my updated code. As simple as this may be, I am a little lost >> again. > > I'm not sure why you are lost because that's pretty much it. > >> ... at this point (especially after one week) this is when me

Re: [Tutor] Need script help with concept

2011-06-17 Thread Noah Hall
On Fri, Jun 17, 2011 at 11:34 PM, Victor wrote: > I am in the process of building a script but I do not know if what I am > trying to do is possible. So, long story short, I need help. > > The concept: > I am want to be able to ask the user a series of questions in the program > window. > > But h

[Tutor] Need script help with concept

2011-06-17 Thread Victor
I am in the process of building a script but I do not know if what I am trying to do is possible. So, long story short, I need help.   The concept: I am want to be able to ask the user a series of questions in the program window.   But here is the action I want to appear on the screen.   0. Quest

Re: [Tutor] Weird tkFont behavior

2011-06-17 Thread Steve Willoughby
On 17-Jun-11 14:18, Alan Gauld wrote: But I confess I've never used font tags (and didn't even know they existed). Neither did I until now. I had been playing with WxPython previously (which is still a great toolkit I'd recommend when it makes sense), but I've been getting happier to see the

Re: [Tutor] Weird tkFont behavior

2011-06-17 Thread Alan Gauld
"Steve Willoughby" wrote I think I solved it, actually.. as I was typing this up, I wondered in passing about this: of the other fonts I configured for the other tags. Do I need to keep other references to the tkFont objects somewhere else or something? I was going to suggest trying tha

Re: [Tutor] Communicating Between Programs Using A Raw Input (Cont'd)

2011-06-17 Thread Alan Gauld
"Jacob Bender" wrote did have one question however, and that is will I need to modify the code of my password program? No, if it uses raw_input and print it will be using atdin and stdout so you can pipe from one program into the other Here's the code again: password = "Helloworld" try=

Re: [Tutor] Step Value

2011-06-17 Thread Alan Gauld
"Vincent Balmori" wrote Here is my updated code. As simple as this may be, I am a little lost again. I'm not sure why you are lost because that's pretty much it. ... at this point (especially after one week) this is when me being given the answer with an explanation will help me much more,

Re: [Tutor] Step Value

2011-06-17 Thread Vincent Balmori
Here is my updated code. As simple as this may be, I am a little lost again. I appreciate the help and explanations to try to push me to get this on my own, but at this point (especially after one week) this is when me being given the answer with an explanation will help me much more, so I can und

[Tutor] Communicating Between Programs Using A Raw Input (Cont'd)

2011-06-17 Thread Jacob Bender
Dear Tutors, Alright, I read up on stdin and stdout and I did find how useful they are. I did have one question however, and that is will I need to modify the code of my password program? Here's the code again: password = "Helloworld" try= raw_input("What's the password?") while try != password:

Re: [Tutor] Reading opened files

2011-06-17 Thread Lisi
On Friday 17 June 2011 17:42:29 Walter Prins wrote: > On 17 June 2011 17:20, Lisi wrote: > > >>> file=open("/home/lisi/CHOOSING_SHOES.txt", "r") > > >>> file.close() > > >>> file=open("/home/lisi/CHOOSING_SHOES.txt", "r") > > >>> whole=file.read > > >>> print whole > > > > > > > > >>> print "%r"

Re: [Tutor] Reading opened files

2011-06-17 Thread James Reynolds
Your problem is right here: >>> whole=file.read >>> print whole Your re-assigning the method "read()", which is a method of the object "file" to the variable "whole" So, when you print "whole" you can see that it is printing the location of the method in memory. If you were to print file.read yo

Re: [Tutor] Reading opened files

2011-06-17 Thread Walter Prins
On 17 June 2011 17:20, Lisi wrote: > >>> file=open("/home/lisi/CHOOSING_SHOES.txt", "r") > >>> file.close() > >>> file=open("/home/lisi/CHOOSING_SHOES.txt", "r") > >>> whole=file.read > >>> print whole > > >>> print "%r" % whole > > >>> print "whole is %r" %whole > whole is > >>> print "whole

[Tutor] Reading opened files (SOLVED)

2011-06-17 Thread Lisi
So sorry to have troubled you all. The light suddenly dawned. Perhaps because I was more relaxed, having asked the list? Anyhow, I now know how to do it, and it is of course, simple. [Passing on and coming back would obviously have worked, but the author had said not to do that this time. :

[Tutor] Reading opened files

2011-06-17 Thread Lisi
Hello :-) I have got as far as I have,i.e. apparently succeeding in both opening and closing two different files, thanks to google, but my struggles to _do_ something with a file that I have opened are getting me nowhere. Here is my latest failure: >>> file=open("/home/lisi/CHOOSING_SHOES.txt

Re: [Tutor] File parsing

2011-06-17 Thread Alan Gauld
"Neha P" wrote for eachline in f_obj: eachline=eachline[ :-1]# to eliminate the trailing "\n" Better to use rstrip() here, thee might be extraneous spaces etc to remove too. list_words=eachline.split(" ") list_words[0]=list_words[0]+"\n"# to add "\n" so that after line 1 is printed,

Re: [Tutor] Step Value

2011-06-17 Thread Alan Gauld
"Vincent Balmori" wrote "def spam(n=3): """Return n slices of yummy spam.""" return "spam "*n This is my new code for a default step value based on your feedback Steve: def ask_number(question, low, high, step): """Ask for a number within a range.""" response = None if step == N

Re: [Tutor] Problem

2011-06-17 Thread Mazen Harake
self doesn't refer to anything? It is undefined because it is in main and not in a method of an object. You have to do crit.talk() where crit is an object (which by the way isn't, you have crit1 and crit2) On 17 June 2011 09:28, David Merrick wrote: > # Critter Caretaker > # A virtual pet to car

[Tutor] Problem

2011-06-17 Thread David Merrick
# Critter Caretaker # A virtual pet to care for class Farm(object): #A collection of Critters def talk(self,farm): farm.talk() class Critter(object): """A virtual pet""" def __init__(self, name, hunger = 0, boredom = 0): self.name = name self.hunger = hunger