[wingide-users] Question on calling SubroutineA in SubroutineB

Wing IDE Support support at wingware.com
Thu Nov 14 08:29:36 MST 2013


On 11/14/13 4:12 AM, Joseph POLLACCO wrote:
> Now I have an other question, which worked well when I started using an interpreter like bpython but to date not with WINGWARE:
>
> Saved as TEST2.py
>
> def TEST2():
>
>       return 'hello'
>
> -------------------------------------------
>
> Saved as TEST1.py
>
> def TEST1():
>
>       return TEST2()
>
> print( TEST2() )

In Python, an import statement is needed to import the TEST2 module into 
TEST1.py.  TEST1 would be something like:

import TEST2

def TEST1():
     return TEST2.TEST2()

print (TEST1())

I think that that Python differs from Matlab in that functions defined 
in other files are not automatically available and more than one 
function may be defined in a file.  I've never used Matlab myself, but 
these are some of the differences listed in 
http://wiki.scipy.org/NumPy_for_Matlab_Users

Cheers,

John



More information about the wingide-users mailing list