python Eric 的使用
最近使用python过程中,python界面的编程工具GTK-Python,但是界面的美观性不如Qt-Creator中的Qt-Designer,无法实现设计是视图绘制,有点让人失望。
网上发现有人介绍python Eric IDE,比较好奇,安装上看看吧:
#yum install eric4
但是新建的工程无法run,说缺少pyuic4,于是安装上开发包
#yum install PyQt4-devel
因为之前我按装了qt4.7类库,所以一切都那么顺其自然,新建了一个对话框,因为python eric 中嵌入了Qt -Designer工具,所以绘制的窗口比较美观,上档次,呵呵,不错,保存untitled.ui文件,关闭designer窗口,回到eric IDE 窗口发现在source视图下多了一个Ui_untitled.py文件:
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/fedora11/myPro/eric/untitled.ui'
#
# Created: Mon Mar 8 11:00:42 2010
# by: PyQt4 UI code generator 4.7
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(334, 170)
self.heyButton = QtGui.QPushButton(Dialog)
self.heyButton.setGeometry(QtCore.QRect(60, 100, 85, 27))
self.heyButton.setObjectName("heyButton")
self.pushButton_2 = QtGui.QPushButton(Dialog)
self.pushButton_2.setGeometry(QtCore.QRect(200, 100, 85, 27))
self.pushButton_2.setObjectName("pushButton_2")
self.lineEdit = QtGui.QLineEdit(Dialog)
self.lineEdit.setGeometry(QtCore.QRect(90, 30, 151, 24))
self.lineEdit.setObjectName("lineEdit")
self.dial = QtGui.QDial(Dialog)
self.dial.setGeometry(QtCore.QRect(150, 60, 50, 64))
self.dial.setObjectName("dial")
self.retranslateUi(Dialog)
QtCore.QObje
相关文档:
zz from: http://blog.sina.com.cn/s/blog_4b5039210100f1tu.html
原文有点小错误,改了一点点。
我们知道python只定义了6种数据类型,字符串,整数,浮点数,列表,元组,字典。但是C语言中有些字节型的变量,在python中该如何实现呢?这点颇为重要,特别是要在网络上进行数据传输的话。
python提供了一个struc ......
PLY模块 是Lex/YACCPython 的实现,可以用来实现词法分析/语法分析,但如何用,还没研究,以后有时间再研究吧;
主页: http://www.dabeaz.com/ply/
pycparser模块 是使用PLY模块分析c语言语法的模块,没什么文档,但模块自带了例子和测试用例。
主页: http://code.google.com/p/pycpa ......
▾ hide table of contents
0. ↑ 显示完整目录
1. 深入#
2. 布尔类型#
3. 数值类型#
1. 将整数强制转换为浮点数及反向转换#
2. 常见数值运算#
3. 分数#
4. 三角函数#
5. 布尔上下文环境中的数值#
4. 列表#
1. 创建列表#
......
1.c调用python:
实例代码:
main.c调用test.py的
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//main.c
#include <windows.h>
......