SØG - mellem flere end 8 millioner bøger:

Søg på: Titel, forfatter, forlag - gerne i kombination.
Eller blot på isbn, hvis du kender dette.

Viser: Python Cookbook

Python Cookbook, 2. udgave

Python Cookbook

Alex Martelli, Anna Ravenscroft og David Ascher
Sprog: Engelsk
O'Reilly Media, Incorporated
468,00 kr.
Denne titel er udgået og kan derfor ikke bestilles. Vi beklager.
Denne bog er blevet erstattet af Python Cookbook, 3. udgave

Detaljer om varen

  • 2. Udgave
  • Paperback: 846 sider
  • Udgiver: O'Reilly Media, Incorporated (Marts 2005)
  • Forfattere: Alex Martelli, Anna Ravenscroft og David Ascher
  • ISBN: 9780596007973

Portable, powerful, and a breeze to use, Python is the popular open source object-oriented programming language used for both standalone programs and scripting applications. It is now being used by an increasing number of major organizations, including NASA and Google.Updated for Python 2.4, The Python Cookbook, 2nd Edition offers a wealth of useful code for all Python programmers, not just advanced practitioners. Like its predecessor, the new edition provides solutions to problems that Python programmers face everyday.It now includes over 200 recipes that range from simple tasks, such as working with dictionaries and list comprehensions, to complex tasks, such as monitoring a network and building a templating system. This revised version also includes new chapters on topics such as time, money, and metaprogramming.Here's a list of additional topics covered:

  • Manipulating text
  • Searching and sorting
  • Working with files and the filesystem
  • Object-oriented programming
  • Dealing with threads and processes
  • System administration
  • Interacting with databases
  • Creating user interfaces
  • Network and web programming
  • Processing XML
  • Distributed programming
  • Debugging and testing
