- 博客(10)
- 收藏
- 关注
转载 Linux makefile 教程 非常详细,且易懂
最近在学习Linux下的C编程,买了一本叫《Linux环境下的C编程指南》读到makefile就越看越迷糊,可能是我的理解能不行。 于是google到了以下这篇文章。通俗易懂。然后把它贴出来,方便学习。 后记,看完发现这篇文章和《Linux环境下的C编程指南》的makefile一章所讲述的惊人的相似,只是这篇文章从一个实例切入,在有些地方比较好理解
2015-07-23 10:36:43 490
原创 用两个量筒得出一定加仑水的问题
class node(object): def __init__(self): self.cura = 0 self.curb = 0 self.x = [] self.pairs = [[0,0]]def append_node(wlist,tempa,tempb,i,old): new_node = node(
2014-09-06 08:11:40 470
原创 电路板排列问题分支限界解法(python)
from heapq import *from random import randintn1 = [4,5,6]n2 = [2,3]n3 = [1,3]n4 = [3,6]n5 = [7,8]total = []bestd = 0bestx = []b = []hlist = []from heapq import *from random import randin
2014-09-05 21:05:34 3088
转载 python创建二维数组
def genMatrix(rows,cols): matrix = [[0 for col in range(cols)] for row in range(rows)] for i in range(rows): for j in range(cols): print matrix[i][j], print '\n'
2014-08-28 21:49:26 731
原创 抓取华夏安全新闻并存入mysql
# -*- coding: utf-8 -*-import re, os, requests, sys, random, MySQLdbfrom bs4 import BeautifulSoup, NavigableString, Tag, UnicodeDammitfrom time import sleep, ctimeclass hxnews(object): def
2014-08-09 13:27:48 449
转载 python中的None
None是一个特殊的常量。None和False不同。None不是0。None不是空字符串。None和任何其他的数据类型比较永远返回False。None有自己的数据类型NoneType。你可以将None复制给任何变量,但是你不能创建其他NoneType对象。
2014-08-07 09:44:01 579
原创 python获取本地日期时间
>>> import time>>> ISOTIMEFORMAT='%Y-%m-%d %X'>>> time.strftime( ISOTIMEFORMAT, time.localtime() )'2014-08-06 16:04:04'>>> ISOTIMEFORMAT='%Y-%m-%d'>>> time.strftime( ISOTIMEFORMAT, time.localtime
2014-08-06 16:04:59 682
原创 python中原始字符串解析
python原始字符串是指在引号前添加 r 或 R 的字符串,如 r'hello'。原始字符串是为了解决ascii字符和正则表达式特殊字符间的冲突而产生的,但实际应用范围可以更广泛。其本质原理就是取消字符串由输入到读入内存过程中特殊字符的含义,使其按字面形式读入内存。>>> p = r'\n'>>> p'\\n'>>> print p\n>>> t = '\\n'>>> t'
2014-08-02 12:18:39 852
原创 python类中普通方法,类方法,静态方法
class Tools(object): number = 0 innum = 10 def __init__(self, config): print "tools class" @staticmethod def getStaticNumber(): Tools.number += 1 return T
2014-07-27 10:54:09 1952
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人