User input and retrieving it in Python
<p>I am currently trying using two modules in python, I am trying to have one module take user input and store it. But I cannot figure how to retrieve the data from the input module. I have imported everything but this only runs my input again from the def in the input module. Below is an example of my input module. How to I return this value from the user and use it in my other module to do calculations with?</p>

<pre><code>def test():
   test = int(input("numbers:"))
   return test
</code></pre>

<p>I assume you mean you use two files, and you need to use the information from the test function on the other file. Then, assuming you test file name is <code>testfile.py</code>, I would go with:</p>

<pre><code>import testfile
num = testfile.test() # This will store the number recieved in the test() function in the variable num
print('Recieved number from user:', num)
</code></pre>

python python-2.7 python-3.x