摘要: 用到了:QtCore.QRegExp类--------------正则表达式QtGui.QRegExpValidator类------做验证setValidator方法# !usr/bin/python # _*_ coding: utf-8 _*_from PyQt4 import QtGui, QtCoreclass MyQDialog(QtGui.QDialog): """ Class documentation goes here. """ def __init__(self, parent = None): "&q 阅读全文
posted @ 2014-03-13 19:37 洛卜哒 阅读(1773) 评论(1) 推荐(1) 编辑
摘要: QMainWindow主窗体当窗体大小小于屏幕时打开在左上角显示。利用QDesktopWidget类可以实现主窗口居中显示。The QDesktopWidget class provides access to screen information on multi-head systems.# !usr/bin/python # _*_ coding: utf-8 _*_from PyQt4 import QtGuiclass QMainWindow(QtGui.QMainWindow): """ Class documentation goes here. & 阅读全文
posted @ 2014-03-13 19:21 洛卜哒 阅读(2899) 评论(0) 推荐(0) 编辑
摘要: yum安装时出现Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try againor14: PYCURL ERROR 6 - "Coul... 阅读全文
posted @ 2014-01-16 14:31 洛卜哒 阅读(522) 评论(0) 推荐(0) 编辑
摘要: 1、启动ubuntu出现Ubuntu12.04:anerroroccurredwhilemounting/mnt/hgfs M--> 进入recovery模式--> 获得root权限-->修改配置文件 /etc/fstab--> 加入.host:/ /mnt/hgfs vmhgfs defa... 阅读全文
posted @ 2014-01-15 10:46 洛卜哒 阅读(320) 评论(0) 推荐(0) 编辑
摘要: bidict模块通过一对一映射结构的处理,利用python的切片功能。https://pypi.python.org/pypi/bidict模块提供三个类来处理一对一映射类型的一些操作'bidict', 'inverted', 'namedbidict'>>> import bidict>>> dir(bidict)['MutableMapping', '_LEGALNAMEPAT', '_LEGALNAMERE', '__builtins__', 阅读全文
posted @ 2013-12-11 19:11 洛卜哒 阅读(4678) 评论(0) 推荐(0) 编辑
摘要: 创建projectdjango-admin.py startproject mysitemysite/ manage.py mysite/ __init__.py settings.py urls.py wsgi.py启动服务器python manage.py runserver改变端口 python manage.py runserver 8080绑定ip python manage.py runserver 0.0.0.0:8080创建数据库sudo python manage.py syncdb创建自己的appsudo ... 阅读全文
posted @ 2013-12-05 23:21 洛卜哒 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 正在学习python,想试试web开发,于是搭建环境,按照网上的安装方法进行,在这里记录一下。1.下载安装ubuntuubuntu下载地址:http://www.ubuntu.org.cn/desktop,下载桌面版,安装。2.install pythonubuntu已经安装了python。luobuda@ubuntu:~$ python --versionPython 2.7.33.install mysqlsudo apt-get install my-server-5.5#mysql/etc/init.d/mysql start \\启动/etc/init.d/mysql restar. 阅读全文
posted @ 2013-11-29 20:57 洛卜哒 阅读(402) 评论(0) 推荐(0) 编辑
摘要: glob是python自带的用来处理文件路径相关操作的模块,它可以找出所有和特定模式匹配的文件路径名。只有3个配配符: * 匹配所有字符 ? 匹配单个字符 [] 匹配指定范围的字符 *.* 匹配所有文件 *.gif 匹配特定类型的文件glob.glob(pathname)返回匹配文件名的一个列表,pathname可以是绝对路径也可以是相对路径。>>> import glob>>> glob.glob('./[0-9].*')['./1.gif', './2.txt']>>> glob.glob 阅读全文
posted @ 2013-11-28 19:33 洛卜哒 阅读(408) 评论(0) 推荐(0) 编辑
摘要: http://www.pythonchallenge.com/一个有趣的python学习网站,就是在给出的图片和提示信息的帮助下,利用python解谜,然后进入下一关。第三关:http://www.pythonchallenge.com/pc/def/equality.html第三关的hintOne small letter, surrounded by EXACTLY three big bodyguards on each of its sides.和第二关一样,在网页源码里的一堆字符串中选出特定的字符串:一个左右两边都有三个大写字母的小写字母,比如 aXXXbXXXc,那么b符合要求。我 阅读全文
posted @ 2013-11-05 21:54 洛卜哒 阅读(255) 评论(0) 推荐(0) 编辑
摘要: http://www.pythonchallenge.com/一个有趣的python学习网站,就是在给出的图片和提示信息的帮助下,利用python解谜,然后进入下一关。第二关:http://www.pythonchallenge.com/pc/def/ocr.html第二关的hintrecognize the characters. maybe they are in the book, but MAYBE they are in the page source.很容易看出应该是在网页源码中找答案。我看查看网页源码,会发现这样一句话 >> equality这就是进入下一关的key, 阅读全文
posted @ 2013-11-01 18:55 洛卜哒 阅读(200) 评论(0) 推荐(0) 编辑