Thursday, September 29, 2016

Learning Pyyaml

This week I set about learning how to set up a configuration file within a python project. I decided to go about using a YAML file for this purpose. YAML files provide a very clean way of setting up a configuration file, by allowing you to create groups of fields. These easily manageable groups create a simple method for separating a single configuration file across multiple classes within the same project. There a few different libraries that allow python to interact with YAML files, but a majority of people seem to recommend PyYAML. I decided to create a simple YAMLfile, storing the values that I use to pass into the program as system arguments within the YAML instead. A using a few tutorials online I was easily able to retrieve the values and use them in my href replacer, just as I had with the system arguments. I now plan to work on hooking up the SimpleEmailSpoofer that I mentioned last week to the href replacer in order to easily send emails after they have been created.

No comments:

Post a Comment