3

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.

5 Answers 5

4

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$)
1
  • I've personally found google code search to be completely worthless. Sure, it finds your keywords in some source code...but the code that it digs up, is rarely ever "here's a chunk of sample code showing how to use it".
    – mpen
    Jun 20, 2010 at 7:04
0

You can also look at Activestate Python Recipe's: http://code.activestate.com/recipes/langs/python/

Here's their recipes for Python Pickling: http://code.activestate.com/search/#q=pickle python

O'Reilly's Python Cookbook is also good. You can read it online with a Safari membership.

0

There is also Nullege. A search engine especially for Python code.

0

The Github search is pretty good. It's usually used to search for repository but its search code works well:

enter image description here

enter image description here

-1

In general, Google Code Search is a pretty good place to look for code snippets. To look for Python pickle examples, I'd do a search like

lang:python pickle examples

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.