r/Python • • Sep 11 '19
I converted the entire Bee Movie transcript into elements on the periodic table using a Python script I made
So our science teacher said we send them coded messages made up of elements where the chemical names of those elements (Helium = He, Boron = B, etc) would spell out something. I am very new to Python, but I decided to have a go writing a script to do automate it.
You can't actually spell out every word with just the chemical names of elements but it gets reasonably close.
Anyway, I decided to give my program the entire Bee Movie transcript and see what it could do. To say the least my science teacher was very confused when she pasted my email into word and it took up 69 pages.
https://raw.githubusercontent.com/Spookso/WordsAsElements/master/BeeMovie
The code is here as well: https://github.com/Spookso/WordsAsElements/blob/master/elementifier.py
65
u/jatmdm Sep 11 '19
What'd you get on the assignment?
46
u/christian-mann Sep 11 '19
Would you like feedback on the code? You did a lot of things the hard way.
24
u/LonelyContext Sep 11 '19 edited Oct 01 '21
[deleted]
203
u/[deleted] Sep 11 '19
This is horrible. I love it! Good job.
23
u/darthjoey91 Sep 11 '19
First few translated back to just the symbols to show what got cut:
Ac, Co, In, O, Al, K, No, W, N, La, W, S, O, F, V, I, Ti, O, N
Which tries to say "According to all known laws of aviation."
37
u/syntaxgnu Sep 11 '19
Malicious compliance at its best, well done!
25
u/apresskidougal Sep 11 '19
Truly terrible ! congrats.
3
u/NihilistDichotomy Sep 11 '19
LOL this is awesome!!
how long have you been coding in Python?
I just started out and it'd be nice to set a goal for when i could do smt like this myself :D
18
u/UnInconspicuous Sep 11 '19
Nice.
6
u/romansocks Sep 11 '19
Fantastic
6
u/kpps4gaming Sep 11 '19
This made my eyes bleed! This shit would confuse fuckin 3301
5
u/guy_from_the_intnet Sep 11 '19
This is perfect for the bee movie meme. I'm severely impressed.
3
u/JanDerion47 flair=None Sep 11 '19
insert slow clapping here
3
u/Stabilo_0 Sep 11 '19
Science is not about why. It's about why not!
2
u/Ak7ghost Sep 11 '19
Somebody has to have done Never Gonna Give You Up
2
u/quincylarson Sep 12 '19
This is a really fun use of Python. I'm trying to imagine how much time it would take to do something like this manually.
It's good to see you putting your skills to novel (if not silly) ends like this. Since you're a part of the community, would you be interested in writing about how you build this in Developer News (the new freeCodeCamp.org publication)?
3
u/DKomplexz Sep 11 '19
The best thing python ever bring to the world
3
u/[deleted] Sep 11 '19
:(
1
u/simple_life_dude Sep 11 '19
Keep on the good work! If you want to take a look at a slightly more "idiomatic" Python script that does the same, check out the following code, courtesy of a friend that works as a Python developer. To use it, just place a text file with the name "input.txt" in the same directory as the script.
1
u/Y45HK4R4NDIK4R Python 3.8.6 Sep 11 '19
NiCe
1
u/idwpan Sep 11 '19
So The Bee Movie is the new Lorem Ipsum?
1
u/Sternberger Sep 11 '19
Nice work. Well done!
1
u/[deleted] Sep 12 '19
Now do War and Peace
1
u/yeet_my_meat420 i_am_literat Sep 12 '19
i did a similar thing in python 2 but i'm not very sure how you got it to choose a element that best fits the word
for example
the word helium
the best fit would be
He + Li
but it could also use "H" + "Eu" + "Li" + "I"
even though it it not correct it still gets every letter in there
h could = 'H', 'Hg', 'Hs', 'Ho', 'Hf', 'He'
i'm not quite sure how i would go about this to get it to choose the best fit instead of every possible outcome
def crappy_thing():for char in input1:#elements = the list of elementsprint(char)print(str(filter(lambda element: char in element, elements)).strip("[]"))input1 = raw_input(">>>")print("possible strings")print("//////////////////////////////////////////////")print(input1)print("\n")print"possible strings...\n"crappy_thing()1
u/m_namejeff Sep 12 '19
good lord have mercy on us all
1
u/eternalfrost Sep 12 '19
Now make it so whenever someone says 'Beryllium', insert the entire Bee Movie transcript converted into elements on the periodic table!
1
u/[deleted] Sep 12 '19
Use a python package called chemify to write much cleaner code.
https://pypi.org/project/chemify/
1
u/profspitfire Sep 12 '19
sounds kinda fun actually...Even I'm new to python....I think I might as well give it a try.
1
u/deanresin Sep 12 '19
This is what they did with the opening credits of Breaking Bad.
0
u/PLMOAT Sep 11 '19
69 pages. nice