Building my own RSS reader in Python, part 1

in #github6 years ago (edited)

Now that I've got the skeleton of something that reads RSS already, it's time to reflect on the next couple of steps.
I'll identify the main issues right now, then come up with a solution, then implement the solution, then evaluate the solution and see if I need to repeat the process.

Identify the Problems

  • I don't know Python all that well. Not well enough to apply the standard Object-Oriented Programming dogma I've been taught at university.
  • I don't know Python's UI library, TkInter, at all. I want learn this too.

Thumb-suck a Solution

  • Following the MVC pattern, I have to learn the View part and the Controller part. The View part being TkInter, and the Controller part being Python code that interacts between my UI and the Model parts.
  • I do have a fairly good library that seems to cover all the heavy lifting. The Model part is essentially covered. This mostly takes care of the Model part in the MVC pattern.
  • I prefer coming up with some architecture first and then implementing it. In this case, MVC is as close to anything familiar as I am likely to get. I will therefore have to start with that and see if I can venture safely into unexplored territory.
  • I will start with the View. I hate UIs, but if I want to show someone something, then I'll need one. The UI parts should be OK to do, and then I can figure out how to connect the UI components with the underlying business logic.

mainRSSFeedLayout.png
A rough - very rough - layout of an RSS feed reader, as can be seen from RSSReader. Some are more fancy, but that's the main layout idea. I prefer to keep the UI simple, so mine won't be far more complex than this one. I might use a different font and some icons though.

Implement the Solution

After a bit of a struggle to configure IntelliJ for my Python installation, I found this guide to GUI programming in Python on Tutorialspoint. Don't feel sorry for me, I am still on Windows and I should have exorcised my whole house of this abomination a long time ago.

Regardless, the tutorial has a few examples of working with UI components, but they are all stand-alone and not integrated into some kind of fancy paradigm. Good enough to toy with for now then I can figure out the OOP stuff.

capture.png
Look! A window! Made in Python!

Speaking of the OOP stuff, I found this Guide to Python - Object Oriented on Tutorialspoint too. Excellent! I can start messing around with Python GUIs and try to integrate into some OOP architecture I can refuctor.

Do I Need to Solve My Solution?

It's a bit too early to tell. It seems that I will get by with the UI stuff, but the OOP stuff in Python is still a mystery to me. Still, G.Polya's How to Solve It hasn't let me down yet. I will have to iterate through these steps a few times, but I'm confident that I would get there. I have enough to play with for now.

Sort:  

What language(s) do you normally code in? I used to be a .Net guy back in the day, and when I started coding my Steemit bots I had a look a Python, but the learning curve seemed a little too steep... so now I'm doing everything in JS :P

Which reminds me... please go check out @PlayDice when you get a gap... my first (well... second, but the 1st isn't live yet) attempt at a Steemit bot/game.

I usually work in Java. Java is still very similar to C# without some of the bells and whistles. I haven't used C# much I'm a bit allergic to .NET.

Python has a relatively low learning curve. If you get by in JS then you shouldn't have a problem with Python. It's got all the cardinal sins like duck typing that Python has too. But I'm still a noob in Python, so I'm still on top of Mount Stupid where I think I know what I'm doing without the experience to motivate my opinion :P

Thanks, I shall check it out!

Wahahahaha... "on top of Mount Stupid"... totally gonna steal that!

Re Python: Well, I got lost just setting up the environment. Fair enough I didn't REALLY try that hard until coming across NodeJS, which was a breeze to get up and running, and so I abandoned Python... I should probably rethink that... ONE day :P

NodeJS is amazing, you can do so much with it.

It's true, Python isn't very easy to set up. It's also got two major branches that had backwards compatibility issues. This seems to be better now, but while I was doing a few Coursera courses it was breaking a lot of stuff.

Things seem to be better now, but if you're getting along in JS then there's no real need for more. I am very keen on Scala, R and Julia at this point in time. Getting tired of writing apps as such and would love to get more into data science.

Coin Marketplace

STEEM 0.35
TRX 0.12
JST 0.040
BTC 71539.00
ETH 3603.23
USDT 1.00
SBD 4.75