Tag Archives: coding

Automate The Boring Stuff with Python Coding

If everyone in the world understood and had a working command of regular expressions, everything would run smoothly. Especially if all of our interfaces to text allowed for their use. This has been pointed out. And, Automate the Boring Stuff with Python, 2nd Edition: Practical Programming for Total Beginners has a whole chapter on this.

What is a regular expression? We can talk about that in detail some other time. Briefly, it is a string of symbols that is designed to match a specified set of symbols, or a range of a set of symbols, in a larger body or stream of text. For example, if you pass a stream of information (say, all your emails) through a filter with the regular expression:

‘\d\d\d-\d\d\d-\d\d\d\d’

then any part of that stream of information that looks like a phone number (not using parens), such as 636-555-3226, will be isolated.

Automate the Boring Stuff with Python is a book that teaches beginning Python computer Augean programming focusing on examples from day to day life, including but well beyond REs.

The new edition includes pattern matching with regular expressions, input validation, reading and writing files, organizing files, web scraping, manipulating Excel spreadsheets and Google Sheets, PDF and Word documents, CSV and JSON files, email, images, and automating your keyboard and mouse.

The great benefit of a book like this is that you learn Python (the first part of the book gives you all you need to know to program in Python) in the context of things you actually want to do with Python. If you are interested in learning Python, or coding in general, this can be your first book.

The book is well done, as all in this series are, and fun. There are strong on line resources including all the code, and that information is regularly updated. Generally, “No Starch” press books are great, and this is one of those!

I would like to have seen at least sidebars on manipulating things using Libreoffice software, but note that the book focuses on documents, and OpenSource software does work with normal Excel and Word documents, so it is there.

The second edition adds a new chapter on input validation. The Gmail and Google Sheets sections, and the information on CSV files is also new. I plan on using the software tips and tricks to develop my own highly specialized and targeted search software. I’m often looking for files that have specific extensions, and certain kinds of content, in certain locations. Just the ability to hard-wire where to search for files will save me a lot of time and trouble.

Author Al Sweigart is a professional software developer who teaches programming to kids and adults, and who is author of Invent Your Own Computer Games with Python, Cracking Codes with Python, and Coding with Minecraft, all of which are quite nice. We need a new edition of Coding with Minecraft, by the way, that looks at a wider range of coding options and keeps up with the major advances in that software environment! So, get to work, Al!

Math Adventures with Python

Complex numbers, working with oscillations (trigonometry), using Turtles to draw, some basic algebra, my favorite, Cellular Automata, and more, are covered in Math Adventures with Python: An Illustrated Guide to Exploring Math with Code by Peter Farrell. Farrell is a math and computer science teacher who is interested in math education and using technology in learning. Continue reading Math Adventures with Python

Kids Learn Coding with Scratch Cards

First, in case you don’t know, “Scratch” is a programming language and environment.

Its mascot is a cat, of course, but the name “scratch” supposedly comes from the use of scratching by disk jockeys. Scratch was first developed at MIT back in the early 2000s, and has advanced considerably since then. You now see the basic format of this language either duplicated or mimicked in many different environments.

Scratch can be an online langauge or you can run a stand alone version, but the former is easier and better. To get started, go here and follow instructions.

If you want (your kid or you) to learn scratch fast, you may want to consider getting the cards produced by No Starch Press. You can get ScratchJr Coding Cards for ages 5 and up, or the much more advanced Scratch Coding Cards for kids 8 and above.

The idea is simple. You put the stack of cards on your desk next to the computer, which is tuned to the MIT Scratch site. Then you try out the stuff in the cards. By the time you are done you (or your kid if you step aside and allow access to the computer) will be pretty good at scratch programming.

By the way, Scratch runs on the web so you can access it from any sort of desktop or laptop computer including Chromebooks,a nd there are iOS and Android versions. It runs on the Kindle Fire as well.

Kids coding and technology advance

Over recent months, there has been an important advance in opportunities for kids to learn to code and mess around with technology.

The Scratch programming language is a project set at MIT. Scratch programming involves moving images, called blocks, from a pallet into a work area, hooking them together and maybe changing some values attached to them, in order to develop programs that mainly, but not exclusively, manipulate sprites. (See example of code blokcks above.) The project is located HERE. This is a full object oriented programming language with quite a few features that make it very powerful, for a kid’s toy. Continue reading Kids coding and technology advance

Python Programming To Automate Common Tasks

Automate the Boring Stuff with Python: Practical Programming for Total Beginners by super Python expert Al Sweigart is a pretty thick intermedia to somewhat advanced level programming book.

It covers how Python works, so someone familiar with programming languages can get up to speed. Then, the book tackles a number of key important tasks one may use a computer for. This includes working with Regular Expressions, file reading and writing, web scraping, interacting with Excel spreadsheets and PDF files, scheduling things, working with email, manipulating images, and messing around with the keyboard and mouse.

I wold like to see a second volume with yet more programming ideas and examples. It could be a series.

From the publishers:

If you’ve ever spent hours renaming files or updating hundreds of spreadsheet cells, you know how tedious tasks like these can be. But what if you could have your computer do them for you?

In Automate the Boring Stuff with Python, you’ll learn how to use Python to write programs that do in minutes what would take you hours to do by hand—no prior programming experience required. Once you’ve mastered the basics of programming, you’ll create Python programs that effortlessly perform useful and impressive feats of automation to:

  • Search for text in a file or across multiple files
  • Create, update, move, and rename files and folders
  • Search the Web and download online content
  • Update and format data in Excel spreadsheets of any size
  • Split, merge, watermark, and encrypt PDFs
  • Send reminder emails and text notifications
  • Fill out online forms
  • Step-by-step instructions walk you through each program, and practice projects at the end of each chapter challenge you to improve those programs and use your newfound skills to automate similar tasks.

    Check it out.

    Programming in Small Basic

    Learn to Program with Small Basic: An Introduction to Programming with Games, Art, Science, and Math is yet another addition to the growing list of programming books for people interesting in learning programming.

    Basic is an under-appreciated language. I wish I had a good basic compiler handy, and I’d love to see a basic scripting version that worked like bash. Can you see the value of that?

    Anyway, Small Basic is an updated modernish basic that runs only on Windows, so while I can’t use it, you might, and this book looks like a good intro. From the publisher:

    Small Basic is a free, beginner-friendly programming language created by Microsoft to inspire kids to learn to program. Based on BASIC, which introduced programming to millions of first-time PC owners in the 1970s and 1980s, Small Basic is a modern language that makes coding simple and fun.

    Learn to Program with Small Basic brings code to life and introduces you to the empowering world of programming. You’ll master the basics with simple activities like displaying messages and drawing colorful pictures, and work your way up to programming playable games! You’ll learn how to:

  • Store and manipulate data with variables
  • Process user input to make interactive programs
  • Use if/else statements to make decisions
  • Create loops to automate repetitive code
  • Break up long programs into bite-sized subroutines
  • Inside, you’ll find hands-on projects that will challenge and inspire you. You’ll command a turtle to draw shapes, program magical moving text, solve all kinds of math problems, help a knight slay a fearsome dragon, and more! Each chapter ends with extra practice examples so you can take your programming skills to the next level!

    Check it out!

    Almost Free Computer, Coding, Game Programming Books

    Have a look at the list of books, below.

    Would you like a subset, or all, of these books, in electronic format, for very cheap? There is a way to do that. Note: This is time sensitive, the offer running for just about two weeks and it started yesterday.

    I’ve reviewed several of these books on this blog, and have recommended them. I’m going through Python Crash Course right now, and we’ve found the various kids programming books to be helpful, for instance. I’ve not looked at the grey hat or black hat books, but I’m sure they are fine.

    The publisher, No Starch Press, has created one of those deals where you give them a small amount of money and they give you a pile of books. Since I review a lot of books, esp. computer related books, the publishers sent me the info on this, asking if I would pass it on. See the site for details, but you can have have the firs three for $1+, those plus the next three for $8, and those plus the bottom three for $15+. In addition, if you get the first bundle (or more) you get a “sampler,” which is probably a big pamphlet for their other books, not sure.

    Here is something really important, to some of you, about these eBooks: They come in multiple formats and are DRM free. So this is not as restrictive as, say, getting a book from Amazon or B&N. They are in PDF, MOBI, ePUB so they’ll work on pretty much any reader.

    There is also an option for donating so a charity, including the Python Foundation, but also, pretty much any charity you can think of, while you buy the books. You can divide your payment between the publisher, the charity, and a tip jar. I’m not sure who gets the tip!

    Any on of these books costs more than all of them, in any format, so if there is any single book on this list that you were going to get anyway, in electronic form, now’s your chance to get a whole big pile of them. With books, that is always a good things. And, since they are electronic, when you move, they add hardly any weight to your stuff! Electrons are light!

    Automate the Boring Stuff with Python: Practical Programming for Total Beginners
    Doing Math with Python: Use Programming to Explore Algebra, Statistics, Calculus, and More!
    Teach Your Kids to Code: A Parent-Friendly Guide to Python Programming
    Gray Hat Python: Python Programming for Hackers and Reverse Engineers
    Python Playground: Geeky Projects for the Curious Programmer
    Python for Kids: A Playful Introduction to Programming
    Black Hat Python: Python Programming for Hackers and Pentesters
    Invent Your Own Computer Games with Python
    Python Crash Course: A Hands-On, Project-Based Introduction to Programming

    HERE IS THE LINK TO GET THE BUNDLE DEAL AT NO STARCH PRESS

    Books On Computer Programming and Computers

    Python

    Learning Python
    Python Crash Course: A Hands-On, Project-Based Introduction to Programming is a fast-paced, thorough introduction to programming with Python that will have you writing programs, solving problems, and making things that work in no time.

    In the first half of the book, you’ll learn about basic programming concepts, such as lists, dictionaries, classes, and loops, and practice writing clean and readable code with exercises for each topic. You’ll also learn how to make your programs interactive and how to test your code safely before adding it to a project. In the second half of the book, you’ll put your new knowledge into practice with three substantial projects: a Space Invaders-inspired arcade game, data visualizations with Python’s super-handy libraries, and a simple web app you can deploy online.

    My review: How to learn Python programming

    MORE COMING SOON

    Learn Scratch Programming (For Kids And Adults)

    Scratch, the colorful drag-and-drop programming language, is used by millions of first-time learners, and in Scratch Programming Playground, you’ll learn to program by making cool games. Get ready to destroy asteroids, shoot hoops, and slice and dice fruit!

    Each game includes easy-to-follow instructions, review questions, and creative coding challenges to make the game your own. Want to add more levels or a cheat code? No problem, just write some code.

    Coding projects in Scratch and other items.

    Learn Python Using Minecraft

    Write Computer Games In Python

    Invent Your Own Computer Games with Python will teach you how to make computer games using the popular Python programming language–even if you’ve never programmed before!

    Begin by building classic games like Hangman, Guess the Number, and Tic-Tac-Toe, and then work your way up to more advanced games, like a text-based treasure hunting game and an animated collision-dodging game with sound effects. Along the way, you’ll learn key programming and math concepts that will help you take your game programming to the next level.

    Scratch Programming For Kids, By The Cards

    Want to introduce kids to coding in a fun and creative way?

    With the Scratch Coding Cards, kids learn to code as they create interactive games, stories, music, and animations. The short-and-simple activities provide an inviting entry point into Scratch, the graphical programming language used by millions of kids around the world.

    Kids can use this colorful 75-card deck to create a variety of interactive programming projects. They’ll create their own version of Pong, Write an Interactive Story, Create a Virtual Pet, Play Hide and Seek, and more!

    Each card features step-by-step instructions for beginners to start coding with Scratch. The front of the card shows an activity kids can do with Scratch–like animating a character or keeping score in a game. The back shows how to put together code blocks to make the projects come to life! Along the way, kids learn key coding concepts, such as sequencing, conditionals, and variables.

    This collection of coding activity cards is perfect for sharing among small groups in homes and schools.

    The Queen of Code

    From FiveThirtyEight:

    You probably don’t know the name Grace Hopper, but you should.

    As a rear admiral in the U.S. Navy, Hopper worked on the first computer, the Harvard Mark 1. And she headed the team that created the first compiler, which led to the creation of COBOL, a programming language that by the year 2000 accounted for 70 percent of all actively used code. Passing away in 1992, she left behind an inimitable legacy as a brilliant programmer and pioneering woman in male-dominated fields.

    Hopper’s story is told in “The Queen of Code,” directed by Gillian Jacobs (of “Community” fame). It’s the latest film in FiveThirtyEight’s “Signals” series.

    Actually, I’m sure the readers of this blog DO know the name Grace Hopper. But anyway, this is a great film.