title: Python ignoring if/elif statement
body: <p>Hello the compiler ignore if/elif statement and i dont know why</p>
  <p>i added some print to know the source of the problem but i didnt get it</p>
  <pre><code>def decode_frame(frame_dir, caesarn):
      #take the first frame to get width, height, and total encoded frame
      # first_frame = Image.open(str(frame_dir) + &quot;/0.jpg&quot;)
      first_frame = Image.open(str(frame_dir) + &quot;/&quot; + &quot;1.png&quot;)
      print(&quot;1&quot;)
  
      r, g, b = first_frame.getpixel((0, 0))
      print(&quot;2&quot;)
  
      total_encoded_frame = g
      print(&quot;3&quot;)
      msg = &quot;&quot;
      print(&quot;4&quot;)
      for i in range(1, total_encoded_frame+1):
          print(&quot;5&quot;)
          frame = Image.open(str(frame_dir) + &quot;/&quot; + str(i) + &quot;.png&quot;)
          print(&quot;6&quot;)
          width, height = frame.size
          index = 0
          print(&quot;7&quot;)
          for row in range(height):
              print(&quot;8&quot;)
              for col in range(width):
                  print(&quot;10&quot;)
                  try:
                      print(&quot;9&quot;)
                      r, g, b = frame.getpixel((col, row))
                      print(&quot;11&quot;)
                  except ValueError:
                      print(&quot;12&quot;)
                      # for some ong a(transparancy) is needed
                      r, g, b, a = frame.getpixel((col, row))
                      print(&quot;13&quot;)
                  print(&quot;aa&quot;)
                  if row == 0 and col == 0 :
                      print(&quot;14&quot;)
                      length = r
                      print(&quot;15&quot;)
                  elif index &lt;= length:
                      # put the decrypted character into string
                      print(&quot;tt&quot;)
                      msg += caesar_ascii(chr(r), &quot;dec&quot;, caesarn)
                  print(&quot;18&quot;)
                  index += 1
              print(&quot;cc&quot;)
      #remove the first and the last quote
      msg = msg[1:-1]
      print(&quot;17&quot;)
      recovered_txt = open(&quot;data/recovered-text.txt&quot;, &quot;w&quot;)
      print(&quot;19&quot;)
      recovered_txt.write(str(msg.encode().decode('string_escape')))
      print(&quot;20&quot;)
  </code></pre>
  <p>here is the output</p>
  <pre class="lang-none prettyprint-override"><code>9
  11
  aa
  18
  10
  9
  11
  aa
  18
  10
  9
  11
  aa
  18
  10
  9
  11
  aa
  18
  10
  9
  11
  aa
  18
  10
  9
  11
  aa
  18
  10
  9
  11
  aa
  18
  10
  9
  11
  aa
  18
  cc
  17
  19
  Traceback (most recent call last):
    File &quot;C:/Users/HP/Aniss/PycharmProjects/Caesar-Cipher-Video-Steganography-master/main.py&quot;, line 103, in &lt;module&gt;
      decode_frame(&quot;temp&quot;, caesarn)
    File &quot;C:\Users\HP\Aniss\PycharmProjects\Caesar-Cipher-Video-Steganography-master\functions.py&quot;, line 166, in decode_frame
      recovered_txt.write(str(msg.encode().decode('string_escape')))
  LookupError: unknown encoding: string_escape
  
  Process finished with exit code 1
  </code></pre>