1. Trang chủ
  2. » Công Nghệ Thông Tin

beginning python - from novice to professional (2005)

641 545 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 641
Dung lượng 13,26 MB

Nội dung

[...]... you can get Python through it ■Note You will probably have to have administrator privileges (a root account) in order to install Python using a package manager in Linux For example, if you’re running Debian Linux, you should be able to install Python with the following command: $ apt-get install python2 .4 If you’re running Gentoo Linux, you should be able to use Portage, like this: $ emerge python In... Go to the download page (refer to steps 1 and 2 in the instructions for installing Python on a Windows system) 2 Follow the instructions for downloading the sources 3 Download the file with the extension tgz Store it in a temporary location Assuming that you want to install Python in your home directory, you may want to put it in a directory such as ~ /python Enter this directory (e.g., using cd ~ /python) ... healthy dose of humor, and true to the traditions of the Python community, much of this humor is related to Monty Python sketches As a consequence, some of my examples may seem a bit silly; I hope you will bear with me (And, yes, the name Python is derived from Monty Python, not from snakes belonging to the family Pythonidae.) In this introduction, I give you a quick look at what Python is, why you should... in the first part of the book) should be possible The projects touch upon a wide range of topics, most of which will be very useful to you when writing programs of your own You will learn how to do things that may seem completely out of reach to you at this point, such as creating a chat server, a peer -to- peer file sharing system, or a full-fledged graphical computer game Although much of the material... these topics, I show you how to write and run larger programs Finally, I deal with strings, an important aspect of almost any Python program Installing Python Before you can start programming, you need some new software What follows is a short description of how to download and install Python If you want to jump into the installation process without detailed guidance, you could simply visit http://www .python. org/download... steps to install the Python RPM packages: 1 Go to the download page (refer to steps 1 and 2 in the instructions for installing Python on a Windows system) 2 Follow the link with the most recent version number, such as Python 2.4.” (Don’t choose a link with the word “sources” in it.) Chances are that this link will be found early on the page For Python 2.4, you could simply go to the URL http://www .python. org/... directory Make sure that you are in the correct directory and that it only contains the packages you want to install If you want to be more careful, you can specify the name of each package separately For more information about RPMs, check out the man page You should now be able to run Python On occasion, you may run into some unresolved dependencies—you may lack other RPM packages needed to install Python. .. The Iterator Protocol 190 Making Sequences from Iterators 191 Generators 191 Making a Generator 191 A Recursive Generator 192 Generators in General 194 Avoiding Generators ... then some of the introductory material might not be new to you (although there will probably be some surprising details here and there) You could skim through the early chapters to get an idea of how Python works, or perhaps read through Appendix A, “The Short Version,” which is based on my online Python tutorial “Instant Python. ” It will get you up to speed on the most important Python concepts After... the binary RPMs Store them in a temporary location (such as ~/rpms/ python) 4 Make sure you are logged in as system administrator (root) and are currently in the directory where you stored the RPMs Make sure there are no other RPMs in this directory 5 Install the packages by executing the command rpm install *.rpm If you already have an older version of Python installed and wish to upgrade, you should . w0 h0" alt="" Beginning Python From Novice to Professional ■■■ Magnus Lie Hetland Hetland_519XFront.fm Page i Tuesday, August 23, 2005 5:04 AM Beginning Python: From Novice to Professional Copyright. Director: Tom Debolski Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-8 00-SPRINGER, fax 20 1-3 4 8-4 505, e-mail. Wong Project Manager: Beckie Stones Copy Edit Manager: Nicole LeClerc Copy Editor: Ami Knox Assistant Production Director: Kari Brooks-Copony Production Editor: Linda Marousek Compositor: Susan Glinert

Ngày đăng: 26/10/2014, 20:10

TỪ KHÓA LIÊN QUAN