Tag Archives: python

Bug in Python3.6 standard library when compile using MinGW

Python36 is compiled by Visual Studio 2015 or MSBuild tools 2015, which included Compiler v19.00 (MSC_VER 1600). But “C:\Python36\Lib\distutils\cygwinccompiler.py” can’t handle it… I modify it simply like this:

Posted in Memo | Tagged , , , , , , , | Comments Off on Bug in Python3.6 standard library when compile using MinGW

python version and visual c++ version

在编译Python扩展的时候常常会遇到版本不匹配的问题,以下搜集了常见的版本的VC版本的对应关系。 * MSC v1310: Visual Studio 2003 * Python 2.4.x Python 2.5.x * MSC v1500: Visual Studio 2008 * Python 2.6.x Python 2.7.x Python 3.0.x Python 3.1.x Python 3.2.x * MSC v1600: Visual Studio 2010 * Python 3.3.x Python 3.4.x

Posted in Memo | Tagged , , | Comments Off on python version and visual c++ version

highlight code using pygment

使用pygment来高亮代码,然后直接嵌入到html里简单很多了,可以写个脚本调用pygment,并且自动把css嵌入。 Update: 不过这个会和已有的plugin冲突,还是算了…… This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

Posted in Memo | Tagged , , | Comments Off on highlight code using pygment

使用git的hooks/commit-msg来添加branch信息

git不会在commit里保存branch的信息,这个导致了版本回溯的时候不能很好的弄明白这个branch的用途,一般也没有习惯在创建一个branch后提交一个空的commit记录这个branch的用途。 所以git的hooks算是比较好的一个自动化的方法。 我比较熟悉python,所以就不用难懂的sh了,自己写了一个脚本,如下:

Posted in Memo | Tagged , , , , , | Comments Off on 使用git的hooks/commit-msg来添加branch信息

modify a python binding for UnQLite

I use UnQLite, and find a python binding. The original source version is https://bitbucket.org/east301/py-unqlite. For the original author not update pyunqlite almost 6 months. I decided copy it to github and maintain myself (https://github.com/buaabyl/pyUnQLite). The binding using Cython, and support … Continue reading

Posted in Memo | Tagged , , , , , | Comments Off on modify a python binding for UnQLite

fixed pycurl “ImportError: DLL load failed: The specified procedure could not be found.”

Because normal package download from pypi throw: ImportError: DLL load failed: The specified procedure could not be found. I guess this maybe mismatch of openssl version, so I try to build with version 1.0.0.t and replace dll with version 0.9.8, … Continue reading

Posted in Memo | Tagged , , , , , , | Comments Off on fixed pycurl “ImportError: DLL load failed: The specified procedure could not be found.”

Create a windows hosts config tool

Using python to to this, load from hosts, then parse using re. then modify, and write back.

Posted in Others | Tagged , , , , | Comments Off on Create a windows hosts config tool

用Python脚本来解析csv文件

最近需要处理excel的文本,发觉csv格式比较方便,于是写了一个简单的脚本来解析csv文件,目前只知道每行以回车结束,每列以逗号结束,如果内容有逗号的以双引号包起来,不过还不知道怎么处理内容是双引号的。 csv以utf-8编码,可以有BOM,也可以没有。 以下是代码:

Posted in Others | Tagged , , , | Comments Off on 用Python脚本来解析csv文件

关于高层次综合

最近对高层次综合比较感兴趣,目前有一个需求是把一些算法或者控制用C来描述,然后再改写为Verilog。想抽空自己做高层次综合工具。 初步的打算是把自己写的CRC编码器转换为Verilog。而这个可以作为练手的东西。

Posted in Others | Tagged , , , , | Comments Off on 关于高层次综合

编译Subversion的Python绑定

Binary is locate in google code http://code.google.com/p/svn-python-win32/ This is subversion python bindings for windows.Upgrade from python2.5 to python2.7.2, I can’t find suitable svn-python.And the major problem is apache2.2.22 which download from http://httpd.apache.org/download.cgi with mod_wsgi and python2.7.2 throw “Runtime Error”. Because … Continue reading

Posted in Memo | Tagged , , , , , , , , | Comments Off on 编译Subversion的Python绑定