Showing posts with label uses of python. Show all posts
Showing posts with label uses of python. Show all posts

To the student: Why Python?

                                To the student: Why Python?

                               Given so many other programming languages in the world, why should you learn Python as your first exposure to computer programming? Well, the real answer is that your instructor selected the both the language and this textbook for the course, so what choice do you have? Nonetheless, let me explain why this was a very good decision.Python is easy, Python is fun, Python is educational, and Python is powerful.
                          Let’s start with the powerful. If you look at the case studies toward the end of the session, you will see that you will end up learning how to do some very interesting things. Tasks like writing your own blog, automatically solving soduko puzzles, reading your iTunes database, or writing a wiki. None of these take more than a page or two of Python code.
                        This is considerably smaller than the equivalent programs would be in almost any other programming language. Is it easy? Let me fudge and say it is easier. Computer programming in any language takes skill, organization, logic, and patience. Python is no different in this regard. What makes Python attractive is that you can begin so quickly and easily. Your first Python
program can be as simple as 2 + 3:
>>> 2 + 3
5
Thereafter the path to learning how to create your own complex applications is, we hope, at least clearly laid out, even if it will take some effort on your part.
Active Learning:                                 
                               This session  follows an attitude towards teaching that has been termed active learning. Rather than treating you, the student, as a passive repository into which knowledge is poured, active learning tries to engage you, the student, as a fully equal partner in the process of learning. Rather than simply telling you how some feature works, I will usually suggest experiments that you can perform to discover the answer on your own. 
                                          There are several benefits to this approach. First, it makes you use a different part of your brain than you would if you were simply reading. Second, it gives you, the student, a greater sense of ownership of the knowledge. Third, experimentation is often the fun part of programming. Lastly, by encouraging you to experiment in the discovery of simple information, I hope to instill habits that you will continue to carry with you throughout your programming career. Together, the intent is that active learning helps you more easily retain and use the information you have learned.


History of python

 History of python

                                       Python was designed by Guido van Rossum while he was working at the CWI (the Centrum voor Wiskunke and Informatica; literally “center for wisdom and informatics”) a world-class research lab in the Netherlands. The CWI group he was associated with designed a programming language called ABC.  ABC was clearly intended as a pedagogical tool for teaching programming, and a great deal of work went into developing both the language and associated teaching material.1 The language ABC had a number of features that were impressive for the time: a tightly integrated development environment, interactive execution, high level data types (lists, dictionaries, tuples and strings), dynamic memory management, strong typing without declaration statements and more. 
                      The idea to use indentation for nesting, and eliminate the brackets or BEGIN/END keywords found in most other languages, was taken directly from ABC. So was the idea of dynamic typing. Software development in ABC was both rapid and enjoyable, and totally unlike almost any other competing language. (The one exception might be Smalltalk, which was just becoming well known in 1985. Indeed, during my time at the CWI I was writing a book on Smalltalk, and part of the work I performed during that year was to explain to my colleagues in the ABC group the basic ideas of Object-Oriented programming, which I myself was only just beginning to understand)
                     
                      Guido started designing Python around 1990. For those familiar with the earlier language the heritage of ABC in Python is clear. Guido discarded some of the annoying features of ABC, and kept all the best ideas, recasting them in the form of a more general-purpose language. By then the mechanisms of object-oriented programming were well understood, and the language included all the latest features. He added a number of features not found in ABC, such as a system for modularization and including libraries of useful utilities. Python was released to the world in 1991, and very quickly attracted a loyal following. 
                        Python’s design turned out to be general enough to address a much wider range of applications than ABC. (To be fair, the designers of ABC were focused on teaching, and never intended the language to be general-purpose). The features that programmers appreciated in 1990 are still the same today: ease of use, rapid software development, the right set of data types that help to quickly address most common programming problems.

Python Monty:


The name, by the way, owes nothing to the reptile and everything to the 1970’s BBC  comedy series Monty Python’s Flying Circus. Many die-hard Python programmers enjoy  making sly references to this series in their examples. You don’t need to have seen Monty  Python’s Life of Brian, The Meaning of Life, And Now for something Completely  Different, or Monty Python and the Holy Grail or even Spamalot in order to become a  Python programmer, but it can’t hurt, either.


what is python

                what is python

                                                   For those looking for buzzwords, Python is a high-level, interpreted, reflective, dynamically-typed, open-source, multi-paradigm, general-purpose programming language. I could explain each of those terms in detail, but in the end the result would still not convey what makes Python programming different from other languages. There is no one thing in Python that is not found in other languages, but it is the elegant design and combination of these features into a single package that makes Python such a pleasure to use.
                    Python is sometimes described as a scripting language, for the simple reason that thousands of working programmers daily use the language in this fashion. That is, they use Python as a tool to quickly and easily glue together software applications and components written in many different languages. But such a categorization is far too narrow, and Python can justly be described as a general-purpose language, one that can you can use for almost any programming task you would like to perform.
                      This is not to say that Python is the only programming language you will ever need or will ever learn. A working computer scientist should know how to use many different tools, and that means he or she should have an appreciation of many different types of language. For example, because Python is interpreted, the resulting programs are often not as fast as those written in lower-level languages, such as C or C++.
                     On the other hand, programs are much easier to write than they are in C. So there is a trade-off, anengineering compromise of the type common in computer science. Is less time in execution of the final program worth spending more time in development and debugging? For the beginning student, and in fact for the vast majority of computer programs, the answer is clearly no. (Another way to express this trade-off is to ask, “whose time is more important, your time or the computer’s?”) Low-level languages such as C have their place, but only for the small group of computer programs for which ultimate execution time is critically important. You may eventually work on such systems, but not in your first programming course.
              Another important category of programming languages are those tied to a specific application. A good example of this category is the language PHP, a programming language used to create interactive web pages. (See www.php.org). A general-purpose language, such as Python, cannot hope to be as easy to use in this application area. But PHP is extremely clumsy to use for purposes other than web pages. If, or when, you start extensive work in such an application area you will want to learn how to use these tools