I am trying to make a programm that tells you a input amount of the words rhymig with the word you choose. i am doing it in PySimpleGUI and i dont know how to print the loop in to a PySimpleGUI window. Could someone help. Thanks in advance -Josh
import PySimpleGUI as sg
import requests
layout = [[sg.Text('What would you like to hear rhymes about: '), sg.InputText()],
[sg.Submit(), sg.Cancel()]]
window = sg.Window('Rhyme.', layout)
event, values = window.read()
rhyme = values[0]
words = requests.get('https://api.datamuse.com/words?rel_rhy=' + rhyme)
words_json = words.json()
window.close()
layout = [[sg.Text(f'How many rhymes about {rhyme} would you like to hear: '), sg.InputText()],
[sg.Submit(), sg.Cancel()]]
window = sg.Window('Rhyme.', layout)
event, values = window.read()
num = values[0]
window.close()
layout = [[sg.Text(#I dont Know how to print the list here)