Instead of doing:

```python
output_dir + '/selectors.txt'
``` 

You should use `os.path.join` and this should be used all over the module.