I add command /admin /vadmin /iadmin /hello I create database and I improve code
It's version 0.3.0
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import sqlite3
|
||||
import os
|
||||
|
||||
DIR = "/Users/mac/myfirstprogramm/storage/message.db"
|
||||
if __name__ == "__main__":
|
||||
db = sqlite3.connect(DIR)
|
||||
|
||||
cursor = db.cursor()
|
||||
|
||||
# cursor.execute("""CREATE TABLE message (
|
||||
# chat_id integer,
|
||||
# message_id integer
|
||||
# )""")
|
||||
# db.commit()
|
||||
|
||||
cursor.execute("SELECT * FROM message")
|
||||
print(cursor.fetchone())
|
||||
|
||||
db.close()
|
||||
|
||||
|
||||
|
||||
def get_db():
|
||||
return sqlite3.connect(DIR)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user