There's this popular book on penetration testing titled Violent Python. It's been written by T. J. O'Connor and was published in 2012.
Professor Sam Bowne held a workshop at BSidesSF this April and made something kindof along the same lines. So, the book is in part about developing specific tools to help with penetration testing in the Python programming language.
In this workshop, Prof. Bowne, goes through three levels of difficulty:
- First, by doing or coding a basic port scanning in Python.
- Second, by coding and HTTP scanner.
- Thirdly, by doing password hashes and XOR Encryption in Python.
Overall, this workshop encompasses fairly good some of the things you'd be doing in terms of scripting and Python coding as a penetration tester. And since this is hands-on, I warmly recommend it to you if you're a cybersecurity professional.

To stay in touch with me, follow @cristi
Cristi Vlad Self-Experimenter and Author