Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python: Sending a variable to another script

$ cat first.py second.py 
#first.py
def demo():
    some_list = []
    for i in 'string':
         some_list.append( i )
    return some_list

#second.py 
from first import demo

some_list = demo()
print some_list 

$python second.py
['s', 't', 'r', 'i', 'n', 'g']
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Sending #variable #script
ADD COMMENT
Topic
Name
1+4 =