title: SyntaxError: invalid syntax Python
body: <p>I have a python script. This is only my conversion to my shell script, Sorry Im just newbie for this language. the error is:</p>
  
  <pre><code>  File "chkrpm.py", line 19
      if(rc != 0):
      ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>I don't know whats wrong. This is my shell script</p>
  
  <pre><code>retval=0
  for i in $(cat /var/tools/tools/newrpms.txt)
  do
          ls /var/patchbundle/rpms/ | grep $i
          if [ $? != 0 ]
          then
                  echo "$i NOT FOUND!"
                  retval=255
          fi
  done
  exit $retval
  </code></pre>
  
  <p>And this is my python conversion. Just focus on the error side. </p>
  
  <pre><code>import package, sys, os, subprocess
  
  path = '/var/tools/tools/newrpms.txt'
  
  newrpms = open(path, "w")
  fds = newrpms.readline()
  newrpms.close
  
  
  def checkrc(rc):
                  if(rc != 0):
                          sys.exit(rc)
  cmd = package.Errata()
  retval=0
  
  
  for i in newrpms:
          rc = cmd.execute("ls /var/patchbundle/rpms/ | grep %newrpms ")
                  if(rc != 0):
                      cmd.logprint ("%s not found !" % i)
                      retval = 255
  
  checkrc(rc)
  </code></pre>
  
  <p>Whats wrong in my code. That's it fit like my bash script?</p>
  
  <p>When I tried to follow all the suggestion below error found:</p>
  
  <pre><code> File "chkrpm.py", line 19
      echo("%s not found !" % i)
      ^
  SyntaxError: invalid syntax
  </code></pre>