create_db.py 905 B

1234567891011121314151617181920212223242526272829303132
  1. import sqlite3
  2. db = sqlite3.connect('Account.db')
  3. cur = db.cursor()
  4. # Создаем таблицу
  5. cur.execute("""CREATE TABLE IF NOT EXISTS Account (
  6. ID INTEGER PRIMARY KEY,
  7. PHONE TEXT,
  8. PASS TEXT,
  9. API_ID TEXT,
  10. API_HASH TEXT,
  11. ACTIVITY TEXT,
  12. LITECOIN TEXT
  13. )""")
  14. db.commit()
  15. Phone = "+88005553535"
  16. password = "13236546460"
  17. Api_id = "1488"
  18. Api_hash = "05xxxxxxx45xxxxxxx435xxxxx435xxxxxxx9"
  19. Activity = "ON"
  20. Litecoin = "ltc1qlhs4e459wwtu8sx7a4rtumtffs9lr4ktmfl6ny"
  21. cur.execute(f"SELECT PHONE FROM Account WHERE PHONE = '{Phone}'")
  22. if cur.fetchone() is None:
  23. cur.execute("""INSERT INTO Account(PHONE, PASS, API_ID, API_HASH, ACTIVITY, LITECOIN) VALUES (?,?,?,?,?,?);""", (Phone, password, Api_id, Api_hash, Activity, Litecoin))
  24. db.commit()
  25. print("Зарегистрированно!")
  26. for value in cur.execute("SELECT * FROM Account"):
  27. print(value)