title: Making Python list in file and editing it later
body: <p>I'm making an program which stores certain data in txt files. I did it like this and it works, but I want to change it to lists, so it's easier to edit stuff inside with list.remove and list.append... This is format I made:</p>
  
  <pre><code>Username:data1:data2:data3:data++
  </code></pre>
  
  <p>What I want to achieve is:</p>
  
  <pre><code>Username:[data1, data2, data3, data++]
  </code></pre>
  
  <p>Why I want this?</p>
  
  <p>Because editing data separated with ":" is not "Pythonic way" to do this, so I want to convert them to lists...</p>
  
  <p>I get certain lines using this filter:</p>
  
  <pre><code>textfile = open("%s/CreativePoints/Data/plotovimemberi.txt"%pluginlokacija2, 'r+')
  a = filter(lambda x: x.startswith("%s:%s"%(targetplot, userID)), \
                                            textfile.readlines())
  </code></pre>
  
  <p>So current data file looks like this:</p>
  
  <pre><code>Username:data1:data2
  Username1:data134:data453:data6534
  Username3:data5345:data678:data111:data434
  and so on...
  </code></pre>
  
  <p>What I want to achieve is:</p>
  
  <pre><code>Username:[data1, data2]
  Username1:[data134, data453, data6534]
  Username3:[data5345, data678, data111, data434]
  and so on...
  </code></pre>
  
  <p>Why? Because I want to get certain line in file using filter I mentioned above and edit list... So I just need to split lines using "line.split(':')[1]" and get list of data, which I can edit using list.append and list.remove...</p>
  
  <p>Thanks for reading/answering! :)</p>