added Project class and modified university.py to create required directory
This commit is contained in:
parent
2fa1b47edb
commit
60e5e74ac7
19
project.py
Normal file
19
project.py
Normal file
@ -0,0 +1,19 @@
|
||||
from dataclasses import dataclass
|
||||
import pickle
|
||||
|
||||
@dataclass
|
||||
class Project:
|
||||
acronym: str
|
||||
title: str
|
||||
description: str
|
||||
amount: int
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
project1 = Project("acronym", "title", "description", 500)
|
||||
with open("file", "wb+") as file1:
|
||||
pickle.dump(project1, file1)
|
||||
with open("file", "rb") as file2:
|
||||
project2 = pickle.load(file2)
|
||||
print(project2)
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
import os
|
||||
import pika
|
||||
|
||||
if not os.path.exists("approved_projects"):
|
||||
os.makedirs("approved_projects")
|
||||
|
||||
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost', 5672, '/', pika.PlainCredentials("user", "password")))
|
||||
channel = connection.channel()
|
||||
|
||||
@ -26,4 +29,4 @@ try:
|
||||
channel.start_consuming()
|
||||
except KeyboardInterrupt:
|
||||
channel.stop_consuming()
|
||||
connection.close()
|
||||
connection.close()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user