cx-Oracle is a Python Oracle DB connection package, ealier today I met some trouble installing on my macbook running Mavericks, after hacking I found the means to install it correctly:
instantclient-sdk-macos.x64-220.127.116.11.0.zip from http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html.
Download the cx-Oracle source code from http://cx-oracle.sourceforge.net.
Create a new directory to place the Oracle client files.
mkdir -p /opt/oracle/
The PyPI(Python Package Index) is a repository of software for the Python programming language. There are currently 45k packages. Anyone can upload a Python project on it. Since your project being successfully uploaded, everybody in the world can simply install it by
easy_install. It’s significant to learn how to submit a project on PyPI.
Assume that you have a project named
my_project, firstly you need to move it into an empty folder, then create a file named
setup.py like this:
The significance of understanding metaclass lies not in using itself, but in understanding what classes are in Python. For the purposes of this post, I will be talking about classes in Python, and try to explain what is metaclass.
Everything in Python is an object.
It is well-known that everything in Python is an object, and classes are used to create objects.
In fact, classes are objects too.
>>> class Dog(object):
>>> foo = Dog()
<__main__.Dog object at 0x10baf0f10>
When we defined the classs
Dog, Python created an object named
Dog, and the object
Dog is an object as well as an object creator.
It’s fairly easy to learn the Python syntax, but Python as a full-featured language, is not that easy to be fully mastered.
In my experience, these questions are the most likely be asked during a Python job interview, I wrote down the answers, hope that may help you!
**Q: What is lambda operator in Python, how do you use it?****
A: The lambda operator or lambda function is a way to create small anonymous functions
>>> f = lambda x, y : x + y
Recently I shut down my weblog, thinking about how to write articles with more influence. Then I decided to start a brand new blog, and this time I write articles only in English.
For years I’ve been blogging in Chinese, which developed me a bad habit: Always want to translate some nice stuff from English to Chinese, and rarely write something on my own. Due to this, I decided to start a English weblog where I write only original articles.
Besides, I write stuff for improving my English, English is the working language of the hacker culture and the Internet, for better take part in technical discussions, I must improve my fluency in English.
I will share my ideas and thoughts, continue writing interesting stuff here.
So this is the fresh start.