Use is None
instead of == None
This commit is contained in:
parent
9c3ed9dd2a
commit
6f97554195
@ -46,7 +46,7 @@ for folder in os.listdir():
|
||||
for line in lines:
|
||||
if not started:
|
||||
# We are interested in the content after this line:
|
||||
if soldeCrediteurAuRegex.match(line) != None or (line.startswith('Date Nature des opérations Valeur Débit Crédit') and not firstPage):
|
||||
if soldeCrediteurAuRegex.match(line) is not None or (line.startswith('Date Nature des opérations Valeur Débit Crédit') and not firstPage):
|
||||
if soldeCrediteurAuRegex.match(line):
|
||||
initialAmount = float(soldeCrediteurAuRegex.sub('', line).replace(',', '.').replace(' ', ''))
|
||||
currentAmount = initialAmount
|
||||
@ -56,15 +56,15 @@ for folder in os.listdir():
|
||||
continue
|
||||
else:
|
||||
# We aren't interested in the content after this line:
|
||||
if line.startswith('BNP PARIBAS SA au capital de') or endPageAfterTheFirstOneRegex.match(line) != None:
|
||||
if line.startswith('BNP PARIBAS SA au capital de') or endPageAfterTheFirstOneRegex.match(line) is not None:
|
||||
firstPage = False
|
||||
started = False
|
||||
continue
|
||||
# We aren't interested in the content after this line
|
||||
elif line.startswith('TOTAL DES OPERATIONS'):
|
||||
break
|
||||
if firstLineOfPaymentRegex.match(line) != None:
|
||||
if date != None:
|
||||
if firstLineOfPaymentRegex.match(line) is not None:
|
||||
if date is not None:
|
||||
print(date, valeur, amount, currentAmount)
|
||||
print('\n'.join(comment))
|
||||
print()
|
||||
|
Loading…
Reference in New Issue
Block a user