title: How to remove /n from readline() in Python?
body: <pre><code>    a = open('expressoes.txt', 'r')
  i = 0
  j = 0
  pilhaop = []
  string = []
  
  b = a.readlines()
  while j in range(len(b)):
          fixa = b[j]
          print b[j]
          while i &lt; len(fixa):
                  if fixa[i] == '^':
                          pilhaop.append(fixa[i])
                  elif fixa[i] == '*' or fixa[i] == '/' or fixa[i] == '%':
                          if len(pilhaop)&gt;0 and pilhaop[-1] in '^':
                                  string.append(pilhaop.pop())
                          else:
                                  pilhaop.append(fixa[i])
                  elif fixa[i] == '+' or fixa[i] == '-':
                          if len(pilhaop)&gt;0 and pilhaop[-1] in '* / %':
                                  string.append(pilhaop.pop())
  
                          pilhaop.append(fixa[i])
                  else: #se for digito passa direto para posfixa
                          string.append(fixa[i])
  
                  i += 1
  
          #esvazia a pilha
          while len(pilhaop)&gt;0:
                  string.append(pilhaop.pop())
          print ''.join(string)
          print "........................"
  
          j += 1
  </code></pre>
  
  <p>I have this code and I'm trying to convert infix expressions (5+3*2) from a txt file to postfix expressions (532*+). The code is doing the right thing, but when I have more than one expression on the txt file it goes like this:</p>
  
  <p>on txt file: </p>
  
  <pre><code>5+3*2
  6*4+8
  </code></pre>
  
  <p>after running:</p>
  
  <pre><code>5+3*2
  
  532
  *+
  ........................
  6*4+8
  532
  *+
  ........................
  </code></pre>
  
  <hr>
  
  <p>When I print 'string' without joining, it shows: ['5','3','2','/n','*','+']</p>
  
  <p>Could you help me?</p>