[Tutor] Help

Mylene Reiners mylene.reiners@cmg.com
Mon, 21 Oct 2002 10:08:38 +0200


Hi Dan,

Mind the importance of indentation in Python.
    if name !=3D "Danny":
is only tested if the name already was "Danny" ...

(check the indentation difference in the name and the pw part...)

Myl=E8ne

-----Original Message-----
From: Dan Dud
To: tutor@python.org
Sent: 10/20/2002 7:29 PM
Subject: [Tutor] Help


Hello everyone

I hope everyone weekend is going great I have this simple program that=20
everything works as I would have thought but it exits on the wrong
password=20
but doesn't on the wrong user name what did I do wrong here is the code

#!/usr/bin/python
import time, sys
name=3Draw_input("Halt who the hell are you\n")
password=3Draw_input("what is your password\n")
if name =3D=3D "Danny":
    print "Hi\n", name
    if name !=3D "Danny":
        print "unknown user exiting the system"
        sys.exit()

if password =3D=3D "b":
    print "Ok the time and date is\n"
    print time.ctime()
if password !=3D "b":
    print "unknown password exiting the system now"
    sys.exit()


Also if I wanted this to start after I log into my linux box who would =
i
do=20
that I figured you had to import os but from there I'm clueless thanks
for=20
everyone help and have a great weekend

Danny D




_________________________________________________________________
Surf the Web without missing calls! Get MSN Broadband. =20
http://resourcecenter.msn.com/access/plans/freeactivation.asp


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor