这篇对应的是习题16,读写文件
# -*- coding: utf-8 -*-
#对文件更多操作复制A文件的内容到B文件
#from sys import argv
from os.path import exists
prompt = "> "
from_file = raw_input("please input the filename where you want to copy...
分类:
编程语言 时间:
2014-05-05 12:54:02
阅读次数:
402
题目链接:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5176
Simple Equation
Time Limit: 2 Seconds Memory Limit: 65536 KB
There are many Equations. Some are difficu...
分类:
其他好文 时间:
2014-05-03 17:47:01
阅读次数:
343
Sliding Window
Time Limit: 12000MS
Memory Limit: 65536K
Total Submissions: 36315
Accepted: 10756
Case Time Limit: 5000MS
Description
An array of size n ≤ 106 is gi...
Valera wanted to prepare a Codesecrof round. He's already got one problem and he wants to set a time limit (TL) on it.
Valera has written n correct solutions. For each correct solution, he knows it...
分类:
其他好文 时间:
2014-05-03 16:53:51
阅读次数:
364
Max Sum of Max-K-sub-sequence
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 5673 Accepted Submission(s): 2049
Problem Description...
分类:
其他好文 时间:
2014-05-03 16:30:10
阅读次数:
412
原理:利用python的win32模块,注册服务,让代码在后台运行,检测光盘并拷贝文件
启动的方法就是直接在cmd下,main.py install ,然后去windows 的服务下就可以看到The smallestpossible Python Service 这个服务,你可以启动,停止,还可以设置成开机自动启动。启动服务后,会自动检测光盘并在后台拷贝文件
main.py
import...
分类:
其他好文 时间:
2014-05-03 15:58:45
阅读次数:
235
BeautifulSoup 善于网页数据分析
请参考: http://www.crummy.com/software/BeautifulSoup
例如: 抓取CSDN首页极客头条内容 soup.py
import urllib2, re
from BeautifulSoup import BeautifulSoup
page = urllib2.urlopen("http://gee...
分类:
编程语言 时间:
2014-05-03 15:31:42
阅读次数:
401
点击打开链接
Party All the Time
Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 2961 Accepted Submission(s): 939
Problem Description...
分类:
其他好文 时间:
2014-05-03 15:30:56
阅读次数:
374
#在下载好的django路径下执行django的安装
#https://pypi.python.org/pypi/Django/1.6.4
python3setup.pyinstall
#
#新建django项目
django-admin.pystartprojectmysite
#
#运行django项目
python3manage.pyrunserver[port]
#
#创建一个app
python3manage.pystartappappname
#
..
分类:
编程语言 时间:
2014-05-03 14:48:38
阅读次数:
413
只是看看能不能成功使用python操作redis,redis具体的数据结构和使用会在以后学习。安装连接redis的包pipinstallredis本地已经在6379端口启动了redis服务。In[1]:importredis
In[2]:r=redis.StrictRedis(host=‘localhost‘,port=6379,db=0)
In[3]:r.set(‘foo‘,‘bar‘)
Out[3]:Tru..
分类:
编程语言 时间:
2014-05-03 14:38:32
阅读次数:
405