summaryrefslogtreecommitdiff
path: root/notebooks/thing.py
diff options
context:
space:
mode:
authorZhongheng Liu <z.liu@outlook.com.gr>2025-03-11 15:25:56 +0200
committerZhongheng Liu <z.liu@outlook.com.gr>2025-03-11 15:25:56 +0200
commit0e6d874c4abb734a915f719f0a507724c7a754fa (patch)
tree03c1d24cba09bc2d1216f45e930c2d877e269a7b /notebooks/thing.py
parent9568147aefac22f8928460220560c62bbd972c99 (diff)
downloadcs-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.py22
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