tags:

views:

334

answers:

3

Okay, so i am fairly new at programming (knowing only html, css, and javascript) and i just started diving into python. But what i want to know is, what is it used for? how can i apply python to an object?

A: 

You can check out the Wikipedia Entry for Python. One way that you can leverage python is by using it on Google's AppEngine.

Joel Martinez
+1  A: 

Why Python?
May 1st, 2000 by Eric Raymond

http://www.linuxjournal.com/article/3882

gahooa
+2  A: 

Python is a dynamic, strongly typed, object oriented, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax.

  1. Python is dynamic typed: it means that you don't declare a type (e.g. integer) for a variable name, and then assign something of that type (and only that type). Instead, you have variable names, and you bind them to entities whose type stays with the entity itself. a = 5 makes the variable name a to refer to the integer 5. Later, a = "hello" makes the variable name a to refer to a string containing "hello". Static typed languages would have you declare int a and then a = 5, but assigning a = "hello" would have been a compile time error. On one hand, this makes everything more unpredictable (you don't know what a refers to). On the other hand, it makes very easy to achieve some results a static typed languages makes very difficult.
  2. python is strongly typed. It means that if a = "5" (the string whose value is 5) will remain a string, and never coerced to a number if the context requires so. This is, for example, different from perl and javascript, where you have weak typing. Every type conversion in python must be done explicitly.
  3. python is object oriented, class-based inheritance. Everything is an object. objects, classes, functions, all are objects, have methods and so on.
  4. python is multipurpose: it is not specialized to a specific target of users (like R for statistics, or PHP for web programming). It is extended through modules and libraries, that hook very easily into the C programming language.
  5. python enforces correct indentation of the code by making the indentation part of the syntax. There are no control braces in python. blocks of code are identified by the level of indentation. Although a big turn off for many programmers not used to this, it is precious as it gives a very uniform style. The code is visually pleasant to read.
  6. the code is compiled in token form and then executed in a virtual machine. precompiled code is portable between platforms.

Python can be used for any programming task, from GUI programming to web programming with everything else in between. It's quite efficient, as most of its activity is done at the C level. Python is just a very thin layer on top of C. There are libraries for everything you can think of: game programming and opengl, GUI interfaces, web frameworks, semantic web.

Stefano Borini