擅长:python、mysql、java
<p>您的问题与您发布的第一个问题完全相同,解决方案应与从同一问题中选择的答案相同。</p>
<p>函数<code>sessionmaker</code>返回一个<strong>类,绑定在<code>bind</code>参数中传递的引擎。</p>
<p>因此,在创建类之后,必须实例化它(还没有实例化):</p>
<pre><code>Session = sessionmaker(bind=engine)
# Session is a class
session = Session()
# now session is a instance of the class Session
session.execute(...)
</code></pre>