# Help a newbie out with sending info to Kafka from Python

**URL:** <https://forum.confluent.io/t/help-a-newbie-out-with-sending-info-to-kafka-from-python/13525>\
**Category:** Stream Processing\
**Created:** [17 December 2024 23:36 UTC](https://forum.confluent.io/t/help-a-newbie-out-with-sending-info-to-kafka-from-python/13525 "2024-12-17T23:36:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CrazyHarry](https://avatars.discourse-cdn.com/v4/letter/c/bbce88/32.png) [@CrazyHarry](https://forum.confluent.io/u/CrazyHarry)\
**Post date:** [17 December 2024 23:36 UTC](https://forum.confluent.io/t/help-a-newbie-out-with-sending-info-to-kafka-from-python/13525/1 "2024-12-17T23:36:39Z")

</div>

I’m venturing out into a whole new area. The world of Kafka. We are using Python and the confluent library to send messages. We wrote what I thought was the correct code, but alas. NO. ☹

Getting an error on the produce call.

Here’s a little code segment. Any offers of help would be accepted readily.

json\_file\_path = ‘test.json’  
with open(json\_file\_path, ‘r’) as file:  
data = json.load(file)

# Produce each record to Kafka

for record in data[‘result’]:  
producer.produce(topic, value=record)  
producer.flush()
