码迷,mamicode.com
首页 >  
搜索关键字:coding    ( 12955个结果
windows下django1.7 +python3.4.2搭建记录2
1、自定义页面写一个显示当前时间的页面views.py文件加一个使用模板的模块,整体内容为:#coding=utf-8from django.shortcuts import renderfrom django.template.loader import get_templatefrom djan...
分类:编程语言   时间:2015-03-06 20:47:13    阅读次数:225
python 相关编码[转]
python 相关编码[转]三篇文章,导航:(一)(二)(三)(一)怎么避免UnicodeEncodeError: ‘ascii’ codec can’t…类似的错误?1、首先在py文件头部指定文件内容编码,例如:# coding: utf82、文件保存的时候要和py文件头部编码一致3、在用deco...
分类:编程语言   时间:2015-03-06 18:43:59    阅读次数:192
OrderedDict实现FIFO
OrderedDict可以实现一个FIFO(先进先出)的dict,当容量超出限制时,先删除最早添加的Key: #!/usr/bin/env?python #-*-?coding:?utf8?-*- from?collections?import?OrderedDict class?LastUpdatedOrde...
分类:其他好文   时间:2015-03-06 17:32:17    阅读次数:513
Python filter()删除1-100内素数
用filter()删除1-100内的素数: 1 #!/usr/bin/env python 2 #coding:utf-8 3 import math 4 def fil(n): #定义fil函数 5 flag = 0 #设置flag 6 for i in range(2...
分类:编程语言   时间:2015-03-06 16:59:10    阅读次数:166
机器学习 Python实现逻辑回归
# -*- coding: cp936 -*- from numpy import * def loadDataSet(): dataMat = []; labelMat = [] fr = open('testSet.txt') for line in fr.readlines(): lineArr = line.strip().split() ...
分类:编程语言   时间:2015-03-06 15:55:52    阅读次数:245
[教育]资信局和教育部“编码乐”受学生欢迎
资信局和教育部“编码乐”受学生欢迎 许翔宇 配合新加坡迈向智慧国愿景,资讯通信发展管理局计划到了明年4月,让7万2000名学生,包括中小学、高中及大专生,通过学习及比赛,提高对编写程序的知识和兴趣。 资信局推出近一年的“CODE@SG”计划,以小学至高中生为对象,希望鼓励他们学习编码(coding)...
分类:其他好文   时间:2015-03-06 10:35:24    阅读次数:155
Python例子二
例1、构造函数#-*-coding:utf-8-*-import sysclass Student: def __init__(self,name,age): self.__name=name self.__age=age def getName(self):...
分类:编程语言   时间:2015-03-06 10:27:19    阅读次数:147
转【Python】同时向控制台和文件输出日志logging
#-*- coding:utf-8 -*-import logging# 配置日志信息logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(name)-12s %(levelname)-8s...
分类:编程语言   时间:2015-03-06 06:12:20    阅读次数:180
123
我的个人博客(肥龙的博客)发表了新文章了! 欢迎大家过来阅读,以下是文章的连接地址 http://www.comingcode.com/?p=367 # -*- coding: utf8 -*- ‘‘‘ Created on 2015-01-22 @author : dragon ‘‘‘ import urllib...
分类:其他好文   时间:2015-03-05 23:51:01    阅读次数:375
拷贝故事板发生的连线问题:'NSUnknownKeyException', reason: '[<ViewController 0x7ff3da732de0> setValue:forUndefinedKey:]: this class is not ……'
'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key HeadImageView.'出现这个的原因就是:故事板是...
分类:其他好文   时间:2015-03-05 20:55:52    阅读次数:128
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!