Python
文章平均质量分 60
空山
这个作者很懒,什么都没留下…
展开
-
Python IDLE's subprocess didn't make connection
Win7 上安装Python 2.7.1,启动IDLE报错。IDLE's subprocess didn't make connection.Either IDLE can;t start a subprocess or personal firewall software is blocking the connectiongoogle 了一下。解决方案惊人的一致,大概都是修改...2011-04-15 23:35:19 · 59 阅读 · 0 评论 -
django 基本命令操作
pythondjango 框架django 基本命令操作:manage.py shell:进入SHELL状态django-admin startproject jay:建立一个jay的项目python manage.py startapp haha 建立一个haha的APPpython manage.py runserver 启动服务器python ...原创 2011-04-07 12:53:54 · 43 阅读 · 0 评论 -
在Windows上安装Django
关键字: windows django python 首先要准备好相关的软件:Python 2.5PIL for py2.5Mysqldb for py2.5Django 0.96Apache 2.2.xmod_python 3.3.1 for py2.5以上软...原创 2011-04-07 10:34:13 · 71 阅读 · 0 评论 -
python异常捕获try except
python的异常处理机制设计的比较传统,在日常的开发中,基本满足我的需要下面就python的异常,几点小小的讨论1. try...exceptPython代码 tommy@lab3:~$ python Python 2.5.2 (r252:60911, Jan 4 2009, 17:4...原创 2011-07-21 13:24:05 · 120 阅读 · 0 评论 -
EditPlus for python
EditPlus for python EditPlus是我常用的文件编辑器之一,用它来下脚本程序甚是方便,下面来看看如果配置吧:1.先到www.editplus.com上下载editplus.exe,一步一步安装就好了,只有30天的试用期。2.来配置python环境,到www.editplus.com 上下载python配置环境,要下载对应的版本啊。(为了...原创 2011-06-18 14:49:03 · 67 阅读 · 0 评论 -
Python:time, strftime和strptime
最常用的time.time()返回的是一个浮点数,单位为秒。但strftime处理的类型是time.struct_time,实际上是一个tuple。strptime和localtime都会返回这个类型。>>> import time>>> t = time.time()>>> t1202872416.4920001>...原创 2011-08-19 13:18:29 · 64 阅读 · 0 评论 -
[Python学习]使用minidom来处理XML的示例
作者网站:http://www.donews.net/limodou/archive/2004/07/15/43609.aspx 一.XML的读取.在 NewEdit 中有代码片段的功能,代码片段分为片段的分类和片段的内容。在缺省情况下都是用XML格式保存的。下面我讲述一下,如何使用minidom来读取和保存XML文件。下面是片段分类的一个示例文件--catalog.xml...原创 2011-04-22 17:57:59 · 79 阅读 · 0 评论 -
Django使用心得(一)
本篇主要讲解一些基本的操作:创建django工程 数据库相关配置 后台管理界面1. 创建django工程安装完django之后,在python安装目录下的Scripts目录中有个django-admin.py的脚本,可以用来新建django工程。django-admin.py startproject testSite1新建了一个名为testS...原创 2011-04-18 03:36:45 · 60 阅读 · 0 评论 -
Python抓取页面中超链接(URL)的3中方法比较(HTMLParser、pyquery、正则表达式)
HTMLParser版:#!/usr/bin/python# -*- coding: UTF-8 -*-import HTMLParserclass UrlParser(HTMLParser.HTMLParser): def __init__(self): HTMLParser.HTMLParser....原创 2012-03-28 21:54:25 · 124 阅读 · 0 评论