An open-source useless python library that emulates (not fetches) some of Merl's most popular responses and answers. This may include some bonus ones that Merl does not actually say in the real thing, but come on who doesn't love a Minecraft Movie easter egg? Developed using the code.org IDE, because why not. Use the following line on Windows to import merl:
pip install merl
If it says that 'pip.exe is blocked by group policy', try this:
python -m pip install --user merl
If THAT doesn't work, then give me some time to either fix my files or find another workaround.
To update Merl:
pip install --upgrade merl
Or do:
python -m pip install --upgrade --user merl
Sends 'pr' to Merl where 'pr' is a string. The response automatically prints out in the terminal/IDE, so don't resize the window to less than the width of 40 characters wide. Otherwise the unprinting function breaks.
Sends 'pr' to Merl where 'pr' is a string. The response is returned as a string, so its nicely paired with a print() statement, like this:
print(merl.sendRaw("Hello"))Because it has no unprinting function, this function is less likely to break the terminal.
This is an example program (used by me!) to test Merl's capabilities and features:
import merl
a = ""
while a != "!leave":
a = input("<you> ")
merl.send(a)NOTE: THESE FEATURES DO NOT WORK ON ACTUAL MERL, JUST PYTHON MERL!
To have Merl copy standard input to output, type "copyInput" in the send function, like this:
merl.send("copyInput")This means that from now on, Merl will re-print whatever you put in send() until you tell them to stop using this:
Simply type "resetInputs" to have them go back to normal! Like this:
merl.send("resetInputs")Ok im not gonna lie, this module is pretty easy to mess up in all sorts of ways. That's why you should(n't) mess with the underlying variables and the functions! But because everyone gets a copy, everyone can do what they want.
Functions that are supposed to be hidden
Prints 'msg' where 'msg' is a string. If 'msg' does not have spaces, then it all prints at once. Else, it prints word-by-word. If 'msg' spans longer than the terminal's horizontal size, then it will start duplicating the messages with each line. Keep each 'msg' short, like Merl!
Where 'prompt' is a string. This forces Merl to reply whatever, based on what you put in. The reason why there are 3 "send" functions is because it has Merl check a thing or two before actually doing the reply checks, too. Expect "I don't know." to show up more than once. With the exception of your system's time being between 9 AM and 4 PM, of course, because then you get a high traffic message more than actual answers! (If that's what you could call them)
For the O L D E S T version of Merl, do this in your terminal!:
pip install merl==0.1.0
This way you'll be able to interact with the stupidest version of Merl to ever see the internet. Or your computer. I don't care.
Look at this code:
import math
print(math.pi)
# prints pi as per usual... but then...
math.pi = 3.151999653
print(math.pi)
# prints the new value i gave itNow look at this code:
import merl
print(merl.banned)
# get every word that's not allowed by Merl.
# lets see how merl feels about pineapples...
print(merl.sendRaw("I like pineapples."))
# okay, not bad...
# we'll make them hate pineapples now!
merl.banned = ["pineapple"]
print(merl.banned)
# pineapples. go on!
print(merl.sendRaw("I like pineapples."))
# merl now hates pineapples.See the utter damage you could do with some hidden code?? That's the beauty of Python's module system. I hope it never changes.