码迷,mamicode.com
首页 >  
搜索关键字:coding    ( 12955个结果
[转载]使用python上传图片到 yeelink
#/bin/env python# -*-coding:utf=8 -*-import os,time,subprocess,shleximport urllib2def upload_yeelink(image_name, log_file): #自己设备的 upload url ur...
分类:编程语言   时间:2015-04-05 23:14:45    阅读次数:249
Python之字符界面QQ
server side:# coding: gb2312#socket server端#获取socket构造及常量from socket import *#''代表服务器为localhostmyHost = ''#在一个非保留端口号上进行监听myPort = 50007#设置一个TCP socket...
分类:编程语言   时间:2015-04-05 20:20:42    阅读次数:179
Python BeautifulSoup 抓取博客园首页精华
#coding:utf-8'''Created on 2015?-4-5@author: Administrator'''from bs4 import BeautifulSoupimport urllib2import sysreload(sys)sys.setdefaultencoding('u...
分类:编程语言   时间:2015-04-05 17:13:09    阅读次数:200
python redis 简单使用类
#!/usr/bin/python #coding=utf-8 import?redis class?urlList(): ############################################# #?create?by?myjack #?you?can?call?the?function?by?urlList?Class. #?ver...
分类:编程语言   时间:2015-04-05 06:49:23    阅读次数:229
SaltStack源码分析之使用Redis模块
Redis模块路径/usr/lib/python2.6/site-packages/salt/modules/redismod.pyRedis模块会首先检查是否安装有Redis的Python驱动#-*-coding:utf-8-*- ‘‘‘ ModuletoprovideredisfunctionalitytoSalt ..versionadded::2014.7.0 :configuration:Thismodulerequirestheredispythonmod..
分类:其他好文   时间:2015-04-05 06:49:09    阅读次数:285
python编写过滤指定字符的文本
#!/usr/bin/python #coding:utf-8 importos importstring importsys,getopt defGrep_start_char(Mpath,char): ifos.path.exists(Mpath): GrepFile=file(Mpath) else: return"Nosuchfileordirectory" try: forlineinhosts: ifline.startswith(char)orline.strip()==‘‘: conti..
分类:编程语言   时间:2015-04-04 16:55:52    阅读次数:144
kvo kvc 知识点在IOS Developer Library中的位置
进入到Topics的Data Managment版块,搜索 key-value即可出来KVCData Management -》key-value Coding Programming Guide (Foundation Framework)KVO Data Management -》key-val...
分类:移动开发   时间:2015-04-04 13:38:52    阅读次数:129
第一次碰到try-except(core python programming 2nd Edition 3.6)
1 # coding: utf-8 # 使用Windows系统,首行'#!/usr/bin/env Pyton'无用,全部改为'# coding: utf-8' 2 3 'readtextfile.py -- read and display text file' 4 5 # get file...
分类:编程语言   时间:2015-04-04 11:52:42    阅读次数:193
python 调用图灵机器人api实现简单的人机交互
接入流程例如以下,须要先注冊开发人员帐号,之后会得到一个32位的key,保存下来,用于以后发送数据。http://www.tuling123.com/请求方式演示样例:# -*- coding: utf-8 -*-import urllibimport jsondef getHtml(url): ....
分类:编程语言   时间:2015-04-04 10:40:14    阅读次数:139
二分kmeans python实现
今天要对一个1000个个记录,每个记录有n个属性的文本进行聚类,采用的是二分k均值方法。算法思想:我参考了Pang-Ning Tan数据挖掘导论里P317相对于kmeans的优点是不受其初始质心的影响。#coding utf-8#python 3.4#2015-4-3#Fitz Yin #yinr....
分类:编程语言   时间:2015-04-03 20:54:09    阅读次数:203
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!