Python might be new to many of you, so there will certainly be many questions in your mind. So, going ahead with this post, I would like to introduce further things in Q/A form (Whats & Whys). You might add more of such questions as a part of comments.
What is Python?
Python is a powerful scripting language created by Guido Van Rossum in 1998, meant for RAD. It owes its name not to the python as depicted in the picture rather to the comic troupe Monty Python. Interestingly, though, certain Python installations show the Python script icon as a green python.
Why does a software tester need Python?
Another format of this question is – “What is a Python related post doing on Testing Perspective blog?”. A software tester needs Python (or any other scripting language of choice), to automate testing efforts. When I say automating testing efforts, it encompasses automated testing along with other activities that support the testing of an application,e.g. test environment set-up, test reporting etc. Using Python gives a software tester, a consistent language rather than switching from one tool-specific language to another. Using Python, many such tasks can be automated, for which you might not find an already existing tool. Remember that the above statements are just a glimpse of the possibilities. Your imagination and skill-set will definitely make you do much more than the mentioned stuff. Python is a language of choice of a large number of the security professionals. There is an ever-growing community supporting Python.
What are the key features of Python?
1. Easy coding - It’s meant for Rapid application development. Consistent style of coding and usage make your life easier than remembering some 100 shortcuts or tricks.
2. Excellent Readability and Maintainability – Proper Indentation of code is not a choice, rather the way of Python coding. If you pick Python code by different programmers, you can be sure to see similar looking code.
3. It is Object-oriented - OOP is not a patch work for Python, rather an in-built feature
4. It is free and open source.
5. No semi-intelligence - No ambiguous type-conversions or assumptions.
6. Exception Handling is built into the language
7. It is Cross Platform compatible
Where can I get Python?
You can get Python as a free download from Official Python website or as ActivePython from ActiveState website. There are other versions available, but the mentioned ones solve the purpose.
Why should I switch to Python?
This is a tricky question and is more relevant to those who already know some scripting language like Perl or Ruby.
I would like to say that when one uses a scripting language for a long time, it more or less becomes a religion for the person. You can find many debates (healthy as well as unhealthy) on the web or otherwise with the topic “abc versus net”, “Why abc is worse than net”….At your own discretion, you can Google or Yahoo! for such topics. I have gone through such threads of discussion on the web and even with my friends and team. Such discussions help me to see the stuff from a broad perspective and I end up appreciating as well criticizing certain aspects of languages being compared.
I advocate Python not as a substitute for any other scripting language, I advocate Python as Python. If you know any other language (that’s true for me), you can choose to learn Python to add another language to your toolbox. I strongly feel that no language is the best language for everything. So, take out Python from your toolbox after careful assessment and you will see how it makes your coding experience better.
For those, who want to learn it as their first scripting language, I can say from my experience that Python will not disappoint you. It’s an excellent asset for a tester’s toolbox and will teach you good coding principles and impact the way you code. It can help you to automate many day-today tasks.
Who Recommends Python?
Some of us tend to believe stuff when it comes from some big shot. An example is some simple quote, which is a known general truth, but when some big leader says it, it becomes news. Following are some quotes about Python, which I could find on the web. So let’s have a look at who are using Python and what do they feel about it.
Google“Python has been an important part of Google since the beginning, and remains so as the system grows and evolves. Today dozens of Google engineers use Python, and we’re looking for more people with skills in this language.” said Peter Norvig, director of search quality at Google, Inc.
NASA “NASA is using Python to implement a CAD/CAE/PDM repository and model management, integration, and transformation system which will be the core infrastructure for its next generation collaborative engineering environment. We chose Python because it provides maximum productivity, code that’s clear and easy to maintain, strong and extensive (and growing!) libraries, and excellent capabilities for integration with other applications on any platform. All of these characteristics are essential for building efficient, flexible, scalable, and well-integrated systems, which is exactly what we need. Python has met or exceeded every requirement we’ve had,” said Steve Waterbury, Software Group Leader, NASA STEP Testbed.
Industrial Light & Magic “Python plays a key role in our production pipeline. Without it a project the size of Star Wars: Episode II would have been very difficult to pull off. From crowd rendering to batch processing to compositing, Python binds all things together,” said Tommy Burnette, Senior Technical Director, Industrial Light & Magic.
Python is what I use the most to solve my own problems – Bruce Eckel“ Why I love Python”
Visit the Testing Perspective website to read an online book on Python basics – How Would Pareto Learn(TM) Python Basics! as a part of How Would Pareto Learn project. This was originally posted in the form of blog posts, but now on it will be available only on the website for maintaining a single place of reference.