Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
English.docx
Скачиваний:
0
Добавлен:
01.07.2025
Размер:
14.4 Кб
Скачать

Introduction

Scripting languages are often used to do repetitive, tedious work at a rate and with an

accuracy that far surpass what you could accomplish without them. All languages are

tools. They are simply a means to get work done. They have value only insofar as they help you get your job done better. Python is a valuable tool, specifically because it enables you to get your work done efficiently.

So is Python better than any other language? It’s really difficult to put that sort of qualitative label on a programming language, since the tool is so closely tied to the thought process of the programmer who is using it. Programming is a subjective, deeply personal activity. For the language to be excellent, it must fit the person using it. So there are some reasons why you may try to use Python.

The first reason that we think that Python is excellent is that it is easy to learn. If a language can’t help you become productive pretty quickly, the lure of that language is

severely diminished. This is especially the case for sysadmins.

However, a language that is easy to learn but doesn’t allow you to do fairly complex tasks isn’t worth much either. So the second reason that I consider Python to be an excellent programming language is that, while it lets you start simply, it also allows you to perform tasks that are as complex as you can imagine.

The next reason is its readability. Python relies on whitespace to determine where code blocks begin and end. The indentation helps your eyes quickly follow the flow of a program. Python also tends to be “word-based.” By that we mean that while Python uses its share of special characters, features are often implemented as keywords or with libraries. The emphasis on words rather than special characters helps the reading and comprehension of code.

The Python Standard Library is another excellent attribute of Python. For example, though it isn’t built-in to the language directly, Python includes regular expression functionality; sockets; threads; date/time functionality; XML parsers; config file parser; file and directory functionality; data persistence; unit test capabilities; and http, ftp, imap, smpt, and nntp client libraries; and much more. So once Python is installed, modules to support all of these functions will be imported by your scripts as they are needed. You have all the functionality we just listed here. It is impressive that all of this comes with Python without requiring anything else. All of this functionality will help you out immensely as you write Python programs to do work for you.

So, if you have interested right now, try to read forward and maybe you will really like Python and will start to learn it immediately.

Base Motivation

You may be asking yourself, how hard it is going to be to learn Python and if it is even worth it. Although Python is catching on like wildfire, there are many sysadmins who have been exposed to Bash and Perl only. If you find yourself in this category, you should take comfort in knowing that Python is very easy to learn. In fact, although it is a matter of opinion, Python is considered by many to be the easiest lan-

guage to learn and teach, period!

If you already know Python, or are a programming guru in another language, you will

be able to download good book about programming into Python without reading this

text and immediately start being productive using examples.

You can learn Python quite easily. You need only motivation, curiosity, and determination, the same factors that led you to pick up some book and look at the in-

troduction in the first place.

But there are still a few skeptics out there. Maybe some of the things you have heard about programming have scared you. One common, and horribly false, misconception is that only some people can learn to program, and they are a mysterious and elite few. The frank truth is that anyone can learn how to program. A second, equally false, misconception is that earning a computer science degree is the only way a person can truly become a software engineer. But some of the most prolific software developers

do not have engineering degrees. There are people with philosophy, journalism, nutritional science, and English degrees who are competent Python programmers.

Having a degree in computer science is not a requirement to learn Python, although it

certainly doesn’t hurt.

Another funny, and false, misconception is that you must have started to program in

your teenage years, or you will never learn to program. While this makes people who

were lucky enough to have someone in their life that encouraged them to program at

a young age feel good, it is another myth. It is very helpful to have started learning

programming at a young age, but age is not a requirement to learn Python. Learning

Python is most certainly not a “young person’s game,” as we have heard some people

say. There are countless cases of developers who learned to program in their late 20s,

30s, 40s, and onward.

If you have gotten this far, we should point out that you, the reader, have an advantage many people do not. If you decided to pick up a book on Python for Unix and Linux system administration, then you most likely know something about how to execute commands from a shell. This is a tremendous advantage to learning to become a Python programmer. Having an understanding of the way to execute commands from a terminal is all that is required for this introduction to Python. If you truly believe you will learn how to program with Python, then read the next section immediately. If you don’t believe it yet, then reread this section again, and convince yourself it really is just a matter of getting your mind to understand you do have the power to learn how to program in Python. It is really that simple; if you make this decision, it will change your life.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]