Another advantage of The Python Cookbook, 2nd Edition is its trio of authors--three well-known Python programming experts, who are highly visible on email lists and in newsgroups, and speak often at Python conferences.With scores of practical examples and pertinent background information, The Python Cookbook, 2nd Edition is the one source you need if you're looking to build efficient, flexible, scalable, and well-integrated systems.
Preface; The Design of the Book; The Implementation of the Book; Using the Code from This Book; Audience; Organization; Further Reading; Conventions Used in This Book; How to Contact Us; Safari® Enabled; Acknowledgments;
Chapter 1: Text;
1.1 Introduction;
1.1 Processing a String One Character at a Time;
1.2 Converting Between Characters and Numeric Codes;
1.3 Testing Whether an Object Is String-like;
1.4 Aligning Strings;
1.5 Trimming Space from the Ends of a String;
1.6 Combining Strings;
1.7 Reversing a String by Words or Characters;
1.8 Checking Whether a String Contains a Set of Characters;
1.9 Simplifying Usage of Strings'' translate Method;
1.10 Filtering a String for a Set of Characters;
1.11 Checking Whether a String Is Text or Binary;
1.12 Controlling Case;
1.13 Accessing Substrings;
1.14 Changing the Indentation of a Multiline String;
1.15 Expanding and Compressing Tabs;
1.16 Interpolating Variables in a String;
1.17 Interpolating Variables in a Stringin Python
1.18 Replacing Multiple Patterns in a Single Pass;
1.19 Checking a String for Any of Multiple Endings;
1.20 Handling International Text with Unicode;
1.21 Converting Between Unicode and Plain Strings;
1.22 Printing Unicode Charactersto Standard Output;
1.23 Encoding Unicode Data for XML and HTML;
1.24 Making Some Strings Case-Insensitive;
1.25 Converting HTML Documents to Texton a Unix Terminal;
Chapter 2: Files;
2.1 Introduction;
2.1 Reading from a File;
2.2 Writing to a File;
2.3 Searching and Replacing Text in a File;
2.4 Reading a Specific Line from a File;
2.5 Counting Lines in a File;
2.6 Processing Every Word in a File;
2.7 Using Random-Access Input/Output;
2.8 Updating a Random-Access File;
2.9 Reading Data from zip Files;
2.10 Handling a zip File Inside a String;
2.11 Archiving a Tree of Files into a Compressed tar File;
2.12 Sending Binary Data to Standard Output Under Windows;
2.13 Using a C++-like iostream Syntax;
2.14 Rewinding an Input File to the Beginning;
2.15 Adapting a File-like Object to a True File Object;
2.16 Walking Directory Trees;
2.17 Swapping One File Extension for Another Throughout a Directory Tree;
2.18 Finding a File Given a Search Path;
2.19 Finding Files Given a Search Path and a Pattern;
2.20 Finding a File on the Python Search Path;
2.21 Dynamically Changing the PythonSearch Path;
2.22 Computing the Relative Path from One Directory to Another;
2.23 Reading an Unbuffered Character in a Cross-Platform Way;
2.24 Counting Pages of PDF Documents on Mac OS X;
2.25 Changing File Attributes on Windows;
2.26 Extracting Text from OpenOffice.org Documents;
2.27 Extracting Text from Microsoft Word Documents;
2.28 File Locking Using a Cross-Platform API;
2.29 Versioning Filenames;
2.30 Calculating CRC-64 Cyclic Redundancy Checks;
Chapter 3: Time and Money;
3.1 Introduction;
3.1 Calculating Yesterday and Tomorrow;
3.2 Finding Last Friday;
3.3 Calculating Time Periods in a Date Range;
3.4 Summing Durations of Songs;
3.5 Calculating the Number of Weekdays Between Two Dates;
3.6 Looking up Holidays Automatically;
3.7 Fuzzy Parsing of Dates;
3.8 Checking Whether Daylight Saving Time Is Currently in Effect;
3.9 Converting Time Zones;
3.10 Running a Command Repeatedly;
3.11 Scheduling Commands;
3.12 Doing Decimal Arithmetic;
3.13 Formatting Decimals as Currency;
3.14 Using Python as a Simple Adding Machine;
3.15 Checking a Credit Card Checksum;
3.16 Watching Foreign Exchange Rates;
Chapter 4: Python Shortcuts;
4.1 Introduction;
4.1 Copying an Object;
4.2 Constructing Lists with List Comprehensions;
4.3 Returning an Element of a List If It Exists;
4.4 Looping over Items and Their Indices in a Sequence;
4.5 Creating Lists of Lists Without Sharing References;
4.6 Flattening a Nested Sequence;
4.7 Removing or Reordering Columnsin a List of Rows;
4.8 Transposing Two-Dimensional Arrays;
4.9 Getting a Value from a Dictionary;
4.10 Adding an Entry to a Dictionary;
4.11 Building a Dictionary Without Excessive Quoting;
4.12 Building a Dict from a List of Alternating Keys and Values;
4.13 Extracting a Subset of a Dictionary;
4.14 Inverting a Dictionary;
4.15 Associating Multiple Values with Each Key in a Dictionary;
4.16 Using a Dictionary to Dispatch Methods or Functions;
4.17 Finding Unions and Intersections of Dictionaries;
4.18 Collecting a Bunch of Named Items;
4.19 Assigning and Testing with One Statement;
4.20 Using printf in Python;
4.21 Randomly Picking Items with Given Probabilities;
4.22 Handling Exceptions Within an Expression;
4.23 Ensuring a Name Is Defined in a Given Module;
Chapter 5: Searching and Sorting;
5.1 Introduction;
5.1 Sorting a Dictionary;
5.2 Sorting a List of Strings Case-Insensitively;
5.3 Sorting a List of Objects by an Attribute of the Objects;
5.4 Sorting Keys or Indices Basedon the Corresponding Values;
5.5 Sorting Strings with Embedded Numbers;
5.6 Processing All of a List''s Items in Random Order;
5.7 Keeping a Sequence Ordered as Items Are Added;
5.8 Getting the First Few Smallest Items of a Sequence;
5.9 Looking for Items in a Sorted Sequence;
5.10 Selecting the nth Smallest Element of a Sequence;
5.11 Showing off quicksort in Three Lines;
5.12 Performing Frequent Membership Tests on a Sequence;
5.13 Finding Subsequences;
5.14 Enriching the Dictionary Type with Ratings Functionality;
5.15 Sorting Names and Separating Them by Initials;
Chapter 6: Object-Oriented Programming;
6.1 Introduction;
6.1 Converting Among Temperature Scales;
6.2 Defining Constants;
6.3 Restricting Attribute Setting;
6.4 Chaining Dictionary Lookups;
6.5 Delegating Automatically as an Alternative to Inheritance;
6.6 Delegating Special Methods in Proxies;
6.7 Implementing Tuples with Named Items;
6.8 Avoiding Boilerplate Accessors for Properties;
6.9 Making a Fast Copy of an Object;
6.10 Keeping References to Bound Methods Without Inhibiting Garbage Collection;
6.11 Implementing a Ring Buffer;
6.12 Checking an Instance for Any State Changes;
6.13 Checking Whether an Object Has Necessary Attributes;
6.14 Implementing the State Design Pattern;
6.15 Implementing the "Singleton" Design Pattern;
6.16 Avoiding the "Singleton" Design Pattern with the Borg Idiom;
6.17 Implementing the Null Object Design Pattern;
6.18 Automatically Initializing Instance Variables from _ _init_ _ Arguments;
6.19 Calling a Superclass _ _init_ _ Method If It Exists;
6.20 Using Cooperative Supercalls Concisely and Safely;
Chapter 7: Persistence and Databases;
7.1 Introduction;
7.1 Serializing Data Using the marshal Module;
7.2 Serializing Data Using the pickle and cPickle Modules;
7.3 Using Compression with Pickling;
7.4 Using the cPickle Module on Classes and Instances;
7.5 Holding Bound Methods in a Picklable Way;
7.6 Pickling Code Objects;
7.7 Mutating Objects with shelve;
7.8 Using the Berkeley DB Database;
7.9 Accessing a MySQL Database;
7.10 Storing a BLOB in a MySQL Database;
7.11 Storing a BLOB in a PostgreSQL Database;
7.12 Storing a BLOB in a SQLite Database;
7.13 Generating a Dictionary Mapping Field Names to Column Numbers;
7.14 Using dtuple for Flexible Accessto Query Results;
7.15 Pretty-Printing the Contents of Database Cursors;
7.16 Using a Single Parameter-Passing Style Across Various DB API Modules;
7.17 Using Microsoft Jet via ADO;
7.18 Accessing a JDBC Database from a Jython Servlet;
7.19 Using ODBC to Get Excel Data with Jython;
Chapter 8: Debugging and Testing;
8.1 Introduction;
8.1 Disabling Execution of Some Conditionals and Loops;
8.2 Measuring Memory Usage on Linux;
8.3 Debugging the Garbage-Collection Process;
8.4 Trapping and Recording Exceptions;
8.5 Tracing Expressions and Comments in Debug Mode;
8.6 Getting More Information from Tracebacks;
8.7 Starting the Debugger Automatically After an Uncaught Exception;
8.8 Running Unit Tests Most Simply;
8.9 Running Unit Tests Automatically;
8.10 Using doctest with unittest in Python
8.11 Checking Values Against Intervals in Unit Testing;
Chapter 9: Processes, Threads, and Synchronization;
9.1 Introduction;
9.1 Synchronizing All Methods in an Object;
9.2 Terminating a Thread;
9.3 Using a Queue.Queue as a Priority Queue;
9.4 Working with a Thread Pool;
9.5 Executing a Function in Parallel on Multiple Argument Sets;
9.6 Coordinating Threads by Simple Message Passing;
9.7 Storing Per-Thread Information;
9.8 Multitasking Cooperatively Without Threads;
9.9 Determining Whether Another Instanceof a Script Is Already Running in Windows;
9.10 Processing Windows Messages Using MsgWaitForMultipleObjects;
9.11 Driving an External Process with popen;
9.12 Capturing the Output and Error Streams from a Unix Shell Command;
9.13 Forking a Daemon Process on Unix;
Chapter 10: System Administration;
10.1 Introduction;
10.1 Generating Random Passwords;
10.2 Generating Easily Remembered Somewhat-Random Passwords;
10.3 Authenticating Users by Means of a POP Server;
10.4 Calculating Apache Hits per IP Address;
10.5 Calculating the Rate of Client Cache Hits on Apache;
10.6 Spawning an Editor from a Script;
10.7 Backing Up Files;
10.8 Selectively Copying a Mailbox File;
10.9 Building a Whitelist of Email Addresses From a Mailbox;
10.10 Blocking Duplicate Mails;
10.11 Checking Your Windows Sound System;
10.12 Registering or Unregistering a DLL on Windows;
10.13 Checking and Modifying the Set of Tasks Windows Automatically Runs at Login;
10.14 Creating a Share on Windows;
10.15 Connecting to an Already Running Instance of Internet Explorer;
10.16 Reading Microsoft Outlook Contacts;
10.17 Gathering Detailed System Informationon Mac OS X;
Chapter 11: User Interfaces;
11.1 Introduction;
11.1 Showing a Progress Indicator on a Text Console;
11.2 Avoiding lambda in Writing Callback Functions;
11.3 Using Default Values and Bounds with tkSimpleDialog Functions;
11.4 Adding Drag and Drop Reordering to a Tkinter Listbox;
11.5 Entering Accented Characters in Tkinter Widgets;
11.6 Embedding Inline GIFs Using Tkinter;
11.7 Converting Among Image Formats;
11.8 Implementing a Stopwatch in Tkinter;
11.9 Combining GUIs and Asynchrono
De oplyste priser er inkl. moms

