#!/usr/bin/python# -*- coding: utf-8 -*-#将错误日志输出到文件import timelog_path ='/root/log.log'fo = open(log_path,'a')a=0try: result=10/a print resultexcept.....
分类:
其他好文 时间:
2016-01-13 17:21:55
阅读次数:
186
Milking TimeTime Limit:1000MSMemory Limit:65536KTotal Submissions:6599Accepted:2764DescriptionBessie is such a hard-working cow. In fact, she is so fo...
分类:
其他好文 时间:
2016-01-11 20:01:43
阅读次数:
213
enumerate函数接受一个可遍历的对象,如列表、字符串,可同时遍历下标(index)及元素值(value)>>> a = ['aaa','bbb','ccc',1235]>>> print(a)['aaa', 'bbb', 'ccc', 1235]>>> print(len(a))4>>> fo...
分类:
编程语言 时间:
2016-01-10 20:04:56
阅读次数:
438
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
1.源码connection=MySQLdb.connect( host="thehost",user="theuser", passwd="thepassword",db="thedb")cursor=connection.cursor()cursor.execute(query)fo...
分类:
数据库 时间:
2016-01-06 17:46:09
阅读次数:
184
The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo...
分类:
其他好文 时间:
2016-01-06 00:09:07
阅读次数:
206
Creating an ActivityImplementing a user interfaceDeclaring the activity in the manifestUsing intent filtersStarting an ActivityStarting an activity fo...
分类:
其他好文 时间:
2016-01-04 13:13:21
阅读次数:
187
The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo...
分类:
其他好文 时间:
2016-01-02 22:34:30
阅读次数:
218
#include int main(){ int a[10][10], i, j, k=0, m, n; printf("输入n(n=i; j--) { k++; a[n-i-1][j]=k; } fo...
分类:
编程语言 时间:
2016-01-01 00:30:35
阅读次数:
246
题目:Validate if a given string is numeric. Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended fo...
分类:
其他好文 时间:
2015-12-30 07:00:07
阅读次数:
150