If you need help writing programs in Python 3, or want to update older Python 2 code, this book is just the ticket. Packed with practical recipes written and tested with Python 3.3, this unique cookbook is for experienced Python programmers who want to focus on modern tools and idioms. Inside, you’ll find complete recipes for more than a dozen topics, covering the core Python language as well as tasks common to a wide variety of application domains. Each recipe contains code samples you can use in your projects right away, along with a discussion about how and why the solution works. Topics include: Data Structures and Algorithms Strings and Text Numbers, Dates, and Times Iterators and Generators Files and I/O Data Encoding and Processing Functions Classes and Objects Metaprogramming Modules and Packages Network and Web Programming Concurrency Utility Scripting and System Administration Testing, Debugging, and Exceptions C Extensions
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.
Useful in many roles, from design and prototyping to testing, deployment, and maintenance, Python is consistently ranked among today’s most popular programming languages. The third edition of this practical book provides a quick reference to the language—including Python 3.5, 2.7, and highlights of 3.6—commonly used areas of its vast standard library, and some of the most useful third-party modules and packages. Ideal for programmers with some Python experience, and those coming to Python from other programming languages, this book covers a wide range of application areas, including web and network programming, XML handling, database interactions, and high-speed numeric computing. Discover how Python provides a unique mix of elegance, simplicity, practicality, and sheer power. This edition covers: Python syntax, Object-Oriented Python, standard library modules, and third-party Python packages Python’s support for file and text operations, persistence and databases, concurrent execution, and numeric computations Networking basics, event-driven programming, and client-side network protocol modules Python extension modules, and tools for packaging and distributing extensions, modules, and applications
MySQL’s popularity has brought a flood of questions about how to solve specific problems, and that’s where this cookbook is essential. When you need quick solutions or techniques, this handy resource provides scores of short, focused pieces of code, hundreds of worked-out examples, and clear, concise explanations for programmers who don’t have the time (or expertise) to solve MySQL problems from scratch. Ideal for beginners and professional database and web developers, this updated third edition covers powerful features in MySQL 5.6 (and some in 5.7). The book focuses on programming APIs in Python, PHP, Java, Perl, and Ruby. With more than 200+ recipes, you’ll learn how to: Use the mysql client and write MySQL-based programs Create, populate, and select data from tables Store, retrieve, and manipulate strings Work with dates and times Sort query results and generate summaries Use stored routines, triggers, and scheduled events Import, export, validate, and reformat data Perform transactions and work with statistics Process web input, and generate web content from query results Use MySQL-based web session management Provide security and server administration
The book kicks off with the fundamentals of starting to use Python with ArcGIS, followed by recipes on managing map documents and layers, including how to find and fix broken data links in these files. In the second part of the book, you will learn to create custom geoprocessing tools and how to use the Attribute and Location tools to select specific features. The third part of the book covers topics for advanced users including the REST API, and also teaches you how to use Python with ArcGIS Pro. The book finishes with appendices covering how to automate Python scripts, and the five things that should be at the back of every GIS programmer's mind.
Over 170 advanced recipes to search, analyze, deploy, manage, and monitor data effectively with Elasticsearch 5.x About This Book Deploy and manage simple Elasticsearch nodes as well as complex cluster topologies Write native plugins to extend the functionalities of Elasticsearch 5.x to boost your business Packed with clear, step-by-step recipes to walk you through the capabilities of Elasticsearch 5.x Who This Book Is For If you are a developer who wants to get the most out of Elasticsearch for advanced search and analytics, this is the book for you. Some understanding of JSON is expected. If you want to extend Elasticsearch, understanding of Java and related technologies is also required. What You Will Learn Choose the best Elasticsearch cloud topology to deploy and power it up with external plugins Develop tailored mapping to take full control of index steps Build complex queries through managing indices and documents Optimize search results through executing analytics aggregations Monitor the performance of the cluster and nodes Install Kibana to monitor cluster and extend Kibana for plugins Integrate Elasticsearch in Java, Scala, Python and Big Data applications In Detail Elasticsearch is a Lucene-based distributed search server that allows users to index and search unstructured content with petabytes of data. This book is your one-stop guide to master the complete Elasticsearch ecosystem. We'll guide you through comprehensive recipes on what's new in Elasticsearch 5.x, showing you how to create complex queries and analytics, and perform index mapping, aggregation, and scripting. Further on, you will explore the modules of Cluster and Node monitoring and see ways to back up and restore a snapshot of an index. You will understand how to install Kibana to monitor a cluster and also to extend Kibana for plugins. Finally, you will also see how you can integrate your Java, Scala, Python, and Big Data applications such as Apache Spark and Pig with Elasticsearch, and add enhanced functionalities with custom plugins. By the end of this book, you will have an in-depth knowledge of the implementation of the Elasticsearch architecture and will be able to manage data efficiently and effectively with Elasticsearch. Style and approach This book follows a problem-solution approach to effectively use and manage Elasticsearch. Each recipe focuses on a particular task at hand, and is explained in a very simple, easy to understand manner.
Author: Steven F. Lott
Publisher: Packt Publishing Ltd
Release Date: 2016-11-30
The latest in modern Python recipes for the busy modern programmer About This Book Develop succinct, expressive programs in Python Learn the best practices and common idioms through carefully explained and structured recipes Discover new ways to apply Python for the new age of development Who This Book Is For The book is for web developers, programmers, enterprise programmers, engineers, big data scientist, and so on. If you are a beginner, Python Cookbook will get you started. If you are experienced, it will expand your knowledge base. A basic knowledge of programming would help. What You Will Learn See the intricate details of the Python syntax and how to use it to your advantage Improve your code readability through functions in Python Manipulate data effectively using built-in data structures Get acquainted with advanced programming techniques in Python Equip yourself with functional and statistical programming features Write proper tests to be sure a program works as advertised Integrate application software using Python In Detail Python is the preferred choice of developers, engineers, data scientists, and hobbyists everywhere. It is a great scripting language that can power your applications and provide great speed, safety, and scalability. By exposing Python as a series of simple recipes, you can gain insight into specific language features in a particular context. Having a tangible context helps make the language or standard library feature easier to understand. This book comes with over 100 recipes on the latest version of Python. The recipes will benefit everyone ranging from beginner to an expert. The book is broken down into 13 chapters that build from simple language concepts to more complex applications of the language. The recipes will touch upon all the necessary Python concepts related to data structures, OOP, functional programming, as well as statistical programming. You will get acquainted with the nuances of Python syntax and how to effectively use the advantages that it offers. You will end the book equipped with the knowledge of testing, web services, and configuration and application integration tips and tricks. The recipes take a problem-solution approach to resolve issues commonly faced by Python programmers across the globe. You will be armed with the knowledge of creating applications with flexible logging, powerful configuration, and command-line options, automated unit tests, and good documentation. Style and approach This book takes a recipe-based approach, where each recipe addresses specific problems and issues. The recipes provide discussions and insights and an explanation of the problems.
Author: Ian F. Darwin
Publisher: "O'Reilly Media, Inc."
Release Date: 2014-06-25
From lambda expressions and JavaFX 8 to new support for network programming and mobile development, Java 8 brings a wealth of changes. This cookbook helps you get up to speed right away with hundreds of hands-on recipes across a broad range of Java topics. You’ll learn useful techniques for everything from debugging and data structures to GUI development and functional programming. Each recipe includes self-contained code solutions that you can freely use, along with a discussion of how and why they work. If you are familiar with Java basics, this cookbook will bolster your knowledge of the language in general and Java 8’s main APIs in particular. Recipes include: Methods for compiling, running, and debugging Manipulating, comparing, and rearranging text Regular expressions for string- and pattern-matching Handling numbers, dates, and times Structuring data with collections, arrays, and other types Object-oriented and functional programming techniques Directory and filesystem operations Working with graphics, audio, and video GUI development, including JavaFX and handlers Network programming on both client and server Database access, using JPA, Hibernate, and JDBC Processing JSON and XML for data storage Multithreading and concurrency
Over 80 object-oriented recipes to help you create amazing GUIs in PythonAbout This Book* Based on the latest version of Python, 3.6* Carefully organized instructions to solve problems efficiently* Solutions that can be applied to solve real-world problemsWho This Book Is ForThis book is for intermediate Python programmers who wish to enhance their Python skills by writing powerful GUIs in Python. As Python is such a great and easy to learn language, this book is also ideal for any developer with experience of other languages and enthusiasm to expand their horizon.What you will learn* Create the GUI Form and add widgets* Arrange the widgets using layout managers* Use object-oriented programming to create GUIs* Create Matplotlib charts* Use threads and talking to networks* Talk to a MySQL database via the GUI* Perform unit-testing and internationalizing the GUI* Extend the GUI with third-party graphical libraries* Get to know the best practices to create GUIsIn DetailExplore the beautiful world of GUI development using the Python programming language. You will learn how easy it is to get started and you might be surprised how advanced you can become in just a short time of coding. GUI development using Python is not a very well-known subject. The built-in tkinter GUI framework was limited, but with the latest versions of Python 3 and tkinter, all of this has dramatically changed.This book will guide you from the very basics of creating a fully functional GUI in Python with only a few lines of code. Each and every recipe adds more widgets to the GUIs we are creating. While the cookbook recipes all stand on their own, there is a common theme running through all of them. As our GUIs keep expanding, using more and more widgets, we start to talk to networks, databases, and graphical libraries that greatly enhance our GUI's functionality.
Develop sophisticated mapping applications from scratch using Python 3 tools for geospatial development About This Book Build web applications based around maps and geospatial data using Python 3.x Install and use various toolkits and obtain geospatial data for use in your programs This practical, hands-on book will teach you all about geospatial development in Python Who This Book Is For This book is for experienced Python developers who want to learn about geospatial concepts, obtain and work with geospatial data, solve spatial problems, and build sophisticated map-based applications using Python. What You Will Learn Access, manipulate, and display geospatial data from within your Python programs Master the core geospatial concepts of location, distance, units, projections, and datums Read and write geospatial data in both vector and raster format Perform complex, real-world geospatial calculations using Python Store and access geospatial information in a database Use points, lines, and polygons within your Python programs Convert geospatial data into attractive maps using Python-based tools Build complete web-based mapping applications using Python In Detail Geospatial development links your data to locations on the surface of the Earth. Writing geospatial programs involves tasks such as grouping data by location, storing and analyzing large amounts of spatial information, performing complex geospatial calculations, and drawing colorful interactive maps. In order to do this well, you'll need appropriate tools and techniques, as well as a thorough understanding of geospatial concepts such as map projections, datums, and coordinate systems. This book provides an overview of the major geospatial concepts, data sources, and toolkits. It starts by showing you how to store and access spatial data using Python, how to perform a range of spatial calculations, and how to store spatial data in a database. Further on, the book teaches you how to build your own slippy map interface within a web application, and finishes with the detailed construction of a geospatial data editor using the GeoDjango framework. By the end of this book, you will be able to confidently use Python to write your own geospatial applications ranging from quick, one-off utilities to sophisticated web-based applications using maps and other geospatial data. Style and approach This book is a comprehensive course in geospatial development. The concepts you need to know are presented in a hands-on fashion with example code to help you to solve real-world problems right away. Larger programs are built up step by step while guiding you through the process of building your own sophisticated mapping applications.
Author: Laura E. Hunter
Publisher: "O'Reilly Media, Inc."
Release Date: 2008-12-16
When you need practical hands-on support for Active Directory, the updated edition of this extremely popular Cookbook provides quick solutions to more than 300 common (and uncommon) problems you might encounter when deploying, administering, and automating Microsoft's network directory service. For the third edition, Active Directory expert Laura E. Hunter offers troubleshooting recipes based on valuable input from Windows administrators, in addition to her own experience. You'll find solutions for the Lightweight Directory Access Protocol (LDAP), ADAM (Active Directory Application Mode), multi-master replication, Domain Name System (DNS), Group Policy, the Active Directory Schema, and many other features. The Active Directory Cookbook will help you: Perform Active Directory tasks from the command line Use scripting technologies to automate Active Directory tasks Manage new Active Directory features, such as Read-Only Domain Controllers, fine-grained password policies, and more Create domains and trusts Locate users whose passwords are about to expire Apply a security filter to group policy objects Check for potential replication problems Restrict hosts from performing LDAP queries View DNS server performance statistics Each recipe includes a discussion explaining how and why the solution works, so you can adapt the problem-solving techniques to similar situations. Active Directory Cookbook is ideal for any IT professional using Windows Server 2008, Exchange 2007, and Identity Lifecycle Manager 2007, including Active Directory administrators looking to automate task-based solutions. "It is rare for me to visit a customer site and not see a copy of Active Directory Cookbook on a shelf somewhere, which is a testament to its usefulness. The Cookbook takes the pain out of everyday AD tasks by providing concise, clear and relevant recipes. The fact that the recipes are provided using different methods (graphical user interface, command line and scripting) means that the book is suitable for anyone working with AD on a day-to-day basis. The introduction of PowerShell examples in this latest edition will be of particular interest for those looking to transition from VBScript. Laura has also done a great job in extending the Cookbook in this edition to encompass the broad range of changes to AD in Windows Server 2008." --Tony Murray, Founder of Activedir.org and Directory Services MVP "If you already understand Active Directory fundamentals and are looking fora quick solution to common Active Directory related tasks, look no further,you have found the book that you need." --joe Richards, Directory Services MVP "The Active Directory Cookbook is the real deal... a soup-to-nuts catalog of every administrative task an Active Directory administrator needs to perform. If you administer an Active Directory installation, this is the very first book you have to put on your shelf." --Gil Kirkpatrick, Chief Architect, Active Directory and Identity Management, Quest Software and Directory Services MVP
Python’s simplicity lets you become productive quickly, but this often means you aren’t using everything it has to offer. With this hands-on guide, you’ll learn how to write effective, idiomatic Python code by leveraging its best—and possibly most neglected—features. Author Luciano Ramalho takes you through Python’s core language features and libraries, and shows you how to make your code shorter, faster, and more readable at the same time. Many experienced programmers try to bend Python to fit patterns they learned from other languages, and never discover Python features outside of their experience. With this book, those Python programmers will thoroughly learn how to become proficient in Python 3. This book covers: Python data model: understand how special methods are the key to the consistent behavior of objects Data structures: take full advantage of built-in types, and understand the text vs bytes duality in the Unicode age Functions as objects: view Python functions as first-class objects, and understand how this affects popular design patterns Object-oriented idioms: build classes by learning about references, mutability, interfaces, operator overloading, and multiple inheritance Control flow: leverage context managers, generators, coroutines, and concurrency with the concurrent.futures and asyncio packages Metaprogramming: understand how properties, attribute descriptors, class decorators, and metaclasses work