Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import psycopg2
- f = open("videos.txt")
- conn = psycopg2.connect(dbname='netflix', user='redtech',
- password='red_tech', host='localhost')
- c = conn.cursor()
- for line in f:
- address, name, id = line.split(";")
- name = name.strip("\n")
- id = int(id)
- print(address, id)
- try:
- cursor.execute("update movie_videos set path = %s where movie_id = %s;", [address, id])
- except:
- print("SUKAAAA")
- c.close()
- conn.commit()
- conn.close()
Advertisement
Add Comment
Please, Sign In to add comment