Why do all module run together?

Posted by gunbuster363 on Stack Overflow See other posts from Stack Overflow or by gunbuster363
Published on 2011-06-20T09:12:10Z Indexed on 2011/06/20 16:22 UTC
Read the original article Hit count: 249

Filed under:
|
|

I just made a fresh copy of eclipse and installed pydev.

In my first trial to use pydev with eclipse, I created 2 module under the src package(the default one)

FirstModule.py:

'''
Created on 18.06.2009

@author: Lars Vogel
'''
def add(a,b):
    return a+b

def addFixedValue(a):
    y = 5
    return y +a

print "123"

run.py:

'''
Created on Jun 20, 2011

@author: Raymond.Yeung
'''
from FirstModule import add

print add(1,2)
print "Helloword"

When I pull out the pull down menu of the run button, and click "ProjectName run.py", here is the result:

123
3
Helloword

Apparantly both module ran, why? Is this the default setting?

© Stack Overflow or respective owner

Related posts about python

Related posts about eclipse