input: Write a function to convert a given SQL query to its equivalent Python code using SQLite. The function should take the SQL query as a string input and return the Python code as a string. If the input string is not a valid SQL query, the function should return 'Invalid SQL query'.
  assert sql_to_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 sql_to_python("SELECT name, year FROM Movies WHERE rating > 7.5;") == '''import sqlite3
  
  conn = sqlite3.connect('movies.db') 
  cursor = conn.cursor()
  
  cursor.execute("SELECT name, year FROM Movies WHERE rating > 7.5")
  
  result = cursor.fetchall()
  for row in result:
      print(row)
  
  conn.close()'''
  assert sql_to_python("UPDATE Movies SET category = 'thriller' WHERE name = 'Inception';") == 'Invalid SQL query'
  assert sql_to_python("INSERT INTO Movies VALUES ('It', 'horror', 2017, 7.3);") == 'Invalid SQL query'
  assert sql_to_python("") == 'Invalid SQL query'
output: def sql_to_python(sql_query):
      if not sql_query or not sql_query.strip().upper().startswith("SELECT"):
          return 'Invalid SQL query'
      
      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()'''