diff options
author | Zhongheng Liu <z.liu@outlook.com.gr> | 2025-03-11 15:25:56 +0200 |
---|---|---|
committer | Zhongheng Liu <z.liu@outlook.com.gr> | 2025-03-11 15:25:56 +0200 |
commit | 0e6d874c4abb734a915f719f0a507724c7a754fa (patch) | |
tree | 03c1d24cba09bc2d1216f45e930c2d877e269a7b /notebooks/thing.py | |
parent | 9568147aefac22f8928460220560c62bbd972c99 (diff) | |
download | cs-y13-0e6d874c4abb734a915f719f0a507724c7a754fa.tar.gz cs-y13-0e6d874c4abb734a915f719f0a507724c7a754fa.tar.bz2 cs-y13-0e6d874c4abb734a915f719f0a507724c7a754fa.zip |
feat: add ESQs
Diffstat (limited to 'notebooks/thing.py')
-rw-r--r-- | notebooks/thing.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/notebooks/thing.py b/notebooks/thing.py new file mode 100644 index 0000000..a580117 --- /dev/null +++ b/notebooks/thing.py @@ -0,0 +1,22 @@ +import datetime +import pickle +import random # data generator +class Car: + def __init__(self, car_id): + self.VehicleID = car_id + self.__Registration = "" + self.__Date = datetime.datetime.now() + self.__EngineSize = -1 + self.__PurchasePrice = 5900_00 +def data_generator(): + cars = [] + for i in range(40): + s = "ID" + for i in range(10): + s += str(random.randint(0, 9)) + cars.append(Car(s)) + return cars +with open("cars.dat", 'wb+') as carfile: + for car in data_generator(): + print(car.VehicleID) + pickle.dump(car, carfile)
\ No newline at end of file |