View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > Python tips

From LQWiki

Jump to: navigation, search

Python is a popular, high-level, object-oriented programming language for standalone applications as well as simple scripts. It's fairly easy to learn, portable, and it's design has been described as "coherent" and "orthogonal". Python code tends to be readable and maintainable -- there are no obfuscated Python coding contests that I know of. :) (They would be funnier,probably. Anyway you can find obfuscated Python...just look for it in Google!) Python was conceived by a Dutch hacker by the name of Guido van Rossum.

Python uses indents or spaces instead of braces to delimit loops. This is not a defect of the compiler but a design feature which helps make Python code easy to read. Why not rely on space to show structure? - you're probably typing the indents anyway.

However make sure you are careful not to mix spaces and tabs up, as this can confuse the compiler. My own tip in this regard is to either stick to only using tabs, or (my personal choice) see if there is a setting in your favoured text editor to uses spaces instead of tabs.

Python is also a good start to learn object-oriented programming.

External links


Personal tools