#Python数据分析与挖掘实战

【ipython技巧】使用shell命令

在ipython终端时,可能临时需要使用shell命令进行简单处理;可以在shell命令前面使用!(感叹号)比如在win7,ipython下想要使用sublime新建一个py,可以这样!subl.exe<name>.py ...

【python】标准库的大致认识

正如那句Python社区中很有名的话所说的:“batteryincluded”,Python的一大好处在于它有一套很有用的标准库(standardlibrary)。标准库是随着Python一起安装在你的电脑中的,是Python的一部分(当然也有特殊情况。有些场合会因为系统安全性的要求,不使用全部的标准库,比如说Goog...
代码星球 代码星球·2021-02-21

【py登陆】python模拟登录

 前面简单提到了 Python 模拟登录的程序,但是没写清楚,这里再补上一个带注释的Python模拟登录的示例程序。简单说一下流程:先用cookielib获取cookie,再用获取到的cookie,进入需要登录的网站。01# -*-coding:utf-8-*-02#!/usr/...

python安装与使用入门

1、下载python安装2、设置环境变量:系统环境变量:path:d:/python3、进入命令行:输入python,出现<<<代表进入python模式。4、某个目录下文档作为web发布cdd:/docpython-mhttp.serverprotNum(端口号) 在浏览器中输入localh...
代码星球 代码星球·2021-02-21

python 发邮件

https://github.com/lavr/python-emails  linux发邮件可以使用mutt ...
代码星球 代码星球·2021-02-21

python get请求

#!/usr/bin/python#-*-coding:UTF-8-*-#coding=utf-8importrequestsimporttimeimporthashlibimportsysdefgetUser(userId):aid=0t=time.time()aTime=int(round(t*1000))hl=h...
代码星球 代码星球·2021-02-21

python 文件夹操作

常用的一些1importos23ford,cd,flinos.wald('.'):4  forfinfl:5    sufix=os.path.splitext(f)[1][1:]6    ifsufix=='py':7      filename=os.path.join(d,f)8      print'filen...
代码星球 代码星球·2021-02-21

python 输出重定向

使print既打印到终端,又写入文件1classTee(object):2def__init__(self,*files):3self.files=files4defwrite(self,obj):5forfinself.files:6f.write(obj)78if__name__=='__main__':9logn...
代码星球 代码星球·2021-02-21

python datetime时间差

1importdatetime2importtime34d1=datetime.datetime(2005,2,16)5d2=datetime.datetime(2004,12,31)6tdelta=d1-d27printtdelta.seconds,tdelta.days89starttime=datetime.da...
代码星球 代码星球·2021-02-21

python 常用

1.dir()       不带参数时,返回当前范围内的变量、方法和定义的类型列表;带参数时,返回参数的属性、方法列表。如果参数包含方法__dir__(),该方法将被调用。如果参数不包含__dir__(),该方法将最大限度地收集参数信息。2.help...
代码星球 代码星球·2021-02-21

python unitest基本

基本1importunittest23classOneTest(unittest.TestCase):45defsetUp(self):6self.verificationErrors=[]7self.accept_next_alert=True8pass910deftest_testcase(self):11pass...
代码星球 代码星球·2021-02-21

python selenium基本

基本fromseleniumimportwebdriverimportredriver=webdriver.Firefox()driver.get('https://www.google.com')main_window=driver.current_window_handledriver.find_element_b...
代码星球 代码星球·2021-02-21

python paramiko基本

基本importparamikoblade='192.168.0.10'port=22username='admin'password='100'localpath='/home/local/test.txt'remotepath='/home/remote/test/test.txt'conn_name=parami...
代码星球 代码星球·2021-02-21

RESTful架构3--开发实战

转自:REST服务开发实战   如果要说什么是REST的话,那最好先从Web(万维网)说起。  什么是Web呢?读者可以查看维基百科的词条(http://zh.wikipedia.org/zh-cn/Web),具体的我就不多说了。总之,Web是我们在互联网上最常用的服务,甚至在某些人的心中,互联网就是Web。...
代码星球 代码星球·2021-02-21

Spring3实战第二章第一小节 Spring bean的初始化和销毁三种方式及优先级

Springbean的初始化和销毁有三种方式通过实现InitializingBean/DisposableBean接口来定制初始化之后/销毁之前的操作方法;    优先级第二通过<bean>元素的init-method/destroy-method属性指定初始化之后/销毁之前调用的操作方法; &n...
首页上一页...2425262728...下一页尾页