#help needed for python and playground

6 messages · Page 1 of 1 (latest)

ripe dagger
#

I am trying to only print the text under " "text": "\n\nTo only print text, you need to use a text editor, such as Notepad, TextEdit, or Atom. Once you have your text editor open, type in whatever text you want to print, and then save the file. Once it is saved, you can print the file using your computer's print command or by using a printer application.""

without the \n\n and make it look much clearer? how to do this?

#

basically, i wanna print only "To only print text, you need to use a text editor, such as Notepad, TextEdit, or Atom. Once you have your text editor open, type in whatever text you want to print, and then save the file. Once it is saved, you can print the file using your computer's print command or by using a printer application." to the terminal instead of all the other clutter

unreal karma
#

use a json parser to parse the response and get just the part you want

ripe dagger
unreal karma
#

try something like this

import json

# your code here

data = json.loads(response)
print(data["choices"][0]["text"])
#

the text comes back in json form, so you can use a json parser to get just the part you're interested in