import pika connection = pika.BlockingConnection(pika.ConnectionParameters('localhost')) channel = connection.channel() channel.queue_declare(queue='melnikov') channel.basic_publish(exchange='',routing_key='melnikov',body='Hello, my name is Kirill, i am from ISEbd-41!') print(" [x] Отправлено сообщение") connection.close()