From 20aff345391c6ae2d00a55c586fda31f6f4315d5 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Sun, 27 Mar 2016 13:25:55 +0100 Subject: [PATCH] Added cat commands to slides --- slides/caesar-encipher.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/slides/caesar-encipher.html b/slides/caesar-encipher.html index 4afd78d..279c2bd 100644 --- a/slides/caesar-encipher.html +++ b/slides/caesar-encipher.html @@ -90,7 +90,7 @@ Before doing anything, create a new branch in Git Experiment in IPython (ephemeral, for us) -Once you've got something working, copy the code into a `.py` file (permanent and reusable) +Once you've got something working, export the code into a `.py` file (permanent and reusable) ```python from imp import reload @@ -224,6 +224,15 @@ ciphertext = [caesar_encipher_letter(p, key) for p in plaintext] ''.join() ``` +You'll be doing this a lot, so define a couple of utility functions: + +```python +cat = ''.join +wcat = ' '.join +``` + +`cat` after the Unix command (_concatenate_ files), `wcat` for _word concatenate_. + -- 2.34.1