Head First Programming. A learner's guide to programming using the Python language - Helion
ISBN: 978-14-493-6981-1
stron: 442, Format: ebook
Data wydania: 2009-11-16
Księgarnia: Helion
Cena książki: 152,15 zł (poprzednio: 176,92 zł)
Oszczędzasz: 14% (-24,77 zł)
Looking for a reliable way to learn how to program on your own, without being overwhelmed by confusing concepts? Head First Programming introduces the core concepts of writing computer programs -- variables, decisions, loops, functions, and objects -- which apply regardless of the programming language. This book offers concrete examples and exercises in the dynamic and versatile Python language to demonstrate and reinforce these concepts.
Learn the basic tools to start writing the programs that interest you, and get a better understanding of what software can (and cannot) do. When you're finished, you'll have the necessary foundation to learn any programming language or tackle any software project you choose.
With a focus on programming concepts, this book teaches you how to:
- Understand the core features of all programming languages, including: variables, statements, decisions, loops, expressions, and operators
- Reuse code with functions
- Use library code to save time and effort
- Select the best data structure to manage complex data
- Write programs that talk to the Web
- Share your data with other programs
- Write programs that test themselves and help you avoid embarrassing coding errors
We think your time is too valuable to waste struggling with new concepts. Using the latest research in cognitive science and learning theory to craft a multi-sensory learning experience, Head First Programming uses a visually rich format designed for the way your brain works, not a text-heavy approach that puts you to sleep.
Osoby które kupowały "Head First Programming. A learner's guide to programming using the Python language", wybierały także:
- GraphQL. Kurs video. Buduj nowoczesne API w Pythonie 169,00 zł, (50,70 zł -70%)
- Receptura na Python. Kurs Video. 54 praktyczne porady dla programist 199,00 zł, (59,70 zł -70%)
- Podstawy Pythona z Minecraftem. Kurs video. Piszemy pierwsze skrypty 149,00 zł, (44,70 zł -70%)
- Twórz gry w Pythonie. Kurs video. Poznaj bibliotekę PyGame 249,00 zł, (74,70 zł -70%)
- Data Science w Pythonie. Kurs video. Algorytmy uczenia maszynowego 199,00 zł, (59,70 zł -70%)
Spis treści
Head First Programming. A learner's guide to programming using the Python language eBook -- spis treści
- Head First Programming
- Dedication
- A Note Regarding Supplemental Files
- Advance Praise for Head First Programming
- Praise for other Head First books
- Authors of Head First Programming
- How to Use This Book: Intro
- Who is this book for?
- Who should probably back away from this book?
- We know what youre thinking
- We know what your brain is thinking
- Metacognition: thinking about thinking
- Heres what WE did
- Heres what YOU can do to bend your brain into submission
- Read Me
- The technical review team
- Acknowledgments
- Safari Books Online
- Who is this book for?
- 1. Starting to Code: Finding your way
- Programming lets you do more
- But what are g and guess?
- So how do you run your code?
- Create a new program file
- Prepare and run your code
- A program is more than a list of commands
- Codeville: Your program is like a network of roads
- Branches are code intersections
- if/else branches
- The Python code needs interconnecting paths
- Python uses indents to connect paths
- Loops let you run the same piece of code over and over again
- Pythons while loop
- Your Programming Toolbox
- Programming lets you do more
- 2. Textual Data: Every string has its place
- Your new gig at Starbuzz Coffee
- Heres the current Starbuzz code
- The cost is embedded in the HTML
- A string is a series of characters
- Find characters inside the text
- But how do you get at more than one character?
- BeansRUs is rewarding loyal customers
- The price moved
- Searching is complex
- Python data is smart
- Strings and numbers are different
- The program has overloaded the BeansRUs Server
- Time... if only you had more of it
- Youre already using library code
- Order is restored
- Your Programming Toolbox
- 3. Functions: Lets get organized
- Starbuzz is out of beans!
- What does the new program need to do?
- Dont duplicate your code...
- ...Reuse your code instead
- Reuse code with functions
- Always get things in the right order
- Return data with the return command
- Use the Force, Web Luke
- The function always sends the same message
- Use parameters to avoid duplicating functions
- Someone decided to mess with your code
- The rest of the program cant see the password variable
- When you call a function, the computer creates a fresh list of variables
- When you leave a function, its variables get thrown away
- Starbuzz is fully stocked!
- Your Programming Toolbox
- 4. Data in Files and Arrays: Sort it out
- Surfs up in Codeville
- Find the highest score in the results file
- Iterate through the file with the open, for, close pattern
- The file contains more than numbers...
- Split each line as you read it
- The split() method cuts the string
- But you need more than one top score
- Keeping track of 3 scores makes the code more complex
- An ordered list makes code much simpler
- Sorting is easier in memory
- Keep the data in memory
- You cant use a separate variable for each line of data
- An array lets you manage a whole train of data
- Python gives you arrays with lists
- Arrays can be extended
- Sort the array before displaying the results
- Sort the scores from highest to lowest
- And the winner is...?
- You somehow forgot the surfer names
- Your Programming Toolbox
- 5. Hashes and Databases: Putting data in its place
- Who won the surfing contest?
- Associate the name with the score
- Use a hash
- Associate a key with a value using a hash
- Iterate hash data with for
- The data isnt sorted
- Python hashes dont have a sort() method...
- ...but there is a function called sorted()
- When data gets complex
- So what does RSAs data look like?
- Return a data structure from a function
- Heres your new board!
- Meanwhile, down at the studio...
- The code remains the same; its the function that changes
- TVNs data is on the money!
- Your Programming Toolbox
- 6. Modular Programming: Keeping things straight
- Head First Health Club is upgrading some systems
- The program needs to create a transaction file
- Use strings to format strings
- A late night email ruins your day
- $50,000... for a donut?!
- Only the sales from your program were rejected
- The new bank uses a new format
- Your coffee bar program still uses the old format
- Dont just update your copy
- Smart programmers write modular code
- So how do you create a module...?
- ...and how do you use it?
- The transaction file is working great, too
- The health club has a new requirement
- The Starbuzz code
- The two discount functions have the same name
- Fully Qualified Names (FQNs) prevent your programs from getting confused
- The discounts get the customers flooding in
- Your Programming Toolbox
- 7. Building a Graphical User Interface: Going all gooey
- Head First TVN now produces game shows
- pygame is cross platform
- 0... 2... 1... 9... blast off!
- tkinter gives you the event loop for free
- tkinter is packed with options
- The GUI works, but doesnt do anything
- Connect code to your button events
- The GUI programs now ready for a screentest
- But TVN is still not happy
- Label it
- Your Programming Toolbox
- 8. Guis and Data: Data entry widgets
- Head-Ex needs a new delivery system
- Theyve already designed the interface
- Read data from the GUI
- The Entry and Text widgets let you enter text data into your GUI
- Entry widget: for entering single lines of text
- Text widget: for longer, multi-line text
- Read and write data to text fields
- Large Text fields are harder to handle
- One of the Head-Ex deliveries went astray
- Users can enter anything in the fields
- Radio buttons force users to choose a valid depot
- Creating radio buttons in tkinter
- The radio buttons should work together
- The radio buttons can share a model
- The system tells the other widgets when the model changes
- So how do you use models in tkinter?
- Head-Exs business is expanding
- There are too many depots on the GUI
- An OptionMenu lets you have as many options as needed
- The model stays the same
- But wait... you dont have to list all the values like that
- Things are going great at Head-Ex
- Your Programming Toolbox
- 9. Exceptions and Message Boxes: Get the message?
- Whats that smell?
- Someone changed the file permissions
- When it couldnt write to the file, the program threw an exception
- Catch the exception
- Watch for exceptions with try/except
- Theres an issue with the exception handler
- A message box demands attention
- Creating message boxes in Python
- Message boxes that say stuff
- Message boxes that ask stuff
- Your Programming Toolbox
- 10. Graphical Interface Elements: Selecting the right tool
- Time to mix it up
- The music just kept on playing...
- Not all events are generated by button clicks
- Controlling the Window Manager
- Capturing the protocol event isnt enough
- Two buttons, or not two buttons? That is the question...
- The checkbox is an on/off, flip/flop toggle
- Working with checkboxes in tkinter
- Using the get() method
- Pump up the volume!
- Model a slider on a scale
- Start with the volume
- Use pygame to set the volume
- Use tkinter for everything else
- The DJ is over the moon!
- Your Programming Toolbox
- 11. Custom Widgets and Classes: With an object in mind
- The DJ wants to play more than one track
- How will you create the widgets for each track?
- Create code for each track as a function
- The new function contains other functions
- Your new function needs to create widgets and event handlers
- The DJ is confused
- Group widgets together
- Create a new type of widget
- A frame widget contains other widgets
- A class is a machine for creating objects
- A class has methods that define behavior
- But how does an object call a method?
- self identifies the widget calling the method
- The SoundPanel class looks a lot like the create_gui() function
- class = methods + data
- The DJ has an entire directory of tracks
- Its party time!
- The mixer program brought the house down!
- Congratulations!
- Your Programming Toolbox
- Leaving town...
- Its been great having you here in Codeville!
- The DJ wants to play more than one track
- A. Leftovers: The Top Ten Things (we didnt cover)
- #1: Doing things The Python Way
- #2: Using Python 2
- #3: Other programming languages
- #4: Automated testing techniques
- #5: Debugging
- #6: Command-line execution
- #7: Ooops... we couldve covered more OOP
- #8: Algorithms
- #9: Advanced Scary programming topics
- #10: Other IDEs, shells, and text editors
- Index
- About the Authors
- Copyright