title: Replace words in list that later will be used in variable
body: <p>I have a file which currently stores a string <code>eeb39d3e-dd4f-11e8-acf7-a6389e8e7978</code>
  which I am trying to pass into as a variable to my subprocess command.</p>
  
  <p>My current code looks like this</p>
  
  <pre><code>with open(logfilnavn, 'r') as t:
                  test = t.readlines()
                  print(test)  
  </code></pre>
  
  <p>But this prints <code>['eeb39d3e-dd4f-11e8-acf7-a6389e8e7978\n']</code> and I don't want the part with <strong>['\n']</strong> to be passed into my command, so i'm trying to remove them by using replace. </p>
  
  <pre><code> with open(logfilnavn, 'r') as t:
              test = t.readlines()
              removestrings = test.replace('[', '').replace('[', '').replace('\\', '').replace("'", '').replace('n', '')
              print(removestrings)    
  </code></pre>
  
  <p>I get an exception value saying this so how can I replace these with nothing and store them as a string for my subprocess command?</p>
  
  <blockquote>
    <p>'list' object has no attribute 'replace'</p>
  </blockquote>
  
  <p>so how can I replace these with nothing and store them as a string for my subprocess command?</p>