How to access the other scripts list values in current script in python -
i have script1.py
import sys lst = [] v in range(1,int(len(sys.argv)),1): lst.append(sys.argv[v])
script2.py
from script1 import lst print lst
if execute python script2.py abc xyz
, gives output []
(an empty list).
how can achieve this, please me.
//--- import lst variable, because of from script import lst
. so, code not execute, , have lst = []. make approach, list comprehension ok. //--- oh, terribly sorry, fault. it's wrong concept, script execute fully. so, problem lies in field.
Comments
Post a Comment