推荐学习书目
› 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
touch
V2EX  ›  Python

请教个 python mysqldb commit()的问题

  •  
  •   touch · Apr 10, 2014 · 7365 views
    This topic created in 4558 days ago, the information mentioned may be changed or developed.
    mysql是不是插入数据的时候都要commit()。有其他方法吗?
    5 replies  •  1970-01-01 08:00:00 +08:00
    binux
        1
    binux  
       Apr 10, 2014
    db.autocommit = True
    touch
        2
    touch  
    OP
       Apr 10, 2014
    @binux 尝试了一下。依旧只是在当前会话中。并没有提交到数据库中
    casparchen
        3
    casparchen  
       Apr 10, 2014 via iPad
    注意会话的作用域
    jedywu
        4
    jedywu  
       Apr 10, 2014
    应该是db.autocommit(True)
    touch
        5
    touch  
    OP
       Apr 10, 2014
    感谢各位,学习了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   768 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 21:25 · PVG 05:25 · LAX 14:25 · JFK 17:25
    ♥ Do have faith in what you're doing.