Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to search code snippets

Tags:

python

For example I want to know how to use Python pickle serialization & deserialization. Since I've never use it, reading Python official doc would be a great reference, but I prefer some snippets/example codes either has description or not. Like sites for python beginners, someone's blog, or from google codes.

How would you search? Like go to specific sites, or use what keyword. Actually this is a general question not only for Python, but for learning all languages. Thanks.

like image 403
Stan Avatar asked Dec 04 '25 00:12

Stan


1 Answers

Google Code Search.

From the FAQ:

We're crawling as much publicly accessible source code as we can find, including archives (.tar.gz, .tar.bz2, .tar, and .zip), CVS repositories and Subversion repositories.

Sample search: http://www.google.com/codesearch?q=lang%3Apython+%22cpickle%22

The operators are handy:

  • The lang: operator, which restricts by programming language (e.g., lang:"c++", -lang:java, or lang:^(c|c#|c++)$)
  • The license: operator, which restricts by software license (e.g., license:apache, -license:gpl, or license:bsd|mit)
  • The package: operator, which restricts by package URL (e.g., package:"www.kernel.org" or package:.tgz$)
  • The file: operator, which restricts by filename (e.g., file:include/linux/$ or -file:.cc$)
like image 163
mechanical_meat Avatar answered Dec 05 '25 15:12

mechanical_meat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!