Walking J. (a complete beginner) through lessons 0 and 1 of Learn Python The Hard Way by Zed Shaw, it occurred to me that LPTHW is probably best learned as a beginner when there’s someone experienced to help you through the setup, and to answer the larger-picture questions of why you are doing what you are doing.
J. uses a PC, is fairly computer literate (he knows general keyboard shortcuts and how to create/delete files and folders), and had actually taken AP Computer Science in high school — so had some familiarity with Java. But the questions he asked me made me realize how discouraging it can be to try to run through LPTHW when you have no idea about how to set up the development environment, and why the dev environment is set up the way it is.
Some issues that we encountered:
1) Python wouldn’t download. Ha. He had Python already installed, or so he thought — but then it turned out that he had Python 3 installed of Python 2 (if you read Zed Shaw’s directions carefully, Python 2 was necessary)… and then for some reason it took a few minutes longer for his machine to recognize that Python 2 was actually installed. So we waited and waited before he was able to get a successful message upon typing “python” in the powershell.
2) The powershell looks intimidating! J. was running Windows 7, I believe — and the powershell came out with this bright blue background. For non-programmers (I remember this too from before I started using the terminal every day), it looks intimidating as heck. You don’t want to type an accidental command that’ll delete or destroy all your files.
I know, I know — this fear seems absurd to those who are familiar with the command line. I had to convince him to trust me that A) I wouldn’t make him type anything that would ruin his computer; B) that it was perfectly okay and normal to use the powershell all the time; all programmers do, especially when they’re using version control, and that typing “mkdir new-directory-name” to create a folder was BETTER than going to the start menu and creating a new folder through the user interface.
Argh. This latter point was definitely something that needed convincing on. Luckily, once he learned the “mkdir” command along with the “cd” command, I think the uses of the powershell became clearer. And then I referred him to Zed Shaw’s Command Line Crash Course . :-P
3) Understanding how the text editor works in combination with the powershell. Zed Shaw recommends Notepad++ for Windows users, which is perfectly fine, but I recommended Sublime Text to J. just for the heck of it (and maybe because Sublime is v. pretty). Anyway, from the start there was some slight confusing of Sublime Text with the Powershell — which made me realize that the clarity of Lesson 0 could have been improved with just a few screenshots. J., from his one high school CS course in the early 2000s, also expected that Sublime would act as a compiler — which didn’t happen, of course. I had to tell him to think of Sublime like a Microsoft Word document — it’s just the text editor. But you can run it in the command line with “python filename.py”, or even preview it in the browser if it’s a .html file. But by itself, there’s no built-in “compile” or “preview” tab.
Setup took longer than I’d expected, but it was worth it in the end to see the spark of delight in someone’s eyes, saving a file called ex01.py and running “python ex01.py” successfully in their powershell for the first time.
I told J. that he’d probably be able to catch up with me pretty soon; I’m only Lesson 11!