小编h4u*_*t3r的帖子

Python 2.4.4不间断类型错误

我使用python 2.4.4并且由于某种原因它在我尝试打开日志文件进行写入时不断抛出类型错误...这是有问题的函数...

import os
def write(inlog, outlog):
  # parse the logs and save them to our own...
  parsed = NTttcpParse(inlog)
  debug("PARSED")
  debug(parsed)
  if os.path.exists(outlog):
    fh = os.open(outlog, os.O_WRONLY | os.O_APPEND)
    debug("Opened '%s' for writing (%d)" % (outlog, fh))
  else:
    fh = os.open(outlog, os.O_WRONLY | os.O_CREAT)
    debug("Created '%s' for writing (%d)" % (outlog, fh))
  debug("type(fh) = %s" % type(fh))
  os.write(fh, LOGFORMAT % parsed)
  os.close(fh)
Run Code Online (Sandbox Code Playgroud)

这是令人抓狂的错误......

TypeError: int argument required
Run Code Online (Sandbox Code Playgroud)

请帮助......并提前感谢:P

python typeerror

0
推荐指数
1
解决办法
112
查看次数

标签 统计

python ×1

typeerror ×1