ansible-playbook -i path/to/dynamic-inventory-script.py -l myhost myplaybook.yml
See dynamic inventory for more details.