For example I have lots of unstaged files.
How could I only commit unstaged python files (.py)?
If you look at the gitignore synax, **
will dig down into sub directories. So the following should work to get all the python files added.
git add **/*.py