Repl Search: The best search engine around
BobTheTomatoPie (953)

Very Beta

I will be adding a couple of entries per day, just to keep the site fresh

Tell me searches to add

Just comment: the search name, and the info

Some of you guys have entries!

If you type in your user you might have an entry.

Enjoy

-BobTheTomatoPie

Thanks

Thanks to @VulcanWM and @bookie0 for help adding searches

You are viewing a single comment. View All
SixBeeps (2295)

Pretty neat. Though, I would have put everything in a JSON file instead of stuffing each entry into a variable.

Repldex: Repl.it's Pokedex

BobTheTomatoPie (953)

thanks, idk how, if you have time could you give me a tutorial? @SixBeeps

SixBeeps (2295)

@BobTheTomatoPie Sure

  • Make a file called something.json and put this in it:
{
  "A Word": "This is a definition for something.",
  "Another Word": "Wow! There is more than just one term."
}
  • import json
  • Load the .json file into a string:
jsonFile = open('something.json', 'r')
jsonString = jsonFile.read()
jsonFile.close()
  • Parse the JSON dictionary from a string into a variable:
dict = json.loads(jsonString)

You can then access terms and their definitions like a normal dictionary:

print(dict['A Word'])
BobTheTomatoPie (953)

thanks!! I don't think i will do this for the search thing, cause its a little late, but this will definitely by helpful for future reference! @SixBeeps