Send Info from Script to Module Python
Question: Hi I wonder how you can send info over to a module

An Example main.py Looks like this

    
    
    from module import *
    print helloworld()
    

module.py looks like this

    
    
    def helloworld():    
        print "Hello world!"
    

Anyway i want to send over info from main.py to module.py is it possible?


Answer: It is not clear what you mean by "send info", but if you but the typical way
of passing a value would be with a function parameter.

main.py:

    
    
    helloworld("Hello world!")
    

module.py

    
    
    def helloworld(message):
        print message
    

Is that what your looking for? Also the two uses of `print` in your example
are redundant.

Addendum: It might be useful for you to read the [Python documentation
regarding function
declarations](http://docs.python.org/tutorial/controlflow.html#defining-
functions), or, alternatively, most Python introductory tutorials would cover
the same ground in fewer words. Anything you read there is going to apply
equally regardless of whether the function is in the same module or another
module.

