Hacker Newsnew | past | comments | ask | show | jobs | submit | pgorla's commentslogin

Thanks!


Also, the last line to check for 'one-liners' won't get them all:

  $ grep -r  "if __name__ == '__main__'" /path/to/lib
Should be:

  $ grep -r  "if __name__ == ['\"]__main__['\"]" /path/to/lib


If you're not storing that somewhere, but rather typing it, I find you're often better off by being a little more forgiving, eg:

  $ grep -r "if __name__ == .__main__." /path/to/lib
or even: $ grep -Er 'if\W__name__\W==\W.__main__.'


You could also do this:

    grep -n __main__ *.py|grep __name__
which turns up few false positives.


It also looks like this was just for self-reference; it's not an article as it is a collection of useful tips.

I write a lot of these to remind myself of tool usage.


Interesting. This opens up a whole new realm of nature documentary film-making based around unobtrusive cameras. I don't see animal behavior differing very much, but a human presence certainly is not something the animals can ignore.

That said, some of the animals in the pictures saw the camera -- not exactly discreet.


Yeah, they're on a motion sensor, and usually flash, which is pretty hard to ignore. We've been using them for years to spot whitetails in the woods.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: