码迷,mamicode.com
首页 >  
搜索关键字:python paramiko threading    ( 137519个结果)
Python中的下划线
总结如下: 1) 前带一个"_"的变量:  私有变量. 前面带有一个"_"的变量, 但是并没有真正的封装隐藏, 外部还是可以访问 2) 后面带有一个"_"的变量, 为了避免和Python中已有的关键字冲突 3) 前后各有两个"_"的变量, 代表Python中的Magic Word _single_leading_underscore: 私有变量.  sin...
分类:编程语言   时间:2014-09-01 19:38:23    阅读次数:195
macBook下更新python
#!/usr/bin/bash#python版号需要修改两个地方#1. new_version#sudo -i #得到超级权限new_version="3.4"PYPATH=/System/Library/Frameworks/Python.framework/Versions/"$new_vers...
分类:编程语言   时间:2014-09-01 19:18:33    阅读次数:234
使用python向Redis批量导入数据
1.使用pipeline进行批量导入数据。包含先使用rpush插入数据,然后使用expire改动过期时间class Redis_Handler(Handler): def connect(self): #print self.host,self.port,self.table self.conn.....
分类:编程语言   时间:2014-09-01 19:11:53    阅读次数:322
【python】入门学习(二)
键盘读取字符串:name = input('What is your first name?').strip()print("Hello " + name.capitalize() + "!")input():从键盘获取字符串 若要获取数字必须使用类型转换strip():删除字符串开始和结尾多余的空...
分类:编程语言   时间:2014-09-01 19:09:43    阅读次数:195
Python实现快速排序算法
快速排序是由东尼·霍尔所发展的一种排序算法。在平均状况下,排序 n 个项目要Ο(n log n)次比较。在最坏状况下则需要Ο(n2)次比较,但这种状况并不常见。事实上,快速排序通常明显比其他Ο(n log n) 算法更快,因为它的内部循环(inner loop)可以在大部分的架构上很有效率地被实现出来。 快速排序使用分治法(Divide and conquer)策略来把一个串行(list)分...
分类:编程语言   时间:2014-09-01 17:51:53    阅读次数:226
【python】入门学习(一)
主要记录一下与C语言不同的地方和特别需要注意的地方:// 整除** 乘方整数没有长度限制,浮点数有长度限制复数:>>> 1j*1j(-1+0j)导入模块:import①import math #导入math中所有函数 使用时要用 math.sqrt()的形式②from math import *.....
分类:编程语言   时间:2014-09-01 17:36:13    阅读次数:199
用C#写一个Excel转Txt的小工具
using System; using System.Collections.Generic; using System.Data; using System.Data.OleDb; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using Microsoft.Off...
分类:其他好文   时间:2014-09-01 16:03:33    阅读次数:225
python 读取excel 生成json 读取json
#_*_coding:utf-8importxlrd,sysimportpickleimportjsondata=xlrd.open_workbook("d:/test/6.xlsx")##读取工作表,方法可以按顺序索引找,也可以使用sheet_by_name(u"Sheet1")table=data.sheet_by_index(0)###读取内容摘要表并存入nrarrnrarr={}table1=data.sheet_by_index(1)fo..
分类:编程语言   时间:2014-09-01 15:52:14    阅读次数:279
python 读取excel 生成json 读取json
#_*_coding:utf-8importxlrd,sysimportpickleimportjsondata=xlrd.open_workbook("d:/test/6.xlsx")##读取工作表,方法可以按顺序索引找,也可以使用sheet_by_name(u"Sheet1")table=data.sheet_by_index(0)###读取内容摘要表并存入nrarrnrarr={}table1=data.sheet_by_index(1)fo..
分类:编程语言   时间:2014-09-01 15:51:33    阅读次数:184
python 获取Linux IP
importsocketimportfcntlimportstructdefget_ip_address(ifname):s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)returnsocket.inet_ntoa(fcntl.ioctl(s.fileno(),0x8915,#SIOCGIFADDRstruct.pack(‘256s‘,ifname[:15]))[20:24])printget_ip_address(‘eth0‘)
分类:编程语言   时间:2014-09-01 15:51:03    阅读次数:279
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!