From: Neil Smith Date: Sun, 27 Mar 2016 12:25:55 +0000 (+0100) Subject: Added cat commands to slides X-Git-Url: https://git.njae.me.uk/?p=cipher-training.git;a=commitdiff_plain;h=20aff345391c6ae2d00a55c586fda31f6f4315d5 Added cat commands to slides --- 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_. +