How to install lxml for Python 3.4.3 on Windows

with the command python -m pip install lxml-3.4.0-cp26-none-win32.whl Before downloading you should ... is a Pythonic binding for the C libraries libxml2 and libxslt which quite easy to use. Install lxml on Linux ... is a breeze. But not so for Windows users. If you don't want to install it from the source code ... ://pypi.python.org/pypi/lxml/3.4.0#downloads http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml And then install

How to split path and file name in Python

you want to split the path and the file name, you want to split it into the following two parts ... Suppose you have a path, for example /host/name/public_html/lib/general_functions.php Now ... os.path.split method >>> import os >>> path,filename=os.path.split("/host/name/public_html/lib ... /general_functions.php") >>> path '/host/name/public_html/lib' >>> filename 'general_functions.php

Using urllib3 BeautifulSoup4 and Python to crawl and analyze web page

The urllib3 is the new package in Python that will replace urllib2, the urllib2 package has been remove form Python package library.

To parse web page source and HTML, we also need BeautifulSoup4, it will parse the html source to a DOM tree and then we can do various queries on this tree data structure, for example you can find element by css selector, just like jQuery.

To parse web page source and HTML, we also need BeautifulSoup4, it will parse the html source to a DOM tree and then we can do various queries on this tree data structure, for example you can find .

The story of LP_c_long

The full class name of this type is ctypes.wintypes.LP_c_long, when I programming a script using win32 API, I sometimes get a HWND object of this type. But the HWND also could be returned as int type.

I get two HWND point to the same window but with different type, compare them with == always return False.

How to deal with UnicodeEncodeError in Python

Python, especially version 2 is notorious for unicode decoding and encoding problem. I had been bitten by it in the era of Python2, and its painful . The unicode API in Python 2 is borken, inconsisitent and confusing.

Now we using Python 3. It supposed to be better. But I still hit the brick wall in Python 3. I have a little interest in figuring out whats really going on in most cases, the only thing want is to find a quick solution to make it stop throwing any encoding exceptions.

Now we using Python 3. It supposed to be better. But I still hit the brick wall in Python 3. I have a .

Python win32 programming example: register hotkey and switching tab

and fun to programming win32 api in Python. Add this to the top of the script: from ctypes import ... . This tutorial will shows you a simple Python script to make task switching more efficient. The idea ... development platform, the Java JNA package, or Python. Many programming languages and platforms ... can interact with win32 API. I decide to use Python. With its amazing ctypes module , its so easy

Implementing InsertionSort in Python

Insertion sort algorithm is a simple algorithm, its an iterative algorithm, without incurring recursive. Because it didn't take the divide and conquer approach. It just compare and move elements around in the array.

I had written it in PHP.

Implementing quick sort in Python with classic and Pythonic way

QuickSort is one of the mostly used sort algorithm in CS. It has the best average performance.

The algorithm is very simple and elegant , its a recursive algorithm, at each recursive, one pivot is selected and divide the array into two sub arrays, one less than the pivot and another one bigger than it.

Testing in Python with doctest, unittest and Nose

Test driven, I bet you must have heard of it in many different places. It already expanded to almost all languages and platform. This post will show you testing in Python.

If you have Python, you have doctest, it shipped with Python. We will start from this one.

PHP and Python exception handling example

Exception handling is a de facto language feature now, but different language has different view of it. Personally, I prefer handling exception with language feature other than logical code. It makes the code much easier to read.

This is a simple example in Python show a message when trying to open a file that not exist.

Previous Page 1 2 3 ... 5 Next Page