developer_analysis/area.py

29 lines
571 B
Python
Raw Normal View History

2024-11-10 02:41:51 +00:00
import sqlite3
import csv
import os
from uuid import uuid4
from os import path
from argparse import ArgumentParser
parser = ArgumentParser()
args = parser.parse_args()
STANDARD_AREA=None
STANDARD_ML=100
AREA='./area.csv'
with open(AREA, newline='') as csvfile:
reader = csv.reader(csvfile, delimiter=',', quotechar='|')
for row in reader:
if row[0] == 'Film Format' :
continue
name = row[0]
area = float(row[1].strip())
if STANDARD_AREA is None :
STANDARD_AREA = area
ml = area * (STANDARD_ML / STANDARD_AREA)
print(f'{name} [{area}] = {ml}ml')