We made a pledge to get our hands dirty with more tech over 2016, and Emily started us off by exploring the magical world of Linux and open-source software.
Not content with just getting really cool apps and operating systems for free, though, I wanted to see if I could make my own.
Having bought far too many (mostly unread) coding books for my own good, I felt well equipped to tackle the challenge of learning to code something in Python – a popular programming language.
On a superficial level, snakes are really cool. On a more reasonable level – Python offers a beginner-friendly coding experience, but with the flexibility to program both web and desktop applications.
Python also offers a gateway into more advanced programming principles due to it being an object-oriented programming language. This means that Python code is based on objects (or blocks of data if you prefer) that can interact with each other, rather than just standard sequential logic. I don’t think I could tell you all the ramifications of this, but from what I hear object-oriented code is more flexible and allows you to do cooler stuff. That was enough for me.
The other reason is that Codecademy offers a free Python course. Codecademy is an online series of interactive coding tutorials that I’d recommend to people interested in learning code.
I’d tried my hand at learning from books in the past, but became frustrated having to constantly switch my attention between paper and keyboard, so having an interactive tool online that could give me instant feedback was really helpful.
What to build?
With my language and learning tool in place, it was time to decide what to build.
I’ve always been curious as to whether you could automate the process of copywriting, monkey-and-typewriter style. Perhaps Python could help here? Because of the whole object-oriented business, you can use Python to capture user input and manipulate it as you please.
And so the plan started coming together. Capture details about what kinds of industry, challenges and solutions you want to talk about, mix in some filler from our periodic table of B2B marketing clichés, and presto. You’re left with some functional (albeit generic) B2B copy!
Starting the learning process
To get my copy generator built, I actually had to start learning things. After a standard online sign-up, and selecting my course of choice (you can also choose from a variety of other languages, command line and web courses), Codecademy was ready to become my sensei.
As you can see, it’s a clean and pretty straightforward user interface. The left side gives you some instructions to follow, the centre box is for the stuff you actually type, and the black box in the top right of the screen shows you the results.
My initial foray into Python has seen me:
- Wrestle with basic Python syntax
- Print text on screen
- Store data in the form of variables for easy access later
- Make a calculator that works out how much to tip in a restaurant
From Codecademy to actual code
With step by step guides, tips for if you get stuck, and a helpful community for more advanced questions, learning Python with Codecademy has been smooth sailing so far. The only problem is how and when you decide to take the training wheels off.
In my case, the next few lessons on the Codecademy course will run through manipulating text strings and user input – exactly what I need to start making my automated B2B copy machine.
But while it’s one thing following instructions on screen, it’s another thing entirely actually producing working code from scratch.
Lessons learned in code
One big hurdle to overcome in learning Python is the way machines interpret what you type. Unlike copy that can be interpreted and understood by the complexities of the human mind, machines are absolute and will process whatever you tell them without fail.
Where this becomes a problem is in how specific you need to be. A missed comma in a white paper might harm readability, but your reader will still understand what you’re saying. While not ideal, it isn’t the end of the world. In code, though, it can be.
A rogue colon or missing letter can bring a program to its knees, and searching for these bugs is time-consuming and demands a keen eye for detail. And that’s just on my tiny dozen-line creations so far. Larger projects can span to hundreds, or even thousands of lines of code, turning a rogue comma into a needle in the haystack. A needle that completely stops your program from doing anything.
So for writers interested in dabbling in Python (or any programming language), I’d recommend you double-check everything as you go along. Or just make sure you’re very accurate at typing. One mis-typed word can be the difference between success and failure.
What comes next?
My journey in Python continues. Up next you’ll see me take my final few lessons in Python, pick out a development environment, and actually try and make a B2B copy generator.
What development tools will I use? Will the copy generator work? Will it put me out of a job? Find out in the next thrilling part of the Adventures in Tech blog series!
 Ok, I probably can’t get all of them in there. We all love the poop emoji, but I have no concept of how I could get that working in Python. Maybe one day…