distributed-computing/tasks/grenaderova-aa/lab_4/python4Lab/Tut1/send.py

11 lines
351 B
Python
Raw Normal View History

2023-12-18 16:32:53 +04:00
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='grenaderova')
channel.basic_publish(exchange='',routing_key='mytarin',body='Hello, I am Grenaderova Anastasia. I love cats.')
print(" [x] Отправлено сообщение")
connection.close()