mirror of
https://github.com/KUlishevgeniy/c22712.git
synced 2026-09-24 08:00:22 +00:00
11 lines
406 B
Python
11 lines
406 B
Python
import psycopg2
|
|
|
|
def getcont2():
|
|
connection = psycopg2.connect(host='localhost', dbname='dbdata', user='postgres', password='Q1w2e3r4')
|
|
cursor = connection.cursor()
|
|
cursor.execute("SELECT product, price, diagonal, resolution, cpu, ram, graphics_controller, volume, src FROM laptops")
|
|
fetched = cursor.fetchall()
|
|
return fetched
|
|
cursor.close()
|
|
connection.close()
|
|
print(getcont2()) |