View Single Post
jhae2.718
#2
Feb4-12, 12:36 PM
PF Gold
jhae2.718's Avatar
P: 1,160
Please use [code ] tags...
#!/usr/bin/python
def examplr(str):
    print str
Based on your code, you've named your function examplr.

If that's just a typo in your post, and you're correctly calling the function, then it sounds like you haven't imported your module into Python. If you're using IDLE, hit F5 to run the script. Otherwise, run the interpreter in the directory you've saved example.py and run
import example
to bring the module into the current namespace. Then, you can access you function as
example.example('foo')