by Dhruv Baldawa

@dhruvbaldawa on twitter

Show me the code!

'coz code speaks louder than words

Hello World


        print "Hello World"


    #include <iostream>
    using namespace std;
    int main (int argc, char** argv)
        cout << "Hello World!";
        return 0;


    public class HelloWorld {
        public static void main(String[] args) {
            System.out.println("Hello World");


Reading a file


    for line in open("filename"):
        print line


    #include <iostream>
    #include <fstream>
    #include <string>
    using namespace std;
    int main () {
        string line;
        ifstream myfile ("filename");
        if (myfile.is_open()) {
            while ( myfile.good() ) {
                cout << line << endl;
        else cout << "Unable to open file";
        return 0;

Reading a file


    class FileRead {
        public static void main(String args[]){
                FileInputStream fstream = new
                DataInputStream in = new
                BufferedReader br = new BufferedReader(new InputStreamReader(in));
                String strLine;
                while ((strLine = br.readLine()) != null)   {
                    System.out.println (strLine);
            catch (Exception e){
                System.err.println("Error: " + e.getMessage());


Wait for it !

a, b = b, a

Now you have some idea about the language

How about some cool demos ?

Demo 1


Demo 2

A Search Engine

Demo 3

A Web Application

Demo 4

Scripts which talk to the internet


What is it ?

Who is using it ?

Who wrote it ?

How fast is it ?

Which platform does it run on ?

What can I do with it ?

What are the data types ?

About Python

  • created by Guido van Rossum
  • named after BBC show "Monty Python"
  • first version released in 1989
  • consistently ranked in top 8 most popular language since 2008
  • won 2007 and 2010 "Programming Language of the Year"

Who is using Python ?

Courtesy: PyCon US 2012 website[6]

Who is using Python ?

  • Google
  • YouTube
  • Dropbox
  • Yahoo
  • NASA
  • Nokia
  • IBM
  • CIA
  • Disqus
  • Walt Disney
  • ... and many more

Where can I run Python ?

Where can I run Python ?

  • works on Windows, Linux and MacOSX.
  • also works on Nokia Series 40 and Series 60.
  • There are Python interpreters and packaging for Android.
  • Python interpreters are also available for iOS.
  • There are also various projects regarding running Python in browser.

What can I do with Python?

  • Web Development
  • Database Access
  • Desktop GUIs
  • Scientific and Numeric computing
  • Network programming
  • Games and 3D graphics
  • Embedded systems
  • ... sky is the limit !

Why Python ?

  • free and open source
  • cross platform
  • clear and readable syntax
  • rapid application development
  • "batteries included" with a great "standard library"
  • works great with C, Java, .NET and other technologies
  • automatic memory management and garbage collection

Why Python ?

  • significantly reduces development time and source code size.
    • usually 3-5x shorter than equivalent Java programs
    • usually 5-10x shorter than equivalent C++ programs
  • helps the developer focus on code
  • excellent language for prototyping
  • ... and many more

Why not Python ?

  • often just considered as a scripting language
  • slower than compiled languages
  • slower parts can often be compiled to C, to make them fast

Where can I learn Python?

Everybody is using Python to teach Programming

Where can I learn Python?

“Udacity’s courses so far have been using Python because it is overall, the most convenient language for teaching and learning. The natural syntax means students spend less 6me grokking code than with terser languages.”
-- Chris Chew, Software Engineer, Udacity Inc.[3]

What next?

Questions ?

Contact me at:

Submit feedback:


  5. xkcd 353
  6. Sponsor logos on PyCon US 2012