diff options
author | Erlend E. Aasland <erlend.aasland@protonmail.com> | 2022-08-31 05:54:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-31 05:54:54 (GMT) |
commit | f7e7bf161aaec5a5cffdcec7c97e1f09e445421b (patch) | |
tree | e9d339cca5899de4dd2fed407baad75af2631d96 /Doc/includes/sqlite3/blob.py | |
parent | 8ba22b90cafdf83d26318905a021311c6932d2c0 (diff) | |
download | cpython-f7e7bf161aaec5a5cffdcec7c97e1f09e445421b.zip cpython-f7e7bf161aaec5a5cffdcec7c97e1f09e445421b.tar.gz cpython-f7e7bf161aaec5a5cffdcec7c97e1f09e445421b.tar.bz2 |
gh-96414: Inline code examples in sqlite3 docs (#96442)
Diffstat (limited to 'Doc/includes/sqlite3/blob.py')
-rw-r--r-- | Doc/includes/sqlite3/blob.py | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/Doc/includes/sqlite3/blob.py b/Doc/includes/sqlite3/blob.py deleted file mode 100644 index ff58d6c..0000000 --- a/Doc/includes/sqlite3/blob.py +++ /dev/null @@ -1,19 +0,0 @@ -import sqlite3 - -con = sqlite3.connect(":memory:") -con.execute("create table test(blob_col blob)") -con.execute("insert into test(blob_col) values (zeroblob(13))") - -# Write to our blob, using two write operations: -with con.blobopen("test", "blob_col", 1) as blob: - blob.write(b"hello, ") - blob.write(b"world.") - # Modify the first and last bytes of our blob - blob[0] = ord("H") - blob[-1] = ord("!") - -# Read the contents of our blob -with con.blobopen("test", "blob_col", 1) as blob: - greeting = blob.read() - -print(greeting) # outputs "b'Hello, world!'" |