title: Python quotation mark canceler algorithm
body: <pre><code>i = 1
  def textconverter(t,color='black'):
      #Magically change all quotation marks (') to (\')
      cwprint(t,color)
  def cwprint(t,color='black'):
      global i
      exec('label%d = Label(cw,text=\''%i+t+'\',fg=color).grid(row='+str(i)+')')
      i += 1
  textconverter('test')
  </code></pre>
  
  <p>I am building a small chat program to experiment with the Tkinter and socket libraries, but however I ran into this problem: I want to print a value (text which is sent by the user) on the screen using a label.</p>
  
  <p>Everything goes alright untill the user inputs a string including a quotation mark. For example: 'Don't do that'</p>
  
  <p>Python will think that the string is 'Don' and doesn't recognise the 't do that' part.
  Is there any way to fix this?</p>
  
  <p>Thanks</p>
  
  <p>btw: cwprint stands for print on chat window</p>