Python and Memcache Example

When I try to write some code in Python to access memcache service, I create a text file 'memcache.py'. This causes problems.

It only occurred in Python script file, no problem with python shell. One of the reason may be the script file name is 'memcache.py', Python will first try to load the module in the current directory, which happens to contain the file with the same name as the would-be imported module, because the current directory has higher priority, it's importing itself. The catch is Python script file name should be different from any module that would be imported in the script file to avoid name conflict like this.

It only occurred in Python script file, no problem with python shell. One of the reason may be the script file name is 'memcache.py', Python will first try to load the module in the current directory, .

Crawl Google search results and open link in Chrome window with Python script

This script will record the search keywords and visited url into MySQL database .These data may be useful, its of interest to look back what you have been searched in Google.

The script also demonstrate how to access MySQL Server and crawl web pages with python.

Python encode decode guide

For many Python beginners , the encode decode and unicode stuff is always very annoying. This guide aims to make things clear.

If you know a little about Java, you should know that internally JVM represent all strings as unicode, any raw data like text file on disk or data comes from network called byte stream. Python is similar. The difference is bytestring and unicode both are string in Python and in Java only unicode can be String.

If you know a little about Java, you should know that internally JVM represent all strings as unicode, any raw data like text file on disk or data comes from network called byte stream. Python is similar. The difference .

Previous Page 1 ... 4 5