Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e04d256c
Kaydet (Commit)
e04d256c
authored
Tem 03, 2011
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
reST indentation fix in sqlite3 docs. rst uses 3 space indentation.
üst
7c20ad32
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
36 deletions
+37
-36
sqlite3.rst
Doc/library/sqlite3.rst
+37
-36
No files found.
Doc/library/sqlite3.rst
Dosyayı görüntüle @
e04d256c
...
@@ -604,42 +604,42 @@ Row Objects
...
@@ -604,42 +604,42 @@ Row Objects
Let's assume we initialize a table as in the example given above::
Let's assume we initialize a table as in the example given above::
conn = sqlite3.connect(":memory:")
conn = sqlite3.connect(":memory:")
c = conn.cursor()
c = conn.cursor()
c.execute('''create table stocks
c.execute('''create table stocks
(date text, trans text, symbol text,
(date text, trans text, symbol text,
qty real, price real)''')
qty real, price real)''')
c.execute("""insert into stocks
c.execute("""insert into stocks
values ('2006-01-05','BUY','RHAT',100,35.14)""")
values ('2006-01-05','BUY','RHAT',100,35.14)""")
conn.commit()
conn.commit()
c.close()
c.close()
Now we plug :class:`Row` in::
Now we plug :class:`Row` in::
>>> conn.row_factory = sqlite3.Row
>>> conn.row_factory = sqlite3.Row
>>> c = conn.cursor()
>>> c = conn.cursor()
>>> c.execute('select * from stocks')
>>> c.execute('select * from stocks')
<sqlite3.Cursor object at 0x7f4e7dd8fa80>
<sqlite3.Cursor object at 0x7f4e7dd8fa80>
>>> r = c.fetchone()
>>> r = c.fetchone()
>>> type(r)
>>> type(r)
<type 'sqlite3.Row'>
<type 'sqlite3.Row'>
>>> r
>>> r
(u'2006-01-05', u'BUY', u'RHAT', 100.0, 35.14)
(u'2006-01-05', u'BUY', u'RHAT', 100.0, 35.14)
>>> len(r)
>>> len(r)
5
5
>>> r[2]
>>> r[2]
u'RHAT'
u'RHAT'
>>> r.keys()
>>> r.keys()
['date', 'trans', 'symbol', 'qty', 'price']
['date', 'trans', 'symbol', 'qty', 'price']
>>> r['qty']
>>> r['qty']
100.0
100.0
>>> for member in r: print member
>>> for member in r: print member
...
...
2006-01-05
2006-01-05
BUY
BUY
RHAT
RHAT
100.0
100.0
35.14
35.14
.. _sqlite3-types:
.. _sqlite3-types:
...
@@ -901,7 +901,8 @@ only makes sense to call from a different thread.
...
@@ -901,7 +901,8 @@ only makes sense to call from a different thread.
.. rubric:: Footnotes
.. rubric:: Footnotes
.. [#f1] The sqlite3 module is not built with loadable extension support by
.. [#f1] The sqlite3 module is not built with loadable extension support by
default, because some platforms (notably Mac OS X) have SQLite libraries which
default, because some platforms (notably Mac OS X) have SQLite libraries
are compiled without this feature. To get loadable extension support, you must
which are compiled without this feature. To get loadable extension support,
modify setup.py and remove the line that sets SQLITE_OMIT_LOAD_EXTENSION.
you must modify setup.py and remove the line that sets
SQLITE_OMIT_LOAD_EXTENSION.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment