
python
文章平均质量分 65
ghnbvfrtyujm
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python使用cgi模块处理表单
创建test.html文件 hello username: password: 在test.html目录下创建文件夹cgi-bin(文件夹名必须为此),在cgi-bin文件夹下创建python脚本文件test.py #!/usr/bin/python import cgi header = 'Content原创 2013-05-13 20:12:05 · 4414 阅读 · 0 评论 -
python 简单文件操作 修改文件指定行
使用python进行简单的文件读写 例一: #!/usr/bin/python import sys import re if __name__=="__main__": f=file("hi.txt","w+") li=["hello\n","hi\n"] f.writelines(li) f.close() "W+"模式:如果没有hi.txt则创建文件写入;如果存在,则清空原创 2013-05-14 10:22:01 · 11181 阅读 · 0 评论 -
python SimpleHTTPServer添加POST方法
实现功能比较简单。先在终端下运行该脚本,然后在浏览器打开localhost:8000即可看到当前目录下的文件 也可以do_GET和do_POST方法中添加更多的功能语句实现更丰富的功能。 import SimpleHTTPServer import SocketServer import cgi PORT = 8000 class ServerHandler(SimpleHTTPSer原创 2013-05-14 10:43:15 · 5134 阅读 · 0 评论