一旦我执行它就会卡住.getOne()
:
from sqlobject import *
import threading
sqlhub.processConnection = connectionForURI('mysql://user:password@localhost:3306/database')
class Player(SQLObject):
name = StringCol(length=64)
last_login = DateTimeCol()
create_date = DateTimeCol(default=DateTimeCol.now)
def act():
result = Player.selectBy(name='Zippo')
player = result.getOne()
print 'You will never see this message in console.'
threading.Thread(target=act).start()