小编jcm*_*ald的帖子

Python 2.7 Openpyxl用户警告

为什么每次运行代码时都收到此警告消息?(下面)。有可能摆脱它吗?如果是这样,我该怎么做?

我的代码:

from openpyxl import load_workbook
from openpyxl import Workbook

wb = load_workbook('NFL.xlsx', data_only = True)
ws = wb.active
sh = wb["Sheet1"]


ptsDiff = (sh['J127'].value)
print ptsDiff
Run Code Online (Sandbox Code Playgroud)

该代码有效,但我收到此警告消息:

Warning (from warnings module):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/openpyxl/reader/worksheet.py", line 320
warn(msg)
UserWarning: Unknown extension is not supported and will be removed
Run Code Online (Sandbox Code Playgroud)

python warnings user-warning python-2.7 openpyxl

6
推荐指数
1
解决办法
2万
查看次数

将超过255个参数传递给函数

我只是将论据从一个def语句传递到def另一个语句。我不知道您可以传递的参数数量没有限制。我假设参数是变量。我需要能够传递超过255个参数。有人可以用外行术语帮助我如何解决“超过255个参数”。谢谢!

码:

def a():
  "Things happening"
  variable1
  b(variable1)

def b(variable1):
  "Things happening"
  variable2
  c(variable1, variable2)

def c(variable1, variable2):
  "Things happening"
  variable3
  d(variable1, variable2, variable3)
.
.
.
def z5(variable1,...variable256):
  print result

main()
Run Code Online (Sandbox Code Playgroud)

python variables arguments function

1
推荐指数
2
解决办法
5322
查看次数