function_related ques

Asked by sanjana

hi. I created "called_fun.sikuli "
The contents for dis file is

def hey():
    a= "pass"
    return a

An other file "calling_fun.sikuli" whose contents are

import called_fun
test = open('C:\test.html','w')
called_fun.hey()
test.writelines(("<p>%s</p>" %(a)))
test.close()

Value of "a" returned by file1 is not recognised by file2. What is the mistake ???

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

a is not a globally known name, since it is local to hey()

this works:

test.writelines(("<p>%s</p>" %(called_fun.hey())))

means you have to somehoe assign/use the return value of hey()

Can you help with this problem?

Provide an answer of your own, or ask sanjana for more information if necessary.

To post a message you must log in.