raw_input
will block until you enter something. When a new line is received (pressing the user button), the value will be returned and can be saved. It seems you never tried to name your function test
. You might want to try something like this (I can explain if you need it)
name = raw_input("What is your name: ") def test(username): print "Hi %s, this will be amazing if it works" % (username,) test(name)
Based on your other comments, this is a safe way:
# Define two functions test() and other() def test(): print "OMG, it works..." def other(): print "I can call multiple functions"
source share