Python

Moderators: None (Apply to moderate this forum)
Number of threads: 473
Number of posts: 1172

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
tuple of list/tuple pointing to list Posted by sverkerlarson on 17 Dec 2012 at 8:42 AM
  logg = 'c:\\tmp\\Logg\\12-12-13.txt'
  f=open(logg,'r')
  file = f.readlines()
  f.close
  Data={}
  feltypen=()
  
  for line in open(logg):
 
    if len(line)>142:
      grab= (line)
      #dörrpanel
      sekvens = grab[31:38] #last layer put in list
      model= grab[39:47] #this is toplayer
      feltyp= grab[161:] #sorted under the toplayer
      if model in Data:
        if feltyp in Data[model]:
          try:
            (feltyp).append(sekvens)
          except:
            (feltyp)=()
            (feltyp).append(sekvens)
        else:
          Data[model].append(feltyp)
          feltyp)=()
          (feltyp).append(sekvens)


I know my syntax is messed up, but I cant find a way to write this code to get it to work. thanks for all help



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.