Prisons.py myMain.py更新

在Prisons.py中
Read file func下新增方法:

# 检查数据是否已经被读取过
def isUsed():
        # 检查'监所'位置是否被找到
        if Read_File_PrisonsPositionRow == 0 and Read_File_PrisonsPositionCol == 0:
                raise Exception('未找到"监所"位置.')
        if getCellValue(Read_File_PrisonsPositionRow - 1, Read_File_PrisonsPositionCol) == '已读取':
                print('该数据已统计.请勿重复统计')
                return True
        else:
                return False


def writePrisonsUsedFlag():
        writeReadFileValue(Read_File_PrisonsPositionRow - 1, Read_File_PrisonsPositionCol, '已读取')

以下为MyMain.py代码:

from Prisons import *

def main():
        print('Main is running')
        # getAllPrisonsElementList()
        # showPrisonsElementList()
        # writeValue('每日', 0, 3, '541打野')
        # getTimeValue()
        # a,b = getWriteFileRowRange()
        # print('%d %d'%(a,b))
        # print('坐标 Row: %d  Col: %d 的值为 %s'%(0 + 1, 3 + 1, getWriteFileCellValue(0,3)))
        # print('坐标 Row: %d  Col: %d 的值为 %s' % (1 + 1, 3 + 1, getWriteFileCellValue(1, 3)))
        getAllPrisonsElementList()
        if not isUsed():
                writePrisonsUsedFlag()
          		       for element in PrisonsElementList:
                        analysisPrisonsElement(element)

if __name__ == '__main__':
        main()
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值