推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
alittlewhite
V2EX  ›  Python

关于 pyhton3X 的 sqlite 模块的问题,急求解答!!

  •  
  •   alittlewhite · Aug 13, 2016 · 3115 views
    This topic created in 3694 days ago, the information mentioned may be changed or developed.
    >>>import sqlite3
    >>>conn = sqlite3.connect('D:/my data space/python/data_space')
    >>>cur = conn.cursor()
    >>>cur.execute("select * from athletes")
    <sqlite3.Cursor object at 0x0000023AA9A6A260>
    >>> cur.fetchall()
    [(1, 'milo', 1978)]
    >>> cur.scroll(0,'absolute')
    Traceback (most recent call last):
    File "<pyshell#5>", line 1, in <module>
    cur.scroll(0,'absolute')
    AttributeError: 'sqlite3.Cursor' object has no attribute 'scroll'


    这个出错是什么鬼,难道没有 scroll 函数???纠结
    6 replies  •  2016-08-14 14:35:31 +08:00
    neoblackcap
        1
    neoblackcap  
       Aug 13, 2016
    为什么不看文档?
    alittlewhite
        2
    alittlewhite  
    OP
       Aug 13, 2016 via Android
    @neoblackcap 我找不到解决方法
    hosiet
        3
    hosiet  
       Aug 13, 2016 via Android
    文档里根本没写 scroll 嘛,再说这本身就是 DB-API 2.0 的扩展,实现不实现是作者说了算
    alittlewhite
        4
    alittlewhite  
    OP
       Aug 13, 2016 via Android
    @hosiet 额额。我用的是 python3.5 自带的 sqlite3 模块。发现根本没有 scroll 。如果我想用这个滚动游标的功能怎么办?
    hosiet
        5
    hosiet  
       Aug 13, 2016 via Android
    所以如果模块作者没实现的话就没办法了,这功能就不要用了吧
    huntzhan
        6
    huntzhan  
       Aug 14, 2016
    pyhton3X, should be Python 3.x
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   956 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:45 · PVG 06:45 · LAX 15:45 · JFK 18:45
    ♥ Do have faith in what you're doing.