Python Programming

This is simply too good not to share. I love the xkcd comics. Python programming can make you fly high! Not so sure about that one, but give it a shot. Just don’t try everything in the medicine cupboard and then go programming. It does not work in PHP, Ruby on Rails, Python, etc… In fact, no matter the language, it does not work.

Python

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • BlinkList
  • blogmarks
  • del.icio.us
  • digg
  • Fark
  • Ma.gnolia
  • muti
  • NewsVine
  • Reddit
  • Shadows
  • TailRank
  • YahooMyWeb

Funnies, Python Stii

Python could improve its documentation

Python’s documentation is confusing and frustrating. As great as the language is, their documentation could be a lot better. Not the content of their documentation, but the navigability and structure thereof.

If you compare Python’s documentation to PHP’s documentation, you would see why. PHP got everything in one place. One book so to speak. Python got it all over the show in different “books”. There is nothing wrong with this apart for the fact if you go into the Language Reference book, go to a section in this book, there is no link back to other books like the Library Reference. A couple of links somewhere on every page linking to the other books would work wonders. The module reference is awesome, but as soon as you go into a module’s reference page, you need to click the modules button at the top or bottom to get back to a list of all the modules. Why not simply have a list of modules down the side as a menu, much the same as that PHP does with its function references?

One really frustrating thing is there is no search on hand in the Python docs. PHP got a search box on every documentation page and nothing is faster than simply entering the search phrase if you need to check something on a specific function. Python’s search is powered by Google and very accurate and effective, but you have to go to a separate search page, which is like the rest of the navigation in the documentation, pretty unreachable once you’ve left the page.

Another “nice-to-have” which PHP does and that would be really handy in Python’s documentation is the user examples/comments. PHP’s documentation is not at all as complete as Python’s is, but that simple little feature that allows users to leave some examples or comments makes the world of difference.

This might be a bit pedantic and petty, but it would just make lives simpler if it was done better! Yes, there are workarounds for almost all of the above issues by opening arrays of new browser tabs/windows. For now, workarounds will have to do.

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • BlinkList
  • blogmarks
  • del.icio.us
  • digg
  • Fark
  • Ma.gnolia
  • muti
  • NewsVine
  • Reddit
  • Shadows
  • TailRank
  • YahooMyWeb

PHP, Python Stii

Rails vs. Django - very funny!

Sep 30

This is funny. Seriously, I enjoyed this! It might be a rip-off of the “I’m a Mac, I’m a PC” ads, but it is still very funny nonetheless! I’m sure Rails and Python folks would like this vid by the Railsenvy guys.

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.

Funnies, Python, Ruby (on Rails) Stii

Going oldschool with VIM

Sep 20

Lets face it, there is certainly no shortage of editors and IDE’s out there today. One would think that command line editors like VI or VI iMproved, Nano, Emacs, etc. should die a really sudden, quick and painless death. Yet, you’d be sorely mistaken. These editors will stay the editors of choice on any *nix server that does not have a GUI installed. Plus what could be simpler than typing
sudo vi /etc/apache2/httpd.conf
to edit system configuration files?

Me and Charl also had a discussion about how hardcore old school geeks swear by it, doing all their programming in these editors. You’d wonder why. I sure did, so I whipped out vimtutor and sharpened the ol’ VIM skills. Now, working with it more and more and getting used to all the shortcuts and keystrokes, it is becoming clearer by the day why it remains the editor of choice for hardcore geeks. It makes it fast! I’m by no means a hardcore geek, but I do see why they like it.

Admittedly, it is quite a learning curve, but once you are used to the commands its much quicker raking in those keystrokes than it is clicking all over some editor to get your rocks on!

It has got really good syntax highlighting and just in case you are afraid you will sorely miss your IDE’s tabbed open document interface you can easily open as much terminal windows as needed to suit your needs. All in all, I think I’ll stay a little longer with VIM than what I expected…

Multiple windows with VIM
Multiple VIM windows

PHP syntax highlighting
VIM PHP syntax highlighting

Python syntax highlighting
VIM Python syntax highlighting

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.

Kick-ass Tools, PHP, Programming, Python Stii

Coming up for air…

Jul 03

After lots of blood, sweat and tears this past two weeks, it seems there is a light at the end of the tunnel and it is more than likely the smouldering coals of the fires we’ve estinguished… I’m starting to breath again, at least! This, I’m afraid, might be very short lived though.

I’ve had a great “crash course” in Python. What an enjoyable experience! Oh, and much thanx to Neville from Muti for all the help and patience! Appreciated mate!

Lots of ppl also told me they’re finding it difficult to open this blog, cause its sloooooow. So I decided since I’m looking to brush up on some Python web developing using CherryPy, I’d move it to a host that is both fast for everyone and supports decent CherryPy/Python. The blog will of course stay Wordpress for now… If I next have a holiday that will allow me to play, I’ll try my hand at re-writing this blog in Python.

CherryPy logo

Python logo

technorati tags:,

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.

Python, web development Stii

CherryPy Overview

Mar 05

I spent a lot of the weekend looking into the Cherrypy framework. At first I found it very confusing. I was looking at it from a PHP and MVC framework perspective and could not exactly grasp why it is so popular and great as it claims to be!

Only after looking at the API and thinking about the first two lines on their home page, I realised what Cherrypy is exactly about.

