Hm I'm not sure if you mean trimming or filtering. What you are doing is filtering: removing reads below the quality cutoff. Trimming nucleotides from the read ends is also possible using NanoFilt.
Regarding the command you are trying to use I would suggest to have a look at the documentation on GitHub, Pypi, the blog post or use NanoFilt --help
I added examples on how to use NanoFilt to all of these. If you have suggestions on how to improve the documentation I would like to hear those, but right now it looks like you haven't read it.
Anyway, genomax is right, NanoFilt reads from stdin and writes to stdout. This makes it compatible with any compression type and allows you to sandwich it between for example decompression and an aligner. If installed correctly there is no need to add ".py" or the full path to the script.
I would suggest, if possible, to use a complimentary albacore summary file for filtering. That will speed up things significantly. Right now, calculating the average read quality is pretty slow, but I will look into this...
I don't think I agree that all reads with score below 9 are garbage. This definitely depends on your application.