Nyheder indenfor byggeri og konstruktion:

Stålkonstruktioner - Beregningseksempler efter Eurocode 3, 2. udgave
Stålkonstruktioner - ...
Af Thomas Hansen og...
Pris: 599,00 kr.
TRÆ 79: Trægulve, 1. udgave
TRÆ 79: Trægulve
Pris: 993,75 kr.
Livet Mellem Husene, 8. udgave
Livet Mellem Husene
Af Jan Gehl
Pris: 248,00 kr.
Den bæredygtige projektleder, 1. udgave
Den bæredygtige proje...
Af Pernille Ingilds...
Pris: 449,00 kr.
Betonkonstruktioner - Beregningseksempler efter Eurocode 2, 1. udgave
Betonkonstruktioner -...
Af Henning H. Laust...
Pris: 649,00 kr.
SBI 277 Fugt i bygninger - Teori, beregning og undersøgelse - SBI anvisning 277, 1. udgave
SBI 277 Fugt i bygnin...
Pris: 380,00 kr.
SBI 278 Fugt i bygninger - Projektering og udførelse - SBI anvisning 278, 1. udgave
SBI 278 Fugt i bygnin...
Pris: 360,00 kr.
SBI 279 Fugt i bygninger - Bygningsdele - SBI anvisning 279, 1. udgave
SBI 279 Fugt i bygnin...
Pris: 360,00 kr.
Videnskabsteori og opgaveskrivning for bygningskonstruktører, 1. udgave
Videnskabsteori og op...
Af Jan Johansson
Pris: 299,00 kr.
Teknisk Ståbi - 26. udgave, 26. udgave
Teknisk Ståbi - 26. u...
Af Bjarne Christian...
Pris: 700,00 kr.
Byggeprocessen, 8. udgave
Af Mathiias Brynulf...
Pris: 389,00 kr.
Bygningsberegninger, 3. udgave
Af Svend Ole Hansen...
Pris: 529,00 kr.
Metallurgi - For ingeniører, 10. udgave
Af Jan Pedersen
Pris: 799,00 kr.

