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

Starting from free books

There are some good free books to get start with python. The first is about the Python, Dive Into Python:
http://www.diveintopython.org/
This second is about the Django, a web framework that is available in Google App Engine too:
http://www.djangobook.com/

Sunday, April 20, 2008

IDE - How to start?

One big difference from open sources and proprietary languages is that in open source we have lot of options. It is good, but some times we can just get lost in all options and not even know how to start. So, is difficult to choose and start from the best. I’m looking at Python at the moment, not at JPython or IronPython, so I have found the Dive Into Python book(It has a online free version), which mentions the ActivePython for their examples.

ActivePython has a free version (Standard in their site), although it is not open source. You can freely download the ActivePython at this url, it's currently on version 2.5.2.2, and it has version for different operation systems, like Linux, Mac and Windows. The windows version needs the Windows Installer.

The other option is to install a plugin in eclipse, the PyDev, which is easy using the Software Update of Eclipse. There is more information on how to do this here. And others manuals to get started on PyDev.


See this link about others IDEs.

Saturday, April 19, 2008

Getting Python Software

To start using the C# we need the .net framework, in Java we need the java virtual machine. Python needs the Python software which is currently in the version 2.5.2. The download is about 11.2 MB for windows users, less than frameworks of C# and Java, but I'll know only later which libs are included here. The installation takes just some minutes and uses about 31,2MB hard disk drive.

The Python software can be downloaded here: http://www.python.org/download/
The documentation can be downloaded here: http://www.python.org/doc/2.5.2/download/

Introduction

A friend of mine has sent to me an e-mail about the Google App Engine and the python(Thanks Daniel san). At this time I didn’t know anything about Python, but if Google was offering a new service like this, it would be a good idea if I knew more about it. That is what motivated me for creating this blog.

I'm a Brazilian who at this time has being a C# developer for 6 years and think the .Net is excellent framework. I have learned java and like it too. I'll not comment anymore about this, because I wrote that just to explain that I think learning a new technology is important to get improved as an IT professional at all.

So, I will post on this blog as a new developer of python who has the knowledge of these others languages.