haihai.ai haihai.ai
  • Writing
  • YouTube
  • About

Getting Started with the ChatGPT API and Python

OpenAI launched the ChatGPT API today which makes it so easy to create chatbots in Python. Here's an implementation of a command line chatbot powered by Python and ChatGPT API in 16 lines of code. import openai messages = [] system_msg = input("What type of chatbot would you

How to print() without a newline in Python 3

I'm building a command line tool that takes a while to run. I wanted a bit of a progress bar and tried to print('.') on each iteration, but ended up with an endless scroll. In Python 3, you can use the "end" parameter in
Greg Baugues

Greg Baugues

I'm a developer out of New York. This is where I share stories and lessons about building with AI.

Previously, I served as Director of Developer Relations at Twilio.

YouTube LinkedIn baugues.com
Subscribe
HaiHai Labs © 2025
  • Sign up