Senest sete

Polyteknisk Boghandel

har gennem mere end 50 år været studieboghandlen på DTU og en af Danmarks førende specialister i faglitteratur.


Vi lagerfører et bredt udvalg af bøger, ikke bare inden for videnskab og teknik, men også f.eks. ledelse, IT og meget andet.

Læs mere her

Trykt eller digital bog?

Ud over trykte bøger tilbyder vi tre forskellige typer af digitale bøger:


Vital Source Bookshelf: En velfungerende ebogsplatform, hvor bogen downloades til din computer og/eller mobile enhed.


Du skal bruge den gratis Bookshelf software til at læse læse bøgerne - der er indbygget gode værktøjer til f.eks. søgning, overstregning, notetagning mv. I langt de fleste tilfælde vil du samtidig have en sideløbende 1825 dages online adgang. Læs mere om Vital Source bøger


Levering: I forbindelse med købet opretter du et login. Når du har installeret Bookshelf softwaren, logger du blot ind og din bog downloades automatisk.



Adobe ebog: Dette er Adobe DRM ebøger som downloades til din lokale computer eller mobil enhed.


For at læse bøgerne kræves særlig software, som understøtter denne type. Softwaren er gratis, men du bør sikre at du har rettigheder til installere software på den maskine du påtænker at anvende den på. Læs mere om Adobe DRM bøger


Levering: Et download link sendes pr email umiddelbart efter købet.


Ibog: Dette er en online bog som kan læses på udgiverens website. 

Der kræves ikke særlig software, bogen læses i en almindelig browser.


Levering: Vores medarbejder sender dig en adgangsnøgle pr email.


Vi gør opmærksom på at der ikke er retur/fortrydelsesret på digitale varer.