#!/bin/python

import glob
import os
import shutil
import json
import re
import math
try:
    os.mkdir('./processed/')
except OSError:
    print("processed directory already exists")

#Get a list of receipts
#receipts = glob.glob('./new/receipt-[0-9]*.json')
receipts = [f for f in glob.iglob('./new/receipt-[0-9]*.json')
    if re.match('./new/receipt-[0-9]*[02468].json', f)]
subtotal = 0.0

for path in receipts:
    with open(path) as f:
        content = json.load(f)
        subtotal += float(content['value'])
    destination = path.replace('new', 'processed')
    shutil.move(path, destination)
    print("moved %s to %s " % (path, destination))

print('Receipt subtotal: %s' % round(subtotal, 2))

c1b71c45cdb22526587563510aa629a957ff7317
<mask token>

<mask token>
try:
    os.mkdir('./processed/')
except OSError:
    print('processed directory already exists')
<mask token>
for path in receipts:
    with open(path) as f:
        content = json.load(f)
        subtotal += float(content['value'])
    destination = path.replace('new', 'processed')
    shutil.move(path, destination)
    print('moved %s to %s ' % (path, destination))
print('Receipt subtotal: %s' % round(subtotal, 2))

<mask token>
try:
    os.mkdir('./processed/')
except OSError:
    print('processed directory already exists')
receipts = [f for f in glob.iglob('./new/receipt-[0-9]*.json') if re.match(
    './new/receipt-[0-9]*[02468].json', f)]
subtotal = 0.0
for path in receipts:
    with open(path) as f:
        content = json.load(f)
        subtotal += float(content['value'])
    destination = path.replace('new', 'processed')
    shutil.move(path, destination)
    print('moved %s to %s ' % (path, destination))
print('Receipt subtotal: %s' % round(subtotal, 2))

import glob
import os
import shutil
import json
import re
import math
try:
    os.mkdir('./processed/')
except OSError:
    print('processed directory already exists')
receipts = [f for f in glob.iglob('./new/receipt-[0-9]*.json') if re.match(
    './new/receipt-[0-9]*[02468].json', f)]
subtotal = 0.0
for path in receipts:
    with open(path) as f:
        content = json.load(f)
        subtotal += float(content['value'])
    destination = path.replace('new', 'processed')
    shutil.move(path, destination)
    print('moved %s to %s ' % (path, destination))
print('Receipt subtotal: %s' % round(subtotal, 2))

#!/bin/python

import glob
import os
import shutil
import json
import re
import math
try:
    os.mkdir('./processed/')
except OSError:
    print("processed directory already exists")

#Get a list of receipts
#receipts = glob.glob('./new/receipt-[0-9]*.json')
receipts = [f for f in glob.iglob('./new/receipt-[0-9]*.json')
    if re.match('./new/receipt-[0-9]*[02468].json', f)]
subtotal = 0.0

for path in receipts:
    with open(path) as f:
        content = json.load(f)
        subtotal += float(content['value'])
    destination = path.replace('new', 'processed')
    shutil.move(path, destination)
    print("moved %s to %s " % (path, destination))

print('Receipt subtotal: %s' % round(subtotal, 2))
