Trip (Nice – Monaco – Menton – Cannes – Antibes)

0

尼斯

摩纳哥公国

芒通

Install pygtkglext 1.1.0 (win32)

0

Pygtkglext comes with two options of installation, one can either go throught the traditional “gcc” way (configure->make->make install) or the “python” way (python setup.py build->install).
 
Let us look at the second one first, the building process would have gone smoothly as long as your remove the out-of-date pkgc_version_check to be found at line-89 and the import of Overrides to be found at line-103 (don’t know if it’s a good idea though). It will generate correctly the ./gtk/gt(d)kgl/gt(d)kglext.c files but will in most cases be blocked by an attribute error some time later as the dsextra.py has undertaken some big changes ever since the release of our beloved package. Two solutions are nevertheless proposed, but are both somewhat, say, arduous.
1. Overwrite the dsextra.py with one of an older version (that is, to find something that dates back to no late than 2004)
2. Modify the pygtkglext setup.py file to cope with the CVS HEAD changes to dsextra.py. Basically, you want to add ‘install_data’: PyGtkInstallData to the cmdclass dictionary, and move the calls to add_template_option to a class derived from InstallData. (found here)
 
It might just be time for us to revert to the old school way…
First, you need to be sure that you have added the following to your environmental variables:
export PYTHON = path_to_your_python.exe (using ‘/’ and not ‘\’)
export PYGTK_CODEGEN = path to gtk-2.0/codegen/codegen.py (using ‘/’ and not ‘\’)
It is recommended to install it under Python2x/Lib/site-packages just as the others, this can be achieved by providing prefix=python_path/Lib while executing ./configure
Just don’t press enter yet, you have to also link in the python interpreter, the overall command will look like:
./configure –prefix=’C:/Python27/Lib’ LDFLAGS=’-L/c/Python27/libs -lpython27′ and this would suffice for the configuration…
 
For some reason, the make process fails when generating the gt(d)kglext.c files. Luckily we already had the setup.py provide them for us.
So just copy the file into the right folder and pursue the process.
 
Finally, before launching make install you need to replace the ‘\’ with ‘/’ at line-176 and 177 (concerning pyexecdir and pythondir) of the two Makefile(s) found in ./gtk/gt(d)kgl.
 
Now you have successfully installed pygtkglext1, but it wouldn’t work just yet.
Starting from python2.5a1, extension modules with the file extension ‘.dll’ can no longer be imported using a single ‘import’ statement. As a result, the DLL files created during the final step could not be used directly. Now take a look at the source folder, the building step that we initiated long ago (with setup.py) has created for us just what we need. The .pyd files found under ./build/lib.win32-2.x/gtk/gt(d)kgl are almost the same as .dll except that it has a initialization function and that it could be directly ‘imported’ by the others.

Install gtkglext 1.2.0 (win32)

0

I am using visvis, an excellent and light weight python library for simple 3D visualization in the programme that I’m writing (PyRod).
While it poses no problem under linux, its gtk backend requires the use of pygtkglext and as a result gtkglext, both should be built and installed manually under windows.
The source file can be found here, but at the time when this post was being written, these files have not been touched for at least 6 years…
It took me some time to find out how to do it, so I hope this post to be at least of some help to others…
 
Basically, there are two problems…(supposing that you already have MinGW installed on your computer)
1. The package requires pangox which is the X–Windows backend of the Pango library, and you wouldn’t need that on a win32 installation. To solve this, one need to carefully remove all the lines and phrases involving pangox in both the configure and configure.in
2. Certain files need to be modified to maintain the compatibility with Gtk+ >= 2.20 as has been mentioned here
It shouldn’t be of much difficulty, nevertheless, I’ve uploaded the fixed files.
(place the pixman.c and pixmap-mixed.c under ./examples, and gtkglwidget.c under ./gtk)
This will work, however, only under the condition that you have all the dependencies installed already (OpenGL, gtk+-2.0, glib, etc.) and have set up the right environmental variables (PKG_CINFIG, PKG_CONFIG_PATH, etc.).
 
Coming up next………………………..Install pygtkglext (if ever I managed to figure it out…)

Generate python (using pygtk) executables using py2exe (win32)

0

I’m getting old…real old…now I need to write everything down in case they somehow slip my mind…
I’ve been trying to generate executables for my little program written in Python, under both x64 and Linux(Ubuntu 11.04), and with various programs…but I haven’t been really successful, despite the fact that I might not have put in enough effort as well… As a matter of fact, none of my executable really works on others’ machine. (works perfect on my own PC though)
Anyway, now there is something which seems to be working…the environment is x86 this time…with the help of py2exe
So again, I’m getting old, and I’m writing it down…
For record, the following is basically a combination of several recipes found on the web, I don’t really have any personal contribution to this…
So, py2exe should normally work with simple programs, a ‘hello world’ for example…but things just get complicated once PyGtk and Matplotlib are involved…
Let’s have a look at my setup.py first…

from distutils.core import setup
import py2exe
import matplotlib

setup(
    name = 'PyRod',
    version = '1.5',

    windows = [
                  {
                      'script': 'PyRod.py',
                      'icon_resources': [(1, "Rod of Asclepius.ico")],
                  }
              ],

    options = {
                  'py2exe': {
                      'packages':'encodings',
                      'includes': 'cairo, pango, pangocairo, atk, gobject, gio',
                      'dll_excludes': ['libglade-2.0-0.dll'],
                  }
              },

    data_files = matplotlib.get_py2exe_datafiles(),
)

1. You should manually include ‘cairo’, ‘gobject’, ‘gio’ etc.
2. You should add ‘matplotlib.backends.backend_tkagg’ to ‘includes’ if you do not specify a different default backend other than tkagg by matplotlib.use() in your program.
3. You could manually exclude ‘libglade-2.0-0.dll’.
4. You should provide the necessary data files for matplotlib by data_files = matplotlib.get_py2exe_datafiles().
5. Copy msvcp90.dll to your program folder (This is actually inappropriate as one does not normally has the right to redistribute this file). The correct solution might be a little bit more complicated.

One more thing, if one is to use other theme engines than the default ones provided in standard Gtk installation.
One should first download and precompiled engines and associated themes here (or you’ll have to get the source code and compile them yourself)
Remember to copy the /etc /share and /lib directories (or at least that of the engines that are required) from your Gtk installation folder to the distribution folder generated by py2exe.
Check out this post if you don’t know how to tell GTK on Windows which theme to use.

I curse x64.

西山周氏

0

五载未归故里 偶翻家谱 居然傍上了濂溪先生
濂溪先生即周元公敦颐(1017-1073) 出淤泥而不染便是出自此公之口
话说这元公有二子 长名寿 次名焘
绍兴之翔宇 豫才皆为焘之世孙 吾祖孝琚亦源于焘一支
孝琚始徙西山 子孙百余人 此处恕不赘述
其有第八世孙国行 国行生二子
长子子孙繁庶 瓜瓞绵延
次子士新 传至吾辈二十三世 唯余一人

Go to Top