distributed-computing/tasks/plaksina-av/lab_4/pythontasks/tutorial1/send.py

11 lines
321 B
Python
Raw Normal View History

2023-12-16 01:46:18 +04:00
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='ugolek')
channel.basic_publish(exchange='',routing_key='ugolek',body='Hello, My Name Alex!')
print(" [x] Отправлено 'Hello, My Name Alex!")
connection.close()