Skip to Main Content
Python Rusz głową! Wydanie II
book

Python Rusz głową! Wydanie II

by Paul Barry
November 2017
Intermediate to advanced content levelIntermediate to advanced
578 pages
23h 17m
Polish
Helion
Content preview from Python Rusz głową! Wydanie II
jesteś tutaj
341
Protokół zarządzania kontekstem
Zainicjalizuj klasę przy użyciu konfiguracji bazy danych
Przypomnijmy sobie, jak mamy zamiar używać menedżera kontekstu
UseDatabase
. Oto kod
z
rozdziału 7.
napisany w taki sposób, aby wykorzystywał instrukcję
with
, korzystającą z kolei
z menedżera kontekstu
UseDatabase
, który niebawem opracujesz.
from DBcm import UseDatabase
dbconfig = { ‘host’: ‘127.0.0.1’,
‘user’: ‘vsearch’,
‘password’: ‘vsearchpasswd’,
‘database’: ‘vsearchlogDB’, }
with UseDatabase(dbconfig) as cursor:
_SQL = ”””insert into log
(phrase, letters, ip, browser_string, results)
values
(%s, %s, %s, %s, %s)””” ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python. Receptury. Wydanie III

Python. Receptury. Wydanie III

David Beazley, Brian K. Jones
Python. Programuj szybko i wydajnie

Python. Programuj szybko i wydajnie

Micha Gorelick, Ian Ozsvald

Publisher Resources

ISBN: 9788328337343