V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2016-08-13 17:53:07 +08:00 · 2342 次点击
    这是一个创建于 2818 天前的主题,其中的信息可能已经有所发展或是发生改变。
    >>>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 条回复    2016-08-14 14:35:31 +08:00
    neoblackcap
        1
    neoblackcap  
       2016-08-13 18:00:47 +08:00
    为什么不看文档?
    alittlewhite
        2
    alittlewhite  
    OP
       2016-08-13 18:04:11 +08:00 via Android
    @neoblackcap 我找不到解决方法
    hosiet
        3
    hosiet  
       2016-08-13 18:08:52 +08:00 via Android
    文档里根本没写 scroll 嘛,再说这本身就是 DB-API 2.0 的扩展,实现不实现是作者说了算
    alittlewhite
        4
    alittlewhite  
    OP
       2016-08-13 18:17:11 +08:00 via Android
    @hosiet 额额。我用的是 python3.5 自带的 sqlite3 模块。发现根本没有 scroll 。如果我想用这个滚动游标的功能怎么办?
    hosiet
        5
    hosiet  
       2016-08-13 18:22:05 +08:00 via Android
    所以如果模块作者没实现的话就没办法了,这功能就不要用了吧
    huntzhan
        6
    huntzhan  
       2016-08-14 14:35:31 +08:00
    pyhton3X, should be Python 3.x
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2261 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 09:04 · PVG 17:04 · LAX 02:04 · JFK 05:04
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.