小编Jak*_*łos的帖子

Python 3 - ValueError:没有足够的值来解包(预期 3,得到 2)

我的 Python 3 程序有问题。我使用 Mac OS X。此代码运行正常。

# -*- coding: utf-8 -*-
#! python3
# sendDuesReminders.py - Sends emails based on payment status in spreadsheet.

import openpyxl, smtplib, sys


# Open the spreadsheet and get the latest dues status.
wb = openpyxl.load_workbook('duesRecords.xlsx')
sheet = wb.get_sheet_by_name('Sheet1')

lastCol = sheet.max_column
latestMonth = sheet.cell(row=1, column=lastCol).value

# Check each member's payment status.
unpaidMembers = {}
for r in range(2, sheet.max_row + 1):
payment = sheet.cell(row=r, column=lastCol).value
if payment != 'zaplacone':
    name = sheet.cell(row=r, column=2).value …
Run Code Online (Sandbox Code Playgroud)

python python-3.x

13
推荐指数
3
解决办法
17万
查看次数

标签 统计

python ×1

python-3.x ×1