Python: Mengirim variabel ke skrip lain
$ 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']
Ill Ibis