Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jython: Very basic question.

 
Gurumurthy Ramamurthy
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I have written a function in jython:

def call():
print "Hello Guru..."
return 1

I am calling this function:

call()

But this gives me the following exception:
NameError: call

How to call this function?

Thanks,
Guru
 
Gurumurthy Ramamurthy
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I did a mistake in my program. I have defined the function later and called before the function definition.

So, it should be:

1. Define the function first
2. Call this function next

This problem got solved.

Thanks,
Guru
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic