diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..5c80254 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "[python]": { + "editor.defaultFormatter": "ms-python.autopep8" + }, + "python.formatting.provider": "none" +} diff --git a/app.py b/app.py index 43d35e8..18f1e43 100644 --- a/app.py +++ b/app.py @@ -7,6 +7,20 @@ app = Flask(__name__) def hello_world(): # put application's code here return 'Hello World!' +@app.route('/create_game') +def create(str truechatid): + + + + + +@app.route('/start_game') +def start(): # Команда принимает на вход + + +@app.route('/action') +def action(): + if __name__ == '__main__': app.run() \ No newline at end of file diff --git a/db.py b/db.py new file mode 100644 index 0000000..ad26ec7 --- /dev/null +++ b/db.py @@ -0,0 +1,28 @@ +import psycopg2 + + +db_params = { + 'host': '51.250.68.42', + 'database': 'test', + 'user': 'curator', + 'password': '4oumQk' +} + + +try: + connection = psycopg2.connect(**db_params) + cursor = connection.cursor() + + # Ваш код выполнения запросов + + cursor.execute("SELECT * FROM chats") + rows = cursor.fetchall() + + for row in rows: + print(row) + + cursor.close() + connection.close() + +except Exception as e: + print("Ошибка:", e) \ No newline at end of file