按类别查询搜索结果
关于关键词 的检测结果,共 1081
西山壹号院 | 2013-12-19 18:23:10 | 阅读(160) | 评论(0)
点击(此处)折叠或打开#coding:utf-8#!/usr/bin/python# Filename: bubbleSort.pydef bubbleSort(numbers):    for j in xrange(len(numbers)-1,-1,-1):...【阅读全文】
西山壹号院 | 2013-12-19 18:22:39 | 阅读(730) | 评论(0)
 2012-05-05 15:13:54|  分类: 默认分类 |  标签:微博api  python  oauth2.0   |字号大中小 订阅 API下载地址  :http://code.google.com/p/sinaweibopy/wiki/Download 注册微博App后,...【阅读全文】
【Python/Ruby】 3.zope:适配器
yueming | 2013-12-19 11:34:57 | 阅读(1360) | 评论(0)
#! /usr/bin/env python#coding=utf-8## 1 多适配一个简单的适配器只适配一个对象,但一个适配器可适配多个对象。如果一个适配器采用一个以上的对象,它被称为多适配器。from zope.interface import Interfacefrom z...【阅读全文】
lshdcr | 2013-12-18 22:40:26 | 阅读(1090) | 评论(0)
#!/usr/bin/env python#coding:utf8import subprocessimport signal#信号处理函数,打印一段话def sigint_handler(signum,frame):        print "In signal SIGINT handler"#注册信号。signal.signal(signal.SIGINT,sigint_handler)ping = subprocess.Popen(args="pin...【阅读全文】
badb0y | 2013-12-17 11:39:06 | 阅读(1580) | 评论(0)
安装redis点击(此处)折叠或打开wget http://redis.googlecode.com/files/redis-2.6.14.tar.gz tar xzf redis-2.6.14.tar.gz cd redis-2.6.14 make执行make的时候报错,具体报错信息如下:点击(...【阅读全文】
【Python/Ruby】 排列和组合
ssfjhh | 2013-12-15 15:23:01 | 阅读(1840) | 评论(0)
通过递归方法计算一个列表/元组/字符串(可做切片运算的对象)的排列和组合。
写完代码才看到排列竟然只比组合多最后一行代码,其它代码完全一样,这难道就是编程之美?【阅读全文】
dsy851009 | 2013-12-10 14:34:43 | 阅读(6300) | 评论(0)
格式字符串手册数字格式化下面的表格展示了使用Python的后起新秀str.format()格式化数字的多种方法,包含浮点数格式化与整数格式化示例。可使用print("FORMAT".format(NUMBER)); 来运行示例,因此你可以运行: print("{:.2f}".format(3.1415926)); 来得到第一个示例的输出。数字...【阅读全文】
i_chips | 2013-12-03 17:19:17 | 阅读(2190) | 评论(0)
和Python(x,y)不一样,在Ubuntu中需要手工安装科学计算的各个模块,本文介绍如何安装IPython, NumPy, SciPy, matplotlib, PyQt4, Spyder, Cython, SWIG, ETS, OpenCV。【阅读全文】
【Python/Ruby】 python-服文件同步
lshdcr | 2013-11-26 17:31:06 | 阅读(1130) | 评论(0)
import os,sys,datetimeimport paramikofrom optparse import OptionParserdef cpFileSingleIp(sfile,dfile,ip):    username = "root"    password = "123456"    port = 22    t=paramiko.Transport((ip,port))    t.connect(username=username,passwor...【阅读全文】
horsley | 2013-11-18 11:21:53 | 阅读(1330) | 评论(0)
Protocol Interaction:actor 间的交互协议https://github.com/celluloid/celluloid/wiki/Protocol-Interaction注意:这一部分为高阶内容,使用上较复杂。建议不要轻易尝试。Celluloid 使用的异步消息协议可以让你直接为 actors 添加某些行为。想要发送一个原始的异步消息(raw asynchronous message)给 actor,使...【阅读全文】
czq_linux | 2013-11-07 17:05:23 | 阅读(4110) | 评论(0)
1、最常用的time.time()返回的是一个浮点数,单位为秒。点击(此处)折叠或打开In [65]: time.time()Out[65]: 1383814130.2249782、strftime处理的类型是time.struct_time,实际上是一个tuple。3、那如何获得struct_time类型呢?strptime和localtime都会返回这...【阅读全文】
davidxueer | 2013-10-25 09:56:40 | 阅读(520) | 评论(0)
1新建立一个项目的时候bundle install时间过长,可以在bundle install的时候crtl+c终止掉bundle install 修改Gemfile 文件的gem源为http://ruby.taobao.org。或者在建立项目的时候采用以下命令rails new demo --skip-bundle2缺少js运行库 Could not find a JavaScript runtime解决办法...【阅读全文】
conceptcon | 2013-10-22 17:04:47 | 阅读(780) | 评论(0)
和Python(x,y)不一样,在Ubuntu中需要手工安装科学计算的各个模块,本文介绍如何安装IPython, NumPy, SciPy, matplotlib, PyQt4, Spyder, Cython, SWIG, ETS, OpenCV。【阅读全文】
hchuanqi | 2013-10-19 01:43:59 | 阅读(380) | 评论(0)
Perl函数的hash参数与多态性(polymorphism)【阅读全文】
niao5929 | 2013-10-18 10:22:51 | 阅读(790) | 评论(0)
安装redis点击(此处)折叠或打开wget http://redis.googlecode.com/files/redis-2.6.14.tar.gz tar xzf redis-2.6.14.tar.gz cd redis-2.6.14 make执行make的时候报错,具体报错信息如下:点击(...【阅读全文】
linuxnerd | 2013-10-17 18:02:30 | 阅读(4930) | 评论(0)
安装redis点击(此处)折叠或打开wget http://redis.googlecode.com/files/redis-2.6.14.tar.gz tar xzf redis-2.6.14.tar.gz cd redis-2.6.14 make执行make的时候报错,具体报错信息如下:点击(...【阅读全文】
lvxinzhi | 2013-09-20 18:29:20 | 阅读(18270) | 评论(0)
ftplib是 Python的内置的一个标准模块,它提供了极强大的对FTP服务器的操作,通过它我们可以连接并操作FTP服务端,开始练习:一、导入模块并进行连接>>> from ftplib import FTP >>> ftp = FTP(‘ftp.yabogo.com’) >>> ftp.login(‘yourloginname’,'password’) FTP登录成功连接到FTP可还有如下形式:...【阅读全文】
lshdcr | 2013-09-16 18:02:21 | 阅读(1310) | 评论(0)
vimviews.pyfrom django.shortcuts importrender_to_responsefrom django.http import HttpResponsefrom django import forms from sshCMD.models import SerInfo import paramikoimport os,sysimport re class SerForm(forms.Form):  ...【阅读全文】
【Python/Ruby】 python 线程ssh
birdsdeng | 2013-09-13 15:11:56 | 阅读(2290) | 评论(0)
#!/usr/bin/env python#coding=utf-8import paramikoimport time,datetime,threadingdef ssh(ip,user,passwd,command):    ssh = paramiko.SSHClient()    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())    try:        ssh.connect(ip,port=...【阅读全文】
dsy851009 | 2013-09-09 16:17:24 | 阅读(5830) | 评论(0)
import urllibimport jsonimport sysreload(sys)sys.setdefaultencoding( "utf-8" )RCMC_URL = "http://192.168.100.211:xxxx/xxx-api/xxxx"RCMS_URL_response = urllib.urlopen(RCMC_URL).read()json_obj = json.loads(RCMS_URL_response)list_rcms = []for channels in json_obj:    CID = chann...【阅读全文】