input: Write a function to re-write a given SQL query in Python. The function should take a string representing the SQL query as input and return the equivalent Python code that executes the query and prints the results. The database is assumed to be named 'movies.db'.
  assert rewrite_sql("SELECT * FROM Movies WHERE category = 'horror'")=="import sqlite3\n\nconn = sqlite3.connect('movies.db')\ncursor = conn.cursor()\n\ncursor.execute(\"SELECT * FROM Movies WHERE category = 'horror'\")\n\nresult = cursor.fetchall()\nfor row in result:\n    print(row)\n\nconn.close()\n"
output: def rewrite_sql(sql_query):
      return f"import sqlite3\n\nconn = sqlite3.connect('movies.db')\ncursor = conn.cursor()\n\ncursor.execute(\"{sql_query}\")\n\nresult = cursor.fetchall()\nfor row in result:\n    print(row)\n\nconn.close()\n"