import mysql.connector as sql import pandas as pd yhendus=sql.connect(host='localhost', database='mart', user='mart', password='ajutine1234') df=pd.read_sql("SELECT film_type_id, title FROM efis_film_type_translation WHERE language='et'", yhendus) print(",".join(df.title.values)) #python3.5 2.py > filmityybid.txt