python - nested loop code not working please -


with open(sys.argv[2]) f:      processlist = f.readlines()      in range(0,1):          process = processlist[a]          print process          b in range(0,3):              process1 = process.split()              print process1[b] 

sys.argy[2 ] files has 2 sentences

sunday monday local owner public 

i trying read once sentence @ time , in each sentence trying access 1 word @ time.... able things need individually loop doesn’t not iterate... stops after first iteration....

with open(sys.argv[2]) f:     line in f: #iterate on each line         #print("-"*10) demo         word in line.rstrip().split(): #remove \n split space             print(word) 

over file produce

---------- sunday monday ---------- local owner public 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -