input: Write a function to re-write a given SQL query in Python. The function should take the SQL query as a string and return a Python code snippet that performs the same operation. If the input query is "SELECT * FROM Movies WHERE category = 'horror';", the function should return the corresponding Python code for executing the query and printing the result.
  
  assert re_write_sql_python("SELECT * FROM Movies WHERE category = 'horror';") == """import sqlite3
  
  conn = sqlite3.connect('movies.db') 
  cursor = conn.cursor()
  
  cursor.execute("SELECT * FROM Movies WHERE category = 'horror'")
  
  result = cursor.fetchall()
  for row in result:
      print(row)
  
  conn.close()"""
  assert re_write_sql_python("SELECT name, year FROM Movies WHERE rating > 8;") == """import sqlite3
  
  conn = sqlite3.connect('movies.db') 
  cursor = conn.cursor()
  
  cursor.execute("SELECT name, year FROM Movies WHERE rating > 8")
  
  result = cursor.fetchall()
  for row in result:
      print(row)
  
  conn.close()"""
  assert re_write_sql_python("") == None
output: def re_write_sql_python(sql_query):
      if not sql_query:
          return None
      return f"""import sqlite3
  
  conn = sqlite3.connect('movies.db') 
  cursor = conn.cursor()
  
  cursor.execute("{sql_query}")
  
  result = cursor.fetchall()
  for row in result:
      print(row)
  
  conn.close()"""