Beginning Python : From Novice to Professional |
Autore | Hetland Magnus Lie |
Edizione | [4th ed.] |
Pubbl/distr/stampa | Berkeley, CA : , : Apress L. P., , 2024 |
Descrizione fisica | 1 online resource (620 pages) |
Disciplina | 005.13/3 |
Altri autori (Persone) | NelliFabio |
ISBN |
9798868801969
9798868801952 |
Formato | Materiale a stampa ![]() |
Livello bibliografico | Monografia |
Lingua di pubblicazione | eng |
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. |
Record Nr. | UNINA-9910872180803321 |
Hetland Magnus Lie
![]() |
||
Berkeley, CA : , : Apress L. P., , 2024 | ||
![]() | ||
Lo trovi qui: Univ. Federico II | ||
|
Beginning Python [[electronic resource] ] : From Novice to Professional / / by Magnus Lie Hetland |
Autore | Hetland Magnus Lie |
Edizione | [3rd ed. 2017.] |
Pubbl/distr/stampa | Berkeley, CA : , : Apress : , : Imprint : Apress, , 2017 |
Descrizione fisica | 1 online resource (XXXII, 527 p. 32 illus., 1 illus. in color.) |
Disciplina | 005.133 |
Soggetto topico |
Python (Computer program language)
Computer science Python Computer Science, general |
ISBN | 1-4842-0028-4 |
Formato | Materiale a stampa ![]() |
Livello bibliografico | Monografia |
Lingua di pubblicazione | eng |
Nota di contenuto | Ch. 1 Instant hacking : the basics -- Ch. 2 Lists and tuples -- Ch. 3 Working with strings -- Ch. 4 Dictionaries : when indices won't do -- Ch. 5 Conditionals, loops, and some other statements -- Ch. 6 Abstraction -- Ch. 7 More abstraction -- Ch. 8 Exceptions -- Ch. 9 Magic methods, properties, and iterators -- Ch. 10 Batteries included -- Ch. 11 Files and stuff -- Ch. 12 Graphical user interfaces -- Ch. 13 Database support -- Ch. 14 Network programming -- Ch. 15 Python and the Web -- Ch. 16 Testing, 1-2-3 -- Ch. 17 Extending Python -- Ch. 18 Packaging your programs -- Ch. 19 Playful programming -- Ch. 20 Project 1 : instant markup -- Ch. 21 Project 2 : painting a pretty picture -- Ch. 22 Project 3 : XML for all occasions -- Ch. 23 Project 4 : in the news -- Ch. 24 Project 5 : a virtual tea party -- Ch. 25 Project 6 : remote editing with CGI -- Ch. 26 Project 7 : your own bulletin board -- Ch. 27 Project 8 : file sharing with XML-RPC -- Ch. 28 Project 9 : file sharing II - now with GUI! -- Ch. 29 Project 10 : do-it-yourself arcade game -- Appendix A: The Short Version -- Appendix B: Python Reference. |
Record Nr. | UNINA-9910254566303321 |
Hetland Magnus Lie
![]() |
||
Berkeley, CA : , : Apress : , : Imprint : Apress, , 2017 | ||
![]() | ||
Lo trovi qui: Univ. Federico II | ||
|
Python algorithms [[electronic resource] ] : mastering basic algorithms in the Python language / / by Magnus Lie Hetland |
Autore | Hetland Magnus Lie |
Edizione | [2nd ed. 2014.] |
Pubbl/distr/stampa | Berkeley, CA : , : Apress : , : Imprint : Apress, , 2014 |
Descrizione fisica | 1 online resource (303 p.) |
Disciplina | 004 |
Collana | Expert's Voice in Phyton |
Soggetto topico |
Python (Computer program language)
Software engineering Computer software Python Software Engineering/Programming and Operating Systems Mathematical Software |
ISBN | 1-4842-0055-1 |
Formato | Materiale a stampa ![]() |
Livello bibliografico | Monografia |
Lingua di pubblicazione | eng |
Nota di contenuto |
""Contents at a Glance""; ""Contents""; ""About the Author""; ""About the Technical Reviewer""; ""Acknowledgments""; ""Preface""; ""Chapter 1: Introduction""; ""What�s All This, Then?""; ""Why Are You Here?""; ""Some Prerequisites""; ""What�s in This Book""; ""Summary""; ""If You�re Curious �""; ""Exercises""; ""References""; ""Chapter 2: The Basics""; ""Some Core Ideas in Computing""; ""Asymptotic Notation""; ""It�s Greek to Me!""; ""Rules of the Road""; ""Taking the Asymptotics for a Spin""; ""Three Important Cases""; ""Empirical Evaluation of Algorithms""
""Implementing Graphs and Trees""""Adjacency Lists and the Like""; ""Adjacency Matrices""; ""Implementing Trees""; ""A Multitude of Representations""; ""Beware of Black Boxes""; ""Hidden Squares""; ""The Trouble with Floats""; ""Summary""; ""If You�re Curious �""; ""Exercises""; ""References""; ""Chapter 3: Counting 101""; ""The Skinny on Sums""; ""More Greek""; ""Working with Sums""; ""A Tale of Two Tournaments""; ""Shaking Hands""; ""The Hare and the Tortoise""; ""Subsets, Permutations, and Combinations""; ""Recursion and Recurrences""; ""Doing It by Hand""; ""A Few Important Examples"" ""Guessing and Checking""""The Master Theorem: A Cookie-Cutter Solution""; ""So What Was All That About?""; ""Summary""; ""If You�re Curious ...""; ""Exercises""; ""References""; ""Chapter 4: Induction and Recursion ... and Reduction""; ""Oh, That�s Easy!""; ""One, Two, Many""; ""Mirror, Mirror""; ""Designing with Induction (and Recursion)""; ""Finding a Maximum Permutation""; ""The Celebrity Problem""; ""Topological Sorting""; ""Stronger Assumptions""; ""Invariants and Correctness""; ""Relaxation and Gradual Improvement""; ""Reduction + Contraposition = Hardness Proof"" ""Problem Solving Advice""""Summary""; ""If You�re Curious ...""; ""Exercises""; ""References""; ""Chapter 5: Traversal: The Skeleton Key of Algorithmics""; ""A Walk in the Park""; ""No Cycles Allowed""; ""How to Stop Walking in Circles""; ""Go Deep!""; ""Depth-First Timestamps and Topological Sorting (Again)""; ""Infinite Mazes and Shortest (Unweighted) Paths""; ""Strongly Connected Components""; ""Summary""; ""If You�re Curious ...""; ""Exercises""; ""References""; ""Chapter 6: Divide, Combine, and Conquer""; ""Tree-Shaped Problems: All About the Balance"" ""The Canonical D&C Algorithm""""Searching by Halves""; ""Traversing Search Trees ... with Pruning""; ""Selection""; ""Sorting by Halves""; ""How Fast Can We Sort?""; ""Three More Examples""; ""Closest Pair""; ""Convex Hull""; ""Greatest Slice""; ""Tree Balance ... and Balancing *""; ""Summary""; ""If You�re Curious ...""; ""Exercises""; ""References""; ""Chapter 7: Greed Is Good? Prove It!""; ""Staying Safe, Step by Step""; ""The Knapsack Problem""; ""Fractional Knapsack""; ""Integer Knapsack""; ""Huffman�s Algorithm""; ""The Algorithm""; ""The First Greedy Choice"" ""Going the Rest of the Way"" |
Record Nr. | UNINA-9910300468803321 |
Hetland Magnus Lie
![]() |
||
Berkeley, CA : , : Apress : , : Imprint : Apress, , 2014 | ||
![]() | ||
Lo trovi qui: Univ. Federico II | ||
|