title: In python How do i check whether a string starts with special symbol or not?
body: <p>I wana check whether my string starts with a curly brace {.
  i tried the following code.</p>
  
  <pre><code>class parser(object):
      def __init__(self):
          self.fp=open('jsondata.txt','r')
          self.str=self.fp.read()
          print "Name of the file Opened is :",self.fp.name 
          print "Contents of the file :\n",self.str
      def rule1(self):
          var='{'
          if self.str[:0]==var:
              print "good match"
          else:
              print "No match"
  obj=parser()
  obj.rule1()   
  </code></pre>
  
  <p>The file contains: {"name":"Chuvi"}<br>
  but my output is: No match</p>
  
  <p>i even tried the following but dint get output  </p>
  
  <pre><code>            if self.str[:0]=='{':
                  print "good match"
              else:
                  print "No match"
  </code></pre>