<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'tuple of list/tuple pointing to list' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'tuple of list/tuple pointing to list' posted on the 'Python' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 25 May 2013 17:51:52 -0700</pubDate>
    <lastBuildDate>Sat, 25 May 2013 17:51:52 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>tuple of list/tuple pointing to list</title>
      <link>http://www.programmersheaven.com/mb/python/430668/430668/tuple-of-listtuple-pointing-to-list/</link>
      <description>&lt;pre class="sourcecode"&gt;  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)&amp;gt;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)&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/python/430668/430668/tuple-of-listtuple-pointing-to-list/</guid>
      <pubDate>Mon, 17 Dec 2012 08:44:28 -0700</pubDate>
      <category>Python</category>
    </item>
    <item>
      <title>Re: tuple of list/tuple pointing to list</title>
      <link>http://www.programmersheaven.com/mb/python/430668/430669/re-tuple-of-listtuple-pointing-to-list/#430669</link>
      <description>&lt;pre class="sourcecode"&gt;&lt;pre class="sourcecode"&gt;  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)&amp;gt;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=()
          #I know this is way wrong but I want my "sekvens" to drop in                      
          #under the list under the list pointed 
          #to from the tuple
          (feltyp).append(sekvens)
      else:
        Data.append(model:list)
        list=()
        Data[model].append(feltyp)
        (feltyp).append(sekvens)&lt;/pre&gt;
  

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&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
sorry for the dubble messeges but the browser crached the first time I posted and the it dubbleposted the next time.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/python/430668/430669/re-tuple-of-listtuple-pointing-to-list/#430669</guid>
      <pubDate>Mon, 17 Dec 2012 08:57:49 -0700</pubDate>
      <category>Python</category>
    </item>
    <item>
      <title>Re: tuple of list/tuple pointing to list</title>
      <link>http://www.programmersheaven.com/mb/python/430668/430692/re-tuple-of-listtuple-pointing-to-list/#430692</link>
      <description>Okey I managed to solve thisone on my own.&lt;br /&gt;
Ended up with 2 list and 1 tupple I think =). om not that good at syntax so bare with me.&lt;br /&gt;
&lt;br /&gt;
I created one list with my fruite&lt;br /&gt;
one list with my errormsg&lt;br /&gt;
and one list with my sekvens and the index of the fruite from the fruite list and the index of the errormsg from the errormsg list me a list that I later on can sort by index =)...&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
DataLoop=[]
feltyper=[]
modeltyp=[]

def openfile():
      f=open(logg,'r')
      file = f.readlines()
      f.close
      for line in open(logg):
        if len(line)&amp;gt;142:
          grab= (line)
          sekvens = grab[31:38]
          fruit= grab[39:47]
          errormsg= grab[161:]
          if feltyp in feltyper:
            num=int(feltyper.index(feltyp))
          else:
            feltyper.append(feltyp)
            num=int(feltyper.index(feltyp))
          if model in modeltyp:
            nummod=int(modeltyp.index(model))
          else:
            modeltyp.append(model)
            nummod=int(modeltyp.index(model))
          DataLoop.append((nummod,sekvens,num))&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Thers probebly a 100 better ways to solve this, and if you have any pointers on my code. Please dont by scared to critesis it ;). &lt;br /&gt;
And yes, it probebly would be easyer to use a class for this, but I dont understand how to use classes even though I have spent more then a couple of hourese reading dummie manuels =S. So if you want to take it as your assaignment to explain class so I understan Id bee more then happy for you to give it a try.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/python/430668/430692/re-tuple-of-listtuple-pointing-to-list/#430692</guid>
      <pubDate>Wed, 19 Dec 2012 07:14:02 -0700</pubDate>
      <category>Python</category>
    </item>
  </channel>
</rss>