[Tutor] Calling functions

steve lonetwin@yahoo.com
Fri, 11 May 2001 12:32:34 +0530


Hi there,
 Correct me if I'm wrong:

>>> def x():
=2E..     print 'hi'
=2E..=20
>>> def y():
=2E..     print 'bye'
=2E..=20
>>> input('?')()
?x
hi

 Hope that helps

Peace
Steve

Original msg. :

Is there a way to define a function and then use a raw_input to call the
function?

Here's a little example of what I mean

####################################################################

def func_0():
         do something here

def func_1():
         do something else here

dummy=3Draw_input('Which function do you want to execute? ')

dummy <---- I want that to do what ever was entered into the raw_input

####################################################################

Well, that obviously doesn't work, but that is the basic idea.  I just
want to know if this is possible, and how I could go about doing it
--=20
||||||||||||||||||||||
|||||||||#####||||||||
||||||||#######|||||||
||||||||# O O #|||||||
||||||||#\ ~ /#|||||||
||||||##||\_/||##|||||
|||||#||||||||||##||||
||||#||||||||||||##|||
||||#|||||||||||||##||=09
|||/\##|||||||||##/\||=09
|/    \#########/    \=09
|\     \#######/     /=09
||\____/#######\____/|=09
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=09
"Unfortunately, those people who have nothing better to do than post on t=
he
Internet all day long are rarely the ones who have the most insights."
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D