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 os
|
||||||
import pika
|
import pika
|
||||||
|
|
||||||
|
if not os.path.exists("approved_projects"):
|
||||||
|
os.makedirs("approved_projects")
|
||||||
|
|
||||||
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost', 5672, '/', pika.PlainCredentials("user", "password")))
|
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost', 5672, '/', pika.PlainCredentials("user", "password")))
|
||||||
channel = connection.channel()
|
channel = connection.channel()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user