distributed-computing/tasks/lyamzina-ma/lab_4/python4Lab/Tut1/send.py

11 lines
329 B
Python
Raw Normal View History

2023-12-18 16:41:19 +04:00
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='lyamzina')
channel.basic_publish(exchange='',routing_key='lyamzina',body='Hello, I am Lyamzina Maria!')
print(" [x] Отправлено сообщение")
connection.close()