How I am learning Python from scratch Part 2

So it’s been slightly over a month since I’ve been with Insync (google docs sync not the band). Thought this would be a good opportunity for me to give an update on what’s been going on and how I’ve been getting on with Python. (Btw, they are looking for a few Level 80 troll eating amaterasu sprouting ninja samurai ronin assassin fireman to join the company in Singapore and Philippines.)

Currently, I’ve been working on mini apps. I’ve set myself a target of producing one mini app a week until I’m deemed good enough to work on production related tasks. My mini app ideas are very simple with the objective of getting something working out as soon as possible. This is also a lot more fun than doing books and tutorials like what I mentioned previously.

THE APPS

Mini App1: Twitter Tag Cloud

Enter your twitter username and it generates a tagcloud of words based on your last 100 tweets. It’s not a ‘smart’ tagcloud in that common words like the, he, she shows up. Ignore the oAuth part in the title. Leftover CSS 😀

This was created using Python, Django and Python-Twitter library. Models weren’t use as there were no databound elements in the app.

Mini App2: oAuth Twitter Status Getter

Ok for some reason, the app doesn’t seem to be working now. I’ll probably have a look at it later BUT it’s suppose to do this: Authenticate using oAuth with your twitter account. It then grabs the last 50 tweets from your timeline. There is an input box that allows you to change how many tweets that get displayed. This number is databound such that the next time you log in to the app, the same number of tweets that you set previously is displayed. I’ll update with screenshots once I figure out what the hell is going on.

FYI, for the technical savvy, I am getting BadStatusLine when twitter redirects the user back to my application.

Mini App3: Flickr Photobrowser

The latest and the greatest. This app is currently live on my free EC2 instance. Check it out here (**UPDATE** I’ve taken this down to save me some EC2 hours). For those who can’t be asked to click, see the screen shot below.  Basically, input your Flickr username and it gets all your public photos and displays them in a gallery with pagination. Did you hear that? Pagination baby. Paginationpaginationpaginationpagination. That’s nice, I like the sound of pagination. Oh, there is also has some nice CSS mouseover effects applied to it.

This was by far the most complicated app of the 3. It took me a while to figure out the pagination feature on Django. Setting up Apache and mod_wsgi on Amazon was also tricky as it was my first time setting up a webserver. The documentation was bloody intimidating at first glance but just keep your head down and bang a few walls with it, you’ll pull through just like everyone else. The Flickr API itself was fairly straight forward but I didn’t do anything that required authentication. That just messes things up.

And yes, that’s me with the ultraman facial pose.

**update** Just realized my little app is not a hundred miles away from http://instagrid.me/ which was recently launched.

Lessons Learnt

  1. If you want to play around with RESTful services and API’s, Twitter is a good place to start.
  2. I found myself doing quite a fair bit of stitching together code and then augmenting it for my own purposes as opposed to writing the entire app from scratch.
  3. Deployment has been my greatest source of grief at the moment. There’s quite a fair bit to know about the web development that is really not related to coding. At this moment, I still haven’t figured out how to get Django, Apache, mod_wsgi and EC2 to play together nicely.
  4. For morale reasons, you would probably want to make your app live on the internet and ‘show off’ to everyone and say: Hey! Look at me, I made this! On this note, I think being able to deploy a Rails app onto a service like Heroku is definitely one big plus for going with RoR for a beginner. Having said that however, I understand the learning curve for RoR to be steeper initially compared to Python/Django.
  5. Be prepared to get your hands dirty in shell/bash (or command prompt in Windows). I spent 30 mins wondering why ‘cd projects’ didn’t exists only to realize bash was case sensitive. And while you’re at it, say hello to this primitive thing call Vi or Vim. I still don’t quite know what the difference is.
  6. I know a lot of you guys are going to be bouncing between concepts and jargons. It takes a while for everything to sink in so don’t worry if you don’t get it the first time. For example, I’m only just beginning to understand what a web server actually does and the role it plays in the ecosystem.
  7. Less reddit, more code.
  8. I estimate I’ve spent less than 50% of my time actually coding in Python and more time messing with sys admin stuff and Django.

That’s all for now.

Advertisements

27 thoughts on “How I am learning Python from scratch Part 2

  1. Great post, dude. Making mini-apps is fun. You can get burnt out on big projects when you get a couple hundred hours in them = ) I’m sort of doin the same, but in PHP. You using a Python framework for these projects?

  2. “At this moment, I still haven’t figured out how to get Django, Apache, mod_wsgi and EC2 to play together nicely.”

    Can you share how you overcame this problem?

  3. Don’t even worry about the deployment details in the sense that they get you down.

    Deployment is a bit painful at first but once you have it figured out, it’s the tedious and mundane part of the work.

    I’ve worked more with RoR than any other language when it comes to setting up the backend and I seem to be okay with it b/c the support community is huge.

    BTW: Love reading your posts!

  4. i have been reading ur all post on python …Well even i started getting my hand dirty in python and i like it…Just wanna know which book are you referring for Django ,it will be helpfull..Thanks for such great post

      • … good grief, I feel the same way in a sense. All in it’s own time. Overall patience is as important in all this as anything else. When I started learning to program, one of the most useful books turned out to be ‘Zen and the art of motorcycle maintenance’. There’s a part where the author talks about ‘gumption traps’ and how to avoid them. That part will never become obsolete 🙂 The more experienced you become the severity of gumption traps increases and coping with them becomes even more critical.

  5. You have no idea how awesome this post is. I too am a “business guy” although I’m good at math and whatnot I really do enjoy marketing and metrics, but of course I had a ton of web app Ideas. I started learning Python this week to do exactly what you are doing and seeing your progress is awesome 😀

      • Hey Craig

        Thanks for dropping a line.

        If you time, I recommend you a few beginner books. Learning Python the Hard Way is good but a little rote.

        I also did Think Like a Computer Scientist. Once you have these 2 books nailed down, try the exercises at http://www.pyschools.com. I’m ranked 39 (naithemilkman) atm, see if you can beat my score 😛

  6. for experienced programmer, very easy to pick up python within 1-2 days, in short, python is a very good choice for rapid development.

  7. Pingback: How I am learning Python from Scratch | pragmatic startup

  8. Thanks for posting this nice article, I really enjoyed reading it! I’m also learning Python through LPTHW as a total beginner with only little knowledge about any language just the basic XHTML. I’m at exercise 41 which I’m struggling with BUT I’ll get there. Very interesting the steps you took after LPTHW, for sure I’ll give the same check. Thanks again, good luck and take care. Greets, Bjorn.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s