易截截图软件、单文件、免安装、纯绿色、仅160KB

在Windows里搭建Python的GTK+环境搭建注意事项

在Windows里搭建Python的GTK+环境还是比较麻烦的有以下几个注意事项
1、PyGTK网站上下的包,可能没有Glade类(Lib\site-packages\gtk-2.0\gtk目录下没有glade.pyd),如果没有这个类你就无法在程序里导入Glade工具创建的xml,手写界面还是挺麻烦的。
2、GTK网站上的GTK包,没有包括Glade的DLL文件,还是无法读入Glade的xml文件
所以要按如下方法来搭建GTK+环境
1、安装Python,最好是2.6.5这个版本支持的比较全面
2、从http://ftp.acc.umu.se/pub/GNOME/binaries/win32/下载最新的GTK+包,解压到你自己的目录,并设置系统路径
3、从http://ftp.acc.umu.se/pub/GNOME/binaries/win32/下载最新的pycairo, pygtk, pygobject, 安装到Python的目录下,做为第三方包
4、从http://ftp.acc.umu.se/pub/GNOME/binaries/win32/下载最新的pango, libglade, glib, 解压到GTK+的目录下
经过以上4步,GTK+环境就应该可以工作了。


相关文档:

Python 使用C代码——swig

Ref : http://www.swig.org/translations/chinese/tutorial.html
假设你有一些c你想再加Python.。举例来说有这么一个文件example.c
 /* File : example.c */
 #include <time.h>
 double My_variable = 3.0;
 int fact(int n) {
     if (n <= 1) return 1;
&nbs ......

python字典排序

python字典排序
1、 
准备知识:
在python里,字典dictionary是内置的数据类型,是个无序的存储结构,每一元素是key-value对:
如:dict = {‘username’:‘password’,‘database’:‘master’},其中‘username’和& ......

python,c++,C#随机数生成

先说python
python的random模块提供了多个伪随机数发生器,默认都是用当前时间戳为随机数种子。
下面是该模块几个最常用的函数
random() Return the next random floating point number in the range [0.0, 1.0). 
randint(a,b) Return a random integer N such that a <=
N <= b
randrange([star ......

python学习1 使用类

#使用类
class CPerson:
#类变量好比C++中的静态成员变量
population = 0

def SayHi(self):
print('Hello World')
def HowMany(self):
if CPerson.population == 1:
print('I am the only person here.')
else:
print(('We have %d perso ......

python的一些操作

# coding=gb2312
# 用中文注释前务必加上第一行
# 求模运算符,和C语言一样
print 10%9
# 整数相除仍然是整数
print 5/2
# 2后加上.就变成浮点数了
print 5/2.
# **表示求幂运算
print 7**4
# 函数用时要加上module.function
import math
print math.floor(19.8)
# 函数名也可以成为变量
func = math.floor
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号