This code shouldn't even actually execute, you should get an indexerror exception. Close your IDE and try it again. Should make the issue more clear.
----------------------------- Sent from a mobile device with a bad e-mail client. ----------------------------- On Oct 27, 2010, at 1:04 PM, "Terry Green" <tman...@yahoo.com> wrote: > Need Help!] > > > > def main(): > > pass > > > > if __name__ == '__main__': > > main() > > postPos=words[3] > > f = open ("c:/users/terry/downloads/tup1012k/tup1012x.drf","r") > > lines = f.readlines() > > for line in lines: > > words = line.split(",") > > print (words[3],postPos) > > close = f > > > > When I run the above script, the field postPos doesn't match the input! > > postPost should be the same as words[3] > > can't guess why? > > any help? > > > > *** Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32 bit > (Intel)] on win32. *** > > >>> > > 1 3 > > 2 3 > > 3 3 > > >>> > > > > Terry Green > > > > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor