Most attacks on programs have one shape: text that was meant to be data is treated as code, or as a path, or as markup. The text came from outside, from a form, a file name, a header, a message, and the program passed it to something that gives characters special meaning. Python gives you a safe tool for every case in this lesson. The skill is to recognise the pattern, and to reach for the tool every time.
More lessons in Complete Python Programming