This commit is contained in:
Gaz 2023-04-10 20:48:27 +01:00
commit 05e0e1e9e4
2 changed files with 23 additions and 1 deletions

19
project.py Normal file
View 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)

View File

@ -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()