相关疑难解决方法(0)

Python函数告诉我,当我只发送一个时,我发送了两个参数

我正在使用Google的webapp框架.

我在下面尝试做的只是将query.fetch的结果发送到一个函数,该函数将获取结果并使用它们创建一个表.

class Utilities(): 
  def create_table(results): 
  #Create a table for the results....
Run Code Online (Sandbox Code Playgroud)

变量results从query.fetch返回两个结果

results = query.fetch(10) #This returns two results
util = Utilities()
util.create_table(results)
Run Code Online (Sandbox Code Playgroud)

然后我得到了错误

util.create_table(results)TypeError:create_table()只取1个参数(给定2个)

我以为results会自动通过引用传递.我错了吗?

python google-app-engine

3
推荐指数
1
解决办法
269
查看次数

标签 统计

google-app-engine ×1

python ×1