From the home page:

CherryPy is a pythonic, object-oriented HTTP framework.

CherryPy
allows developers to build web applications in much the same way they
would build any other object-oriented Python program. This usually
results in smaller source code developed in less time.

You have to remember that PHP is a web development language. That was what PHP was developed for. Although you can manipulate the server and run commandline commands with PHP, it was not meant for that. Python on the other hand is exactly the opposite. It was meant to be a scripting language to manipulate the server and not exclusively meant for the internet. Python do have some great support for building web applications, but unlike PHP was not written exclusively for that.

So what is Cherrypy built for? Simple. It allows you to easily take your Python code and publish it to the web. You could do it without Cherrypy, sure! Using Python and CGI you can write kick-ass Python web applications. (Or mod_python if you use Apache) You will however need to know a bit of the HTTP protocol to do that. However, if you use Cherrypy, you don’t need to worry about any of the daunting HTTP protocol. Cherrypy will handle all that for you. All you need to do is write your kick-ass software!

Cherrypy is NOT a MVC (Model-View-Controller) Framework! That was the mistake I made when looking into Cherrypy. The MVC part of your application you will have to design and develop yourself. Python does make it easy for you, due to its Object Orientated nature!

That being said, Cherrypy does have a set of good tools. For example, it has tools to easily and without effort build in session management, build XMLRPC functions and a couple more!

CherryPyhomepage

technorati tags:, , ,

Blogged with Flock

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.

Kick-ass Tools, Python, web development Stii

Forever experimenting…

Feb 27

Since you were born, you have been experimenting with almost everything. You did silly things all in the name of (human growth) sience. Sometimes painful lessons were learnt. Most of the times new, great things were discovered.

I apply this in my daily life. I have never stopped experimenting. (Must add I keep the experimenting to my work, since thats my passion.)

Recently, I rediscovered Linux. Ubuntu to be exact. I’m loving every minute of it! A while back I talked to Neville Newey and ever since he told me that Muti was done in Python, I got that restless feeling in my ass. I am now spending “waiting time” looking deeper into Python.

Lucky for me Ubuntu with their Synaptic Package Manager made it extremely easy to set up CherryPy (CherryPy is a pythonic, object-oriented HTTP framework.) So, I’ll be experimenting forward with CherryPy, Django and the likes. I’ve heard NOTHING but great things about Django, by the way. Wins all the web framework shoot-outs. Even kicks the mother of frameworks’ ass! (Ruby on Rails)

Well worth a look into, I’d say! And for my loved ones, don’t look so scared! I’ll experiment in my own free time. No projects will be jeopardized due to my experimental fetishes!

CherryPyhomepageDjango


technorati tags:, , , , ,

Blogged with Flock

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.

Programming, Python, ideas 2.0, web development Stii

MVC Frameworks

Jan 10

I recently commented like a super-cowboy on devkungfoo’s blog. I made the following (stupid|hot-headed) statement:

I’m considering writing my next big project from scratch, steering clear from any frameworks for now.

Believe me if I tell you that its been on my mind for most of my holiday. I should really learn to think before I shoot my mouth off like some MG42 (I’m playing Call of Duty 3 ;-) ) machine gun!

Let me explain. With the coming of Web 2.0 there has been a lot of focus on MVC (Model-View-Controller) development frameworks. What makes them special is that they follow some very important development principles like the DRY (Don’t Repeat Yourself) principle and they do Database abstraction GOOD! They also encapsulate a lot of standard functions in a “tool library” (if I may call it that) that makes software development quick. Really QUICK. They also separate your data (Models) from your logic (Controller) and your HTML (Views). So all in all, I do not for the life of me know why I made such a comment! MVC’s are great and should be used. To redevelop from scratch, although very novel and brave, is somewhat stupid. Yes, I know I’m contradicting myself something awful, but I’ve been known to do that due to my bloody motormouth. :-)

Last year I spent a lot of time researching a bunch of MVC frameworks. I first of all looked at Ruby on Rails which is arguably one of the best frameworks out there. The cons of this frameworks for me was:

Another great MVC framework written in Python and well worth while checking out if you can develop in Python is Django. But the same goes for Django that goes for Ruby on Rails.

I then decided to look at what is available in PHP since I’m proficient in it. Was I pleasantly surprised! There are hundreds of frameworks! All flavors and for all versions of PHP. Lovely! I still found that there is quite a learning curve involved in these PHP frameworks and although I know PHP like the back of my hand, I have to learn how to implement things utilizing the framework to its full potential!
I ended up singling out two frameworks: CakePHP and Code Igniter.

CakePHP is considered the Ruby on Rails of PHP. A great and extremely powerful framework it is, but I found it a bit clunky and big and in some instances simply overkill!

Code Igniter on the other hand is extremely lightweight and flexible and a whole lot simpler to learn. It lacks in certain aspects as at the time it had no AJAX support, but including AJAX was not a big issue as it was easy enough to do.

So, out of the frameworks, Code Igniter is the one to use for small to medium sized projects.
Code Igniter

technorati tags:, , , , , , , , ,

Blogged with Flock

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.

Code Igniter, PHP, Python, Ruby (on Rails), web development Stii


RSS Feed
Afrigator
Techleader

Recent Posts

My Posse

Filed in

Past Stuff

Meta Stuff