我正在尝试仅打印来自给定货币的高影响力新闻。当我在workbook = xlrd.open_workbook(file)
sheet = workbook.sheet_by_index(0)
sheet.nrows[0:4] #I want to know the number of rows within that range, or "A{}:D{}"
语句中包含条件worsedata == True
时,代码将不打印任何内容。当我仅在if
语句中加入有条件的货币时,无论影响强度如何,它都会打印所有美元新闻。
if