\( \newcommand{\​conc}{\mathbin{\|}} \) Skip to content
  • Privacy Policy
「 ishygddt.xyz/~blog/ 」
  • Privacy Policy
「 ishygddt.xyz/~blog/ 」

Tag: sqlite

Python: Using "with" with sqlite3 cursor

March 12, 2021March 21, 2021

If you like the assurance that Python's with statement provides, but can't figure out how to properly apply it to individual cursor objects, here's how to do that: import sqlite3 from contextlib import closing con = sqlite3.connect('example.db') with con, closing(con.cursor()) as cur: cur.execute(…)

Posted in [DRAFT]  •  No Comments on Python: Using "with" with sqlite3 cursor

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Referral Links 💵

  • VPS ($5/mo 2-core, 2GB RAM, 80GB SSD)
  • Cheap Chinese Electronics
  • Custom Bankcard Covers
  • Disposable Virtual Debit Cards
  • Brokerage

Recent Posts

  • [DRAFT] Data structure simple hex grid for Catan
  • tk.messagebox is ugly on Linux
  • Outlook Web Access S/MIME user installation
  • Using "pip" behind a corporate firewall
  • Can't install Twine on PyPy due to nh3 "Rust" problem

Recent Comments

  • Rocky Linux 9 & HP Elitebook 8470p: Wi-Fi problems reconciled – 「 ishygddt.xyz/~blog/ 」 on Rocky Linux 9 & HP Elitebook 8470p: GPU problems irreconciled
  • Rocky Linux 9 & HP Elitebook 8470p: GPU problems irreconciled – 「 ishygddt.xyz/~blog/ 」 on Rocky Linux 9 & HP Elitebook 8470p: Wi-Fi problems reconciled
  • Author on the real frozendict was the standard library we neglected along the way
  • Author on A very tiny bitmap font
  • Author on X25519 original specification

Archives

  • August 2024
  • April 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • January 2023
  • October 2022
  • July 2022
  • June 2022
  • May 2022
  • March 2022
  • February 2022
  • January 2022
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • August 2020
  • July 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • October 2019
  • August 2019

Categories

  • [DRAFT]
  • How-To
  • OC
  • Transcripts
  • Uncategorized
  • Writeups

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Copyright © 2025 「 ishygddt.xyz/~blog/ 」 — powered by Suki