python libxml2 dita
For correct transformation of DITA files (XML-standard for modular documentation), it is necessary to pull information from DTD (document...
January 21, 2016
In theory, changing content of an Excel file is easy:
* Parse XML from the zip-file
* Change XML
* Save XML into the zip
In practice I got the error: >>...
September 30, 2015
In the year 2001 I started to experiment with GUI applications in Python. The experience was summarized and published in the article "A complete Python Tkint...
July 09, 2015
After upgrading the local Linux system, my python paramiko (ssh protocol implementation) program stopped working, with the error message:
CTR mode needs coun...
February 20, 2015
GNU FriBidi is an implementation of the Unicode Bidirectional Algorithm (bidi). There is a Python binding PyFribidi, but it is not complete. What I need is n...
December 08, 2014
HTML is the main output format for XML transformations. Every XSLT-processor, including libxslt/libxml2, supports it. But if you transform a libxml2 tree man...
October 31, 2013
The number (and dates) in Excel are float numbers. How these numbers are displyed to an user -- as an integer, or with two digits after a point, etc -- are d...
October 22, 2013
Sometimes an error and the error message are different things. One of the examples is that my wxpython-program did not want to start after converting to exe ...
July 31, 2013
In some cases it is useful to store media files inside the python code itself. For images, PyEmbeddedImage and the script img2py.py work well. But for GIFAni...
March 27, 2013
Python standard library xml.etree.ElementTree is convenient to work with a simple subset of XML. Unfortunately for me, this subset does not include processin...
June 19, 2012
Many of python-xml code is probably wrong. Tracing a bug, I found an interesting WTF. A minimal example:
s1 = "\xa0x\xa0"
s2 = u"\xa0x\xa0"
June 01, 2010
I need to reuse a function in a file. The usual way is just to import this file as a module. But what to do if the name is "bad"? The following doesn't work:...
June 12, 2009
Do you generate [La]TeX files using Python? If yes, do you escape the special characters. Haven't you forgotten to escape also empty strings?
To avoid reinve...
October 17, 2008
Unpleasant surprise from libxml2 bindings for Python: one must care for encoding conversion.
May 27, 2008
This beautiful construction was not obvious for me.
October 15, 2007
I've released a content management system for static pages:
Use InPlace CMS to maintain a bundle of HTML pages i...
October 04, 2007
Python has a quite decent internal support of unicode. But sometimes it's hard to find how to exploit the support.
I've lost some time solving a simple probl...
August 17, 2007
The best place to analyze log files is the local computer, not the server:
1) Log files grow fast, taking all the server space
2) Queries might be CPU-intens...
August 16, 2007
I have a program which is an example of usability nightmare. It's easier to create data in Excel and somehow migrate them to that program. Unfortunately, the...
July 20, 2007
How do you thing, what the following Python/libxml2 code does?
for kid in node.get_children():
Do you think the code gets the children of ...
May 22, 2007
I'm working on an unicode-aware application. I like to use print to debug programs, but in this case it was nightmare. The most popular result of print was:
March 23, 2007
I'm investigating the structure of an XML file. The best tool is an usual text editor (vim), but I need to look at some specific tags in some specific contex...
March 05, 2007
Seems interesting: plasTeX is a LaTeX document processing framework written entirely in Python. It currently comes bundled with an XHTML renderer (including ...
October 25, 2006
Finally, I traced out why time-to-time my functional tests stop passing.
* Some steps are associated with Python functions.
* Signatures of such steps depend...
August 24, 2006
To force the python mode for a file, add the following comment at the beginning:
# -*- mode: python -*-
It's also possible to add other options as well. Unfo...
August 23, 2006
Here is a way to get the currently executing Python file:
print (lambda x:x).func_code.co_filename
Probably there is a simpler way, but I haven't found it. ...
August 16, 2006
In mary cases, LaTeX should be run several times to get the correct result (for example, to resolve cross-references). The only way to detect if re-run is re...
August 10, 2006
What will this code print?
for item in ('aaa'): print item
The result is:
I think you expected the following as the result:
I was near reporting...
August 02, 2006
A small Lisp vs Python article: "Python for Lisp Programmers". The title is very untraditional, one expects Python and Lisp swapped.
January 05, 2006