Yes! I love coffee and coding.

I mentioned in my previous article that I mostly use PHP language when I am coding. It is something that I am so familiar with that I had a hard time working on this project using Python. I kept on overthinking stuff and comparing PHP and Python.

Working on this code is fun, and I got excited when I was able to make the code run with few to no errors at all. I also did a cleanup based on Sir Myk’s comments and my own. Don’t get me wrong. I am sure that there is still a lot to improve with my quiz code, but at least it is working on both Jupyter Notebook and Spyder IDE.

Since I am used to creating web pages, I scoured the internet to look for hacks and tricks on how to implement my quiz into an HTML format or at least give it some good looking CSS. That is when I found an extension for Jupyter Notebook: AppMode. I tried my luck and just installed it using Anaconda Prompt and hoping it won’t mess up my project or my partner’s computer.

Well, I am still in luck as I was able to make it work, but I am still not satisfied. The text is too small for me.

That is when I decided to try using this hack.

After adding this bit of code, I was able to add HTML tags inside my print statements. I don’t think Sir Myk will be happy about this since this is going against the Zen of Python. I tried looking for other tricks but can’t seem to find any. This is what it looks like using AppMode.

Moving to Spyder IDE was very easy. My code is still working, which is cool. However, my HTML hack no longer works. Bummer!

I scoured the internet once more and saw some articles about using Django to create a Python web page. I had a mini flashback to the time I was doing my Udemy class about Django, and I suddenly remembered that I still have a coffee page project that was left untouched for months now. Knowing that I had to set my priorities straight, I decided to ignore it for now. I need to focus on my data science career and the upcoming capstone, so I don’t have the time to work on a web project.

Going back to Spyder, I removed my HTML hack and made sure it is still working. Again, bummer. I guess this is it. Even my emojis are plain black and white. I am just glad they are still showing.

I did some searching and found some conversation on Stackoverflow, where a Spyder maintainer said that both Spyder and Jupyter run on similar technology, which explains why my code works in both of them. Aside from that, here are some differences that I noticed:

--

--