Vai al contenuto principale della pagina
Autore: |
Hetland Magnus Lie
![]() |
Titolo: |
Beginning Python : From Novice to Professional
![]() |
Pubblicazione: | Berkeley, CA : , : Apress L. P., , 2024 |
©2024 | |
Edizione: | 4th ed. |
Descrizione fisica: | 1 online resource (620 pages) |
Disciplina: | 005.13/3 |
Soggetto topico: | Python (Computer program language) |
Computer programming | |
Altri autori: |
NelliFabio
![]() |
Nota di contenuto: | Intro -- About the Authors -- About the Technical Reviewers -- Preface -- Introduction -- Chapter 1: Instant Hacking: The Basics -- The Interactive Interpreter -- Algo . . . What? -- Numbers and Expressions -- Hexadecimals Octals and Binary -- Variables -- Statements -- Getting Input from the User -- Functions -- Modules -- cmath and Complex Numbers -- Saving and Executing Your Programs -- Running Your Python Scripts from a Command Prompt -- Making Your Scripts Behave Like Normal Programs -- What About Double-Clicking? -- Comments -- Strings -- Single-Quoted Strings and Escaping Quotes -- Concatenating Strings -- String Representations, str and repr -- Long Strings, Raw Strings, and bytes -- Long Strings -- Raw Strings -- Unicode, bytes, and bytearray -- Summary -- New Functions in This Chapter -- What Now? -- Chapter 2: Lists and Tuples -- Sequence Overview -- Common Sequence Operations -- Indexing -- Slicing -- A Nifty Shortcut -- Longer Steps -- Adding Sequences -- Multiplication -- None, Empty Lists, and Initialization -- Membership -- Length, Minimum, and Maximum -- Lists: Python's Workhorse -- The list Function -- Basic List Operations -- Changing Lists: Item Assignments -- Deleting Elements -- Assigning to Slices -- List Methods -- append -- clear -- copy -- count -- extend -- index -- insert -- pop -- remove -- reverse -- sort -- Advanced Sorting -- Tuples: Immutable Sequences -- Summary -- New Functions in This Chapter -- What Now? -- Chapter 3: Working with Strings -- Basic String Operations -- String Formatting: The Short Version -- String Formatting: The Long Version -- Replacement Field Names -- Basic Conversions -- Width, Precision, and Thousands Separators -- Signs, Alignment, and Zero-Padding -- String Methods -- center -- find -- join -- lower -- replace -- split -- strip -- translate -- Is My String… -- Summary. |
New Functions in This Chapter -- What Now? -- Chapter 4: Dictionaries: When Indices Won't Do -- Dictionary Uses -- Creating and Using Dictionaries -- The dict Function -- Basic Dictionary Operations -- String Formatting with Dictionaries -- Dictionary Methods -- clear -- copy -- fromkeys -- get -- items -- keys -- pop -- popitem -- setdefault -- update -- values -- Summary -- New Functions in This Chapter -- What Now? -- Chapter 5: Conditionals, Loops, and Some Other Statements -- More About print and import -- Printing Multiple Arguments -- Importing Something as Something Else -- Assignment Magic -- Sequence Unpacking -- Chained Assignments -- Augmented Assignments -- Blocks: The Joy of Indentation -- Multiline Editing -- Conditions and Conditional Statements -- So That's What Those Boolean Values Are For -- Conditional Execution and the if Statement -- else Clauses -- elif Clauses -- Nesting Blocks -- More Complex Conditions -- Comparison Operators -- The Equality Operator -- is: The Identity Operator -- in: The Membership Operator -- String and Sequence Comparisons -- Boolean Operators -- Assertions -- Loops -- while Loops -- for Loops -- Iterating Over Dictionaries -- Some Iteration Utilities -- Parallel Iteration -- Numbered Iteration -- Reversed and Sorted Iteration -- Breaking Out of Loops -- break -- continue -- The while True/break Idiom -- else Clauses in Loops -- Comprehensions-Slightly Loopy -- And Three for the Road -- Nothing Happened! -- Deleting with del -- Executing and Evaluating Strings with exec and eval -- exec -- eval -- Summary -- New Functions in This Chapter -- What Now? -- Chapter 6: Abstraction -- Laziness Is a Virtue -- Abstraction and Structure -- Creating Your Own Functions -- Documenting Functions -- Functions That Aren't Really Functions -- The Magic of Parameters -- Where Do the Values Come From?. | |
Can I Change a Parameter? -- Why Would I Want to Modify My Parameters? -- What If My Parameter Is Immutable? -- Keyword Parameters and Defaults -- Collecting Parameters -- Reversing the Process -- Parameter Practice -- Scoping -- Recursion -- Two Classics: Factorial and Power -- Another Classic: Binary Search -- Summary -- New Functions in This Chapter -- What Now? -- Chapter 7: More Abstraction -- The Magic of Objects -- Polymorphism -- Polymorphism and Methods -- Polymorphism Comes in Many Forms -- Encapsulation -- Inheritance -- Classes -- What Is a Class, Exactly? -- Making Your Own Classes -- Attributes, Functions, and Methods -- Privacy Revisited -- The Class Namespace -- Specifying a Superclass -- Investigating Inheritance -- Multiple Superclasses -- Interfaces and Introspection -- Some Thoughts on Object-Oriented Design -- Summary -- New Functions in This Chapter -- What Now? -- Chapter 8: Exceptions -- What Is an Exception? -- Making Things Go Wrong . . . Your Way -- The raise Statement -- Custom Exception Classes -- Catching Exceptions -- Look, Ma, No Arguments! -- More Than One except Clause -- Catching Two Exceptions with One Block -- Catching the Object -- A Real Catchall -- When All Is Well -- And Finally . . . -- Exceptions and Functions -- The Zen of Exceptions -- Not All That Exceptional -- A Quick Summary -- New Functions in This Chapter -- What Now? -- Chapter 9: Magic Methods, Properties, and Iterators -- Constructors -- Overriding Methods in General, and the Constructor in Particular -- Calling the Unbound Superclass Constructor -- Using the super Function -- Item Access -- The Basic Sequence and Mapping Protocol -- Subclassing list, dict, and str -- More Magic -- Properties -- The property Function -- Static Methods and Class Methods -- __getattr__, __setattr__, and Friends -- Iterators -- The Iterator Protocol. | |
Making Sequences from Iterators -- Generators -- Making a Generator -- A Recursive Generator -- Generators in General -- Generator Methods -- Simulating Generators -- The Eight Queens -- Generators and Backtracking -- The Problem -- State Representation -- Finding Conflicts -- The Base Case -- The Recursive Case -- Wrapping It Up -- Summary -- New Functions in This Chapter -- What Now? -- Chapter 10: Batteries Included -- Modules -- Modules Are Programs -- Modules Are Used to Define Things -- Defining a Function in a Module -- Adding Test Code in a Module -- Making Your Modules Available -- Putting Your Module in the Right Place -- Telling the Interpreter Where to Look -- Packages -- Exploring Modules -- What's in a Module? -- Using dir -- The __all__ Variable -- Working with IDE Development Tools -- Getting Help with help -- Documentation -- Use the Source -- The Standard Library: A Few Favorites -- sys -- os -- fileinput -- Sets, Heaps, and Deques -- Sets -- Heaps -- Deques (and Other Collections) -- time -- random -- shelve and json -- A Potential Trap -- A Simple Database Example -- re -- What Is a Regular Expression? -- The Wildcard -- Escaping Special Characters -- Character Sets -- Alternatives and Subpatterns -- Optional and Repeated Subpatterns -- The Beginning and End of a String -- Contents of the re Module -- Match Objects and Groups -- Group Numbers and Functions in Substitutions -- Finding the Sender of an Email -- A Sample Template System -- Other Interesting Standard Modules -- Summary -- New Functions in This Chapter -- What Now? -- Chapter 11: Files and Stuff -- Opening Files -- File Modes -- The Basic File Methods -- Reading and Writing -- Piping Output -- Reading and Writing Lines -- Closing Files -- Using the Basic File Methods -- Iterating Over File Contents -- One Character (or Byte) at a Time -- One Line at a Time. | |
Reading Everything -- Lazy Line Iteration with fileinput -- File Iterators -- CSV Files -- XML Files -- HTML Files -- JSON Files -- Apache Parquet -- Summary -- New Functions in This Chapter -- What Now? -- Chapter 12: Graphical User Interfaces -- Building a Sample GUI Application -- Initial Exploration -- Layout -- Event Handling -- The Final Program -- Using Something Else -- Summary -- What Now? -- Chapter 13: Database Support -- The Python Database API -- Global Variables -- Exceptions -- Connections and Cursors -- Types -- SQLite and PySQLite -- Getting Started -- A Sample Database Application -- Creating and Populating Tables -- Searching and Dealing with Results -- SQL Alchemy -- A Database in a Container with Docker -- Setting Up a PostgreSQL Database with Docker -- Using a PostgreSQL Database with Python -- Using Mongo, a No-SQL Database with Docker and Python -- Summary -- New Functions in This Chapter -- What Now? -- Chapter 14: Network Programming -- A Couple of Networking Modules -- The socket Module -- The urllib3 Module -- Other Modules -- socketserver and http.server -- Multiple Connections -- Enhance an HTTP server with socketserver Forking and Threading -- Asynchronous I/O with asyncio -- Twisted -- Downloading and Installing Twisted -- Writing a Twisted Server -- Summary -- What Now? -- Chapter 15: Python and the Web -- Screen Scraping -- Tidy and XHTML Parsing -- What's Tidy? -- Getting Tidy -- But Why XHTML? -- Using HTMLParser -- Beautiful Soup -- Dynamic Web Pages with CGI -- Step 1: Preparing the Web Server -- Step 2: Adding the Pound Bang Line -- Step 3: Setting the File Permissions -- CGI Security Risks -- A Simple CGI Script -- Debugging with cgitb -- Using the cgi Module -- A Simple Form -- Using a Web Framework -- Other Web Application Frameworks -- Web Services: Scraping Done Right -- RSS and Friends. | |
Remote Procedure Calls with XML-RPC. | |
Sommario/riassunto: | Gain a fundamental understanding of Python’s syntax and features with this revised introductory and practical reference. Covering a wide array of Python–related programming topics, including addressing language internals, database integration, network programming, and web services, you’ll be guided by sound development principles. Updated to reflect the latest in Python programming paradigms and several of the most crucial features found in Python 3, Beginning Python, Fourth Edition also covers advanced topics such as extending Python and packaging/distributing Python applications. Ten accompanying projects will ensure you can get your hands dirty in no time. |
Titolo autorizzato: | Beginning Python ![]() |
ISBN: | 9798868801969 |
9798868801952 | |
Formato: | Materiale a stampa ![]() |
Livello bibliografico | Monografia |
Lingua di pubblicazione: | Inglese |
Record Nr.: | 9910872180803321 |
Lo trovi qui: | Univ. Federico II |
Opac: | Controlla la disponibilità qui |