Saturday, May 10, 2008

Google App Engine

What really motivated me to learn a little about Python was the Google App Engine. So is needed to have here a post about it.

Debugging Google App Engine with Eclipse PyDev.
http://blog.smashedapples.com/2008/04/debugging-googl.html

How to use Google App Engine with Eclipse PyDev.
http://daily.profeth.de/2008/04/google-app-engine-eclipse-pydev.html

This post is interesting, it shows how to use the Object Relational Mapping of Google App Engine:
http://daily.profeth.de/2008/04/er-modeling-with-google-app-engine.html

Using Django with Google Appengine:
http://www.42topics.com/dumps/appengine/doc.html

Wednesday, April 30, 2008

PyDev on Eclipse - Software Update Url

The Url to install PyDev through Software Updates is this:
http://pydev.sourceforge.net/updates/

Bellow are the needed steps to install PyDev on Eclipse.

Start the Eclipse and click on the Menu Help > Software Updates > Find and Install.



Select Search for new features to install and click Next.



Select New Remote Site.



Insert a name like "PyDev Update Site" and the Url: http://pydev.sourceforge.net/updates/ then click Ok.

Ensure that "PyDev Update Site" is checked and click Finish.

Monday, April 21, 2008

Comparing the language

Again: There is a book freely available online named Dive into Python which I really recommend. I have just downloaded it and started to read, so I will post some differences that I have already seen from java and .Net.

Language Type

In C# or java we need to specify type at the declaration for variables(This book calls this statically typed language) and once this variables has that type, it cannot be used like other type, unless with a explicit convert(called strongly typed language).

In Python the types are not specified at the declaration, but only in the assign of a value(dynamically typed language), but once this variable is assigned, this variable has to be used like that type or can be explicit converted. So Python is dynamically strongly typed language. In Python we don't declare a variable, they are created when they are assigned.

I used to be a VB programmer and when I have leaned C# I get used to statically typed language and I liked it. Python do it in a different way, at first I didn't like this of not declaring a type of a variable, I would rather the statically typed than dynamically typed. A friend of mine, Gustavo Ferreira Moreira, who have already worked with Python and now is learning C#, prefer define the type at the declaring time too.

Indenting Code

This is really a cool stuff. Code blocks are defined by their indentation. Like C# and Java are defined by curly braces "{}". A code is good to read when they are indented correctly, and Python needs that.

Example(Python):
number = 4
if number > 3:
print 'number greater than 3'
print 'number', number

Same Example in C#:
int number = 4;
if (number > 3)
{
Console.WriteLine("number greater than 3");
Console.WriteLine("number" + number.ToString());
}

Python is case-sensitive
Just like C# and Java.

Namespaces
Python uses namespaces too!

Other references:
http://www.python.org/doc/essays/styleguide.html