input: Write a function to convert an SQL query into a Python code snippet using SQLite. The function should accept the SQL query as a string and return the Python code as a string. If the input is empty, the function should return an empty string.
  assert sql_to_python("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()'
  assert sql_to_python("")==""
  assert sql_to_python("DELETE FROM Movies WHERE rating < 5")=='import sqlite3\\n\\nconn = sqlite3.connect(\\'movies.db\\')\\ncursor = conn.cursor()\\n\\ncursor.execute(\\"DELETE FROM Movies WHERE rating < 5\\")\\n\\nconn.commit()\\nconn.close()'
output: def sql_to_python(sql_query):
      if not sql_query:
          return ""
      if "SELECT" in 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()"
      else:
          return f"import sqlite3\n\nconn = sqlite3.connect('movies.db')\ncursor = conn.cursor()\n\ncursor.execute(\"{sql_query}\")\n\nconn.commit()\nconn.close()"