Mastery Table: creating Python scripts using a text editor

Feb 23, 2013 • Ben Morris

I’m still somewhere between intermediate and expert (still using nano for most things), but it’s something I’m working on. (I tried not to overlap too much with Geoff; I’m more focused on using a text editor from the command line, not command line file manipulation.)

Novice

  • Can create text files using a GUI like File Explorer or by right-clicking on their desktop.
  • Understands that file extensions are often used to denote the purpose of a file — can probably infer that “.py” means a Python script. (May assume that this is a rule and not a convention.)
  • Misconceptions: might think of Microsoft Word, etc. as “text editors” and try to save scripts as Word docs; might think of text files as including formatting (bold, italics, tables, etc.)
  • Likely never used the command line to edit a text file. May not realize this is possible; probably think of it as more difficult than using a GUI.

Intermediate

  • Understands how to create and save a plain text file using a command-line editor like nano.
  • Comfortable with basic nano shortcuts like cut line, paste line, save, exit; know how to get help if they need it.
  • Knows how to select their default text editor for tools like Git to avoid getting stuck in vim.
  • Understands escaping characters with “” and the special characters newline “n” and tab “t”.
  • Understands how to use #! to describe how a file should be executed.
  • Understands the difference between a binary and a text file.

Expert

  • Understands differences in newline characters between platforms.
  • Understands that files can be saved in various character encodings.
  • Ability to use more advanced text editors such as vim or emacs, together with advanced features like regex search, macros, etc.
  • Can customize their text editor to their liking with syntax highlighting, custom key bindings, etc.
  • Can comfortably edit multiple files simultaneously.
  • Doesn’t view command-line text editing as a chore.
  • Started to develop severe joint pain in the hands.

 

The beginning of ch. 4 mentioned some teachers who expected their students to be able to synthesize concepts that they learned independently, and how this actually requires specific practice. This actually reminded me of something from the SWC workshops I’ve attended. Usually there’s at least point where an instructor quickly jumps between the command line and a text editor, or quickly scrolls through their history and hits enter, and the students have no idea what just happened. (I’m certainly guilty of this myself!) Some of them will be lost but won’t say anything unless an instructor realizes and asks them about it. After reading this chapter I realize that even if the various concepts have been introduced independently, it’s important to be able to differentiate between them visually (by using different colors for different environments) and verbally by describing exactly what you’re doing until students are comfortable following along.