Something was really bothering Baldric about 106479825301.0, the answer to the mysterious request he’d received. Sitting down at his desk after enduring his meeting with Kevin, he realized what it was. If you only looked at the answer’s whole number portion… >>> int(106479825301.0) 106479825301 …then every number from 0 to 10 appeared exactly once in […]
Author: Grayson Stanton
Intro to Python, Chapter 1 – Arithmetic and Variables
Seated in his cubicle, Baldric tried to block out the buzz of busy clerks scattered about the office. The usual mix of apathy, grumpiness, and existential dread filled his thoughts, but something was tugging at the back of his mind. It felt vaguely like a sense of…hope. Almost as if there was finally a way […]
Intro to Python, Prologue – The Door
His feet carried him through corridor after dark corridor, soft steps echoing in the stillness. He could feel something in these halls calling to him, drawing him near. He turned a corner and there it was, what he somehow knew he would find. A door, seemingly hewn from the surrounding stone. While it bore no […]
Intro to Python, Preface – The Journey Ahead
Data Rebellion presents Demons and Dwarves, An Intro to Python Adventure Call to Adventure A shadow falls over the land. Hero after hero arises to confront the encroaching evil, yet hero after hero is mercilessly slain (or accepts an offer for a pretty sweet management gig). Now, only two things stand between the all-powerful Emperor […]
Coding in Interactive Mode vs Script Mode
When programming in Python, you have two basic options for running code: interactive mode and script mode. Distinguishing between these modes can be slightly confusing for beginners, especially when you’re trying to follow along with others’ tutorials, so here’s a brief rundown. Interactive Mode Interactive mode is great for quickly and conveniently running single lines […]
April Fools’ Day Python Prank
“With great power comes great responsibility. Except on April Fools’ Day.” - Uncle Ben Do you know someone who Karma’s been slacking on lately? Looking for a harmless April Fools’ Day prank that allows you to flex your Pythonic muscles? Well look no further. Here’s a simple little prank you can quickly code up in […]
Break the Loop and Level Up Your Boring Office Job with Python
“ouro7” by Rex Housour, used under CC BY-SA 2.0, cropped original In the world of programming, there’s something known as a “loop”. Loops are great because, with a few simple lines of code, they can command your computer to do a limitless amount of work. They force your computer into a repeating cycle of manual […]
Programming the Hokeydex (Intro to Python Variables and Data Types)
The following post is a simple introduction to variables and the sorts of things commonly assigned to them in Python. If you are new to Python and/or programming, I encourage you to run each code block in your own editor as you read (repl.it is great for quickly running a little code). Think up questions […]
Yes, You Should Start Your First Programming Project
Imagine for a moment that learning programming is like climbing a mountain. The start of the climb is very steep, and most people end up falling back down. But a fair number of individuals get past this initial slope. They finish an online course or get half-way through an ebook or just generally mess around […]
Selenium + PhantomJS Tutorial
This post borrows from the previous selenium-based post here. If you have heard of PhantomJS, would like to try it out, and are curious to see how it performs against other browsers such as Chrome, this post will help. However, in my experience, using the PhantomJS browser for webscraping doesn’t really have many benefits compared […]
Scraping Financial Data with Selenium
Note: The following post is a significant step up in difficulty from the previous selenium-based post, Automate Your Browser: A Guided Selenium Adventure. Please see the start of that post for links on getting selenium set up if this is your first time using it. If you really do need financial data, there are likely […]
To Learn Programming, Do Projects You Actually Care About
Data Rebellion is all about getting your programming abilities to the point of usefulness as quickly as possible. And when it comes to learning programming, some paths up the mountain are shorter than others. If you’ve ever watched Anime, think about when characters make their greatest improvements. Sure, training often helps them get stronger and […]
Automate Your Browser: A Guided Selenium Adventure
Prerequisites: Have Python/Anaconda and Selenium installed. See the previous intro to Selenium if you’re not familiar with it. The full code for this post is included at the end. You might find it fun to first run the entire script and watch how it works before jumping in and following along with the post. And […]
Let Your Browser Do the Work for You: Writing Your First Selenium Script
Prerequisites: Have the Selenium Python package working on your machine. See this guide for help. If you ever find yourself doing something repetitive online, there’s probably a Python package that can help you automate the process. One that’s extremely simple to use and flashy to show off to others is called Selenium. Selenium basically allows […]
Quick Guide to Installing Selenium (Google Chrome version)
To set up Selenium, you must first have Python installed. I recommend installing Python 3 via Anaconda, which is detailed here. This will also give you the Spyder development environment, which I recommend as well. Next, if you’re using Windows, open up your command prompt and type: pip install selenium or an equivalent command in […]