AlanHarmon.net

Various Thoughts and Useful Information

Installing the OpenAI Library on Python

11/8/2023

First Step - Open Visual Studio Code

Then I opened the my 'pythonapps' folder. It happens to be in this location: C:\Users\alanh\Dropbox\_Personal\My Software\Visual Studio Code\pythonapps

I verify things are working by typing:
python --version

Now I install openai by typing
pip install openai




Check to See if it Installed Correctly

type:
python

type
import openai


If you don't get an error, it installed correctly.

Type ctrl-Z to exit python.


This Installed Correctly




Upgraded the Software in CMD Command Prompt




Pip List Shows Python Libraries Installed in Your Current Environment




Setup OpenAI API Key






To Permanently Set The API Key




Running openai-test.py Produced An Error

It looks like I GOT NO CREDIT......



So I Loaded Up Some Money by 'Add to credit balance'

Now I have 5 bucks to spend. Now let's see what it says.



Success!

After what felt like an eternity (probably like 20 seconds), this showed up:

My first interaction with ChatGPT with Code.



"In the realm of code, where mysteries reside,\nThere lies a concept, both humble and wide.\nRecursion it's called, a loop like no other,\nA dance with itself, a cycle that doesn't smother.\n\nImagine a function, oh, brilliant and grand,\nThat calls upon itself, hand in hand.\nIt ventures forward, then looks back with grace,\nAn enchanting rhythm, like a waltz in space.\n\nThe journey begins with a single call,\nA problem to solve, both big and small.\nWith an eagle eye and a heart keen,\nThe function sets out, in the realm unseen.\n\nThrough iterations, in steps so precise,\nRecursion unravels, like threads intertwined.\nExamining each piece, with diligent measure,\nUnlocking the secrets, revealing hidden treasure.\n\nYet caution is key, for without a base,\nRecursion would wander endlessly, no trace.\nA condition to break, to find its way home,\nA safety net woven, in splendid chromes.\n\nLike a mirrored hall, reflections abound,\nRecursion traverses, dimensions profound.\nDown the rabbit hole, it spirals and twirls,\nA never-ending tale, where logic unfurls.\n\nFactoring numbers, like petals to the sun,\nRecursion peels layers, until the task is done.\nDivide and conquer, it chants with each stride,\nTaming complexity, with code as its guide.\n\nAnd so, dear programmers, let recursion inspire,\nEmbrace its elegance, let its spirit transpire.\nFor in the heart of code, where logic takes flight,\nRecursion dances, oh, what a marvelous sight!"

COMMENT BOARD [00140]

Enter up to 200 characters.

Please keep things family friendly, since we are a civilized community here at alanharmon.net! - (CPC Ver 0.01a)


Hello!

My Name is Alan Harmon. I am a Jesus Follower, Husband, Father, Uncle, Friend, and an Engineer with an MBA.

My interests are in Traveling, Investing, Cooking, Gardening, Technology, Business, Hiking, Smart Homes, Family Games, Automation, and Programming.

Most of the information on this website is centered around those interests. I created this website many years ago primarily to share my recipes and some investing advice, but I began to take it a bit more serious in July of 2023.

I hope you find something Useful here. If you do, you can comment below and share this website with others! Enjoy!



Investing iPhone GardeningCooking Programming TechnologyHiking Traveling