Posts

Showing posts from March, 2018

Working with string manipulation and basic file io operations in Python

Image
Last night, this tweet appeared in my timeline and caught my attention. The word "friends" is said in every episode of Friends. — Fact (@Fact) March 9, 2018 This doesn't sound right. There was no possible way to verify this and I expressed my concern over the same. A friend suggested counting the word in subtitle file for all episodes. I liked the idea, and a small weekend project was born. Before I give the spoilers away on whether or not it is true, I want to first clarify a few different things on how I got it done. I didn't have the subtitles file so I had to download them all before parsing the word "friends". I began by looking at websites that would let me download the english subtitle files the easiest way possible. Originally I had planned to use urllib   with BeautifulSoup to download the files but TV Subtitles made it really easy for me(kudos to the site developers btw). They let you download seasonwise bulk zip files of all episodes