-
-
Save Kidinnu/3503edd9ce279929b6ffa207e563cd7c to your computer and use it in GitHub Desktop.
Google Colab + Google Drive + SQLite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Этот код необходимо выполнить для разрешения доступа Google Colab к диску Google Drive, | |
# на котором будет храниться файл базы данных | |
# Разрешение нужно выдавать повторно спустя каждые 12 часов (это особенность работы Google Colab) | |
from google.colab import drive | |
drive.mount('/content/drive') | |
import sqlite3 | |
path = "./drive/My Drive/mydatabase.db" | |
conn = sqlite3.connect(path) | |
cursor = conn.cursor() | |
# Работа с БД | |
# ... | |
# ... | |
cursor.close() | |
conn.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment