How can I store raw input into a variable and then pass that variable into another script without requesting input again?
<p>Basically what I am trying to do is store raw input into a variable and then call that variable in another script. However, when I do this the second script asks for the input again. Is there a way to save the input in the variable without requesting the input in the second script?</p>

<pre><code>#!/usr/bin/env python
# -*- coding: utf-8 -*-

def userInput():

    token = raw_input('Enter your Spark Token: ')
    member = raw_input('Enter your email:')

    return token and member
</code></pre>

<p>Thank you!</p>

<p>Not sure whether I've understood correctly your question but you could try this:</p>

<blockquote>
  <p>main.py</p>
</blockquote>

<pre><code>from bar import user_input

def foo():
    token, member = user_input()
    print "Login user {0} with token {1}".format(member, token)

if __name__ == "__main__":
    foo()
</code></pre>

<blockquote>
  <p>bar.py</p>
</blockquote>

<pre><code>def user_input():
    token = raw_input('Enter your Spark Token: ')
    member = raw_input('Enter your email:')

    return token, member
</code></pre>

<p>As you can see, in the file <code>main.py</code> you're calling your <code>bar.user_input</code> method once so you'll get asked by member &amp; token only once.</p>

python