input: Write a function to translate an SQL query into Python code for interacting with a SQLite database. The function should take a string SQL query as input and return the result of executing that query using the sqlite3 Python library. If the query is successful, print each row of the result. If the connection to the database fails, return an error message indicating the failure.
  
  def translate_sql_to_python(sql_query):
      import sqlite3
      try:
          conn = sqlite3.connect('movies.db')
          cursor = conn.cursor()
          cursor.execute(sql_query)
          result = cursor.fetchall()
          for row in result:
              print(row)
          conn.close()
      except sqlite3.Error as e:
          return f"Connection failed: {e}"
  
  assert translate_sql_to_python("SELECT * FROM Movies WHERE category = 'horror'") is not None
  assert translate_sql_to_python("SELECT * FROM NonExistentTable") == "Connection failed: table NonExistentTable does not exist"
output: def translate_sql_to_python(sql_query):
      import sqlite3
      try:
          conn = sqlite3.connect('movies.db')
          cursor = conn.cursor()
          cursor.execute(sql_query)
          result = cursor.fetchall()
          for row in result:
              print(row)
          conn.close()
      except sqlite3.Error as e:
          return f"Connection failed: {e}"