I think u need break before exit()
so if u want break from any loop just add break
"el chupacabra" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi, I'm just learning Pythonthanks in advance...
>
> Do you get out of this loop?
>
> Problem: When I type 'exit' (no quotes) the pr
> Desired behavior: when I type 'exit' the program should quit.
def search():
user_input = ''
while True:
user_input = raw_input('Search for: ')
if user_input == 'exit': break
print 'processing', user_input
Note that putting user input directly into SQL statements
What you do is asking for a string, and then embed the result in '%'
characters, as this is what you do in the sql statement (btw: where is
the cursor defined?)
It is probably a better idea to construct the sql statement with the
direct result of raw_input, instead of format it straight away - see
Hi, I'm just learning Pythonthanks in advance...
Do you get out of this loop?
Problem: When I type 'exit' (no quotes) the program doesn't quit the loop...it
actually attemps to find entries that containt the 'exit' string.
Desired behavior: when I type 'exit' the program should quit.
def s