distributed-computing/tasks/nasybullov-ai/lab_4/python4Lab/Tut1/send.py

11 lines
326 B
Python
Raw Normal View History

2024-01-09 18:57:58 +04:00
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='mytarin')
channel.basic_publish(exchange='',routing_key='mytarin',body='Hello, I Mytarin ISEbd-41!')
print(" [x] Отправлено сообщение")
connection.close()