[Tutor] please help debug

Andrei Kulakov ak@silmarill.org
Sun, 7 Jul 2002 16:02:21 -0400


On Sun, Jul 07, 2002 at 07:29:44PM +0000, Kyle Babich wrote:
> My e-mail program deletes spaces for some reason.  I have attached a
> copy.
>
I did see spaces. I think some email clients (ms outlook?) don't show
tabs. So, try to convert tabs to spaces before mailiing a list post. In
vim this is done with :set expandtab

> 
> On Sun, 7 Jul 2002 08:12:13 -0400, "Charles Mantha"
> <charles_mantha@hotmail.com> said:
> > Where are the intendations? after each (:) there should be an
> > intendation...
> > 
> > Ok, well its kinda late here and I dont have much time to check the
> > rest.
> > But if I find something, ill tell ya.
> > 
> > 
> > ----- Original Message -----
> > From: "Kyle Babich" <kb@kb5.org>
> > To: "tutor" <tutor@python.org>
> > Sent: Sunday, July 07, 2002 6:54 AM
> > Subject: [Tutor] please help debug
> > 
> > 
> > > I'm writing a program that tracks each hour spent on the computer for
> > > my parents but I can't get hour() to execute, and time.sleep() won't
> > > sleep.  Can someone please help me fix these problems?
> > >
> > > Here is what I wrote so far:
> > >
> > > #! C:\Python22\python.exe
> > >
> > > import time
> > > time = time.strftime( "%I:%M:%S %Z", time.localtime(time.time()) )
> > >
> > > def hour():
> > > print "The current time is %(time)s" % vars()
> > > begin = raw_input( "Begin hour?  (Y/N):  " )
> > >
> > > if begin == "Y":
> > > time.sleep(3600)
> > > elif begin == "y":
> > > time.sleep(3600)
> > > elif begin == "N":
> > > excuse = raw_input( "Why not?  " )
> > > elif begin == "n":
> > > excuse1 = raw_input( "Why not?  " )
> > > else:
> > > begin1 = raw_input( "Begin hour?  (Y/N):  " )
> > > if begin1 == "Y":
> > > time.sleep(3600)
> > > elif begin1 == "y":
> > > time.sleep(3600)
> > > elif begin1 == "N":
> > > excuse2 = raw_input( "Why not?  " )
> > > elif begin1 == "n":
> > > excuse3 = raw_input( "Why not?  " )
> > > else:
> > > print "FAILED"
> > >
> > > username = raw_input( "Please type your name:  " )
> > >
> > > if username == "Kyle":
> > > print
> > > hour()
> > > elif username == "Jason":
> > > print
> > > hour()
> > > elif username == "Chelsea":
> > > print
> > > hour()
> > > elif username == "John":
> > > print
> > > hour()
> > > elif username == "Cheryl":
> > > print
> > > hour()
> > > else:
> > > print "FAILED"
> > >
> > >
> > >
> > > Also, if it makes a difference, I'm writing it to be used on Win98 with
> > > Python 2.2 installed.
> > > --
> > > Kyle
> > >
> > >
> > > _______________________________________________
> > > Tutor maillist  -  Tutor@python.org
> > > http://mail.python.org/mailman/listinfo/tutor
> > >
> > 
> > 
> > 
> > 
> 
> --
> Kyle


-- 
Cymbaline: intelligent learning mp3 player - python, linux, console.
get it at: cy.silmarill.org