Re: [Tutor] how to stop a function

2007-04-25 Thread Dmitry Dzhus

Maybe `return`?

-- 
Happy Hacking.

Dmitry Sphinx Dzhus
http://sphinx.net.ru
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] how to stop a function

2007-04-24 Thread shawn bright
hello all,

i have a gui app that uses functions to respond to gui events.

like
def on_start_button_clicked(self, stuff):
do this or that.

now there is one function that i have a kinda nested if else
conditions that i need to stop if necessary

if value == 1:
if next_val == 4:
   do this or that
else:
   here i need the function to just die
do somthing here

is there something i can do to make this happen?

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


Re: [Tutor] how to stop a function

2007-04-24 Thread Kent Johnson
shawn bright wrote:
 now there is one function that i have a kinda nested if else
 conditions that i need to stop if necessary
 
 if value == 1:
 if next_val == 4:
do this or that
 else:
here i need the function to just die
 do somthing here
 
 is there something i can do to make this happen?

return

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


Re: [Tutor] how to stop a function

2007-04-24 Thread shawn bright
jeeze, thanks, sorry, stupid question.

On 4/24/07, Kent Johnson [EMAIL PROTECTED] wrote:
 shawn bright wrote:
  now there is one function that i have a kinda nested if else
  conditions that i need to stop if necessary
 
  if value == 1:
  if next_val == 4:
 do this or that
  else:
 here i need the function to just die
  do somthing here
 
  is there something i can do to make this happen?

 return

 Kent

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


Re: [Tutor] how to stop a function

2007-04-24 Thread Rikard Bosnjakovic
On 4/24/07, shawn bright [EMAIL PROTECTED] wrote:

 is there something i can do to make this happen?

Use the keyword return.


-- 
- Rikard - http://bos.hack.org/cv/
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor