Learn How To Program In Python By Controlling Grand Theft Auto 5

Learning to code is always easier and more enjoyable when you’re doing something fun with it. Programmer Harrison Kinsley decided that using Python to control a game of Grand Theft Auto 5 would be a pretty excellent way for intermediate users to get to grips with the language, as well as a few powerful libraries, such as OpenCV, used for real-time computer vision.

Now, the tutorial isn’t for absolute beginners — you’ll want at least some knowledge about Python before diving in.

The video is also one of a series, with this first clip showing you how to get up and running. There’s a lengthy introduction, so if you just want to get to the actual coding part, skip to around 4:30.

From this point it covers capturing the screen, however, the actual meat and potatoes of interpreting frame contents comes later (around parts four and five).

It’s a bit slow to start, but picks up steam once the basics are canvassed. Of course, if you want to jump ahead and look at the source code, the project is available on GitHub.

Intro and Screen reading – Python plays Grand Theft Auto V p.1 [YouTube]


The Cheapest NBN 50 Plans

Here are the cheapest plans available for Australia’s most popular NBN speed tier.

At Lifehacker, we independently select and write about stuff we love and think you'll like too. We have affiliate and advertising partnerships, which means we may collect a share of sales or other compensation from the links on this page. BTW – prices are accurate and items in stock at the time of posting.

Comments


One response to “Learn How To Program In Python By Controlling Grand Theft Auto 5”

Leave a Reply