- 军军小站|张军博客
搜索到与相关的文章
Python

深入理解python对象及属性

类属性和实例属性首先来看看类属性和类实例的属性在python中如何存储,通过__dir__方法来查看对象的属性>>>classTest(object):pass>>>test=Test()#查看类属性>>>dir(Test)['__class__','__delattr__','__dict__','__doc__','__format__','__getattribute__','__hash__','__init__','__module__','__

系统 2019-09-27 17:54:39 1801

Python

裸辞面11家python公司,拿到4个offer!网友:买了简历置顶会员吗?

原文链接:https://edu.csdn.net/topic/python115?utm_source=yjs我一直认为,敢裸辞的只有2种人:1、能力足够强,即使裸辞也不会被财务问题所困,更不愁找工作。2、年轻气盛,遇到傻X领导和傻X同事,绝对0容忍!但是最近我在刷某乎的时候,发现了第三种人。为了方便面试而裸辞。裸辞面试11家python公司一口气拿到4个offer这无疑是一种高效的方式,但是如果底气不够,还是很容易陷入焦虑的。还好的是,这位up主后续更

系统 2019-09-27 17:54:29 1801

Python

python下载图片实现方法(超简单)

我们有时候会需要在网上查找并下载图片,当数量比较少的时候,点击右键保存,很轻松就可以实现图片的下载,但是有些图片进行了特殊设置,点击右键没有显示保存选项,或者需要下载很多图片,这样的情况,写一段Python爬虫代码就可以轻松解决!一、页面抓取#coding=utf-8importurllibdefgetHtml(url):page=urllib.urlopen(url)html=page.read()returnhtmlhtml=getHtml("http

系统 2019-09-27 17:54:24 1801

Python

python+selenium+autoit实现文件上传功能

问题在做web端ui层自动化的时候会碰到文件上传的操作,经常有朋友问到,这里总结一下解决方案第一种:type=file的上传文件,类似如下的使用类似这样的代码就可以完成:driver.find_element('name','file').send_keys('./小强测试品牌.png')第二种:就是第一种除外的,实现起来较为麻烦,这里用到了autoit,大致步骤如下:1、下载并安装autoit,之后在开始菜单可以看到如下AutoItWindowsInfo

系统 2019-09-27 17:53:55 1801

Python

Python 逐行分割大txt文件的方法

代码如下所示:#-*-coding:-*-importioLIMIT=150000file_count=0url_list=[]withio.open('D:\DB_NEW_bak\DB_NEW_20171009_bak.sql','r',encoding='utf-16')asf:forlineinf:url_list.append(line)iflen(url_list)

系统 2019-09-27 17:53:40 1801

Python

python字符串/列表/字典互相转换

python字符串/列表/字典互相转换目录字符串与列表字符串与字典列表与字典字符串与列表字符串转列表1.整体转换str1='helloworld'print(str1.split('这里传任何字符串中没有的分割单位都可以,但是不能为空'))#输出:['helloworld']2.分割str2="helloworld"list2=list(str2)print(list2)#输出:['h','e','l','l','o','','w','o','r','l'

系统 2019-09-27 17:53:33 1801

Python

leetcode 53. Maximum Subarray 解法 python

一.问题描述Givenanintegerarraynums,findthecontiguoussubarray(containingatleastonenumber)whichhasthelargestsumandreturnitssum.Example:Input:[-2,1,-3,4,-1,2,1,-5,4],Output:6Explanation:[4,-1,2,1]hasthelargestsum=6.Followup:Ifyouhavefigur

系统 2019-09-27 17:53:31 1801

Python

python2.7.13和matplotlib2.2.0出错

问题如下ExceptioninTkintercallbackTraceback(mostrecentcalllast):File"C:\Python27\lib\lib-tk\Tkinter.py",line1542,in__call__returnself.func(*args)File"C:\Users\11782\AppData\Roaming\Python\Python27\site-packages\matplotlib\backends\bac

系统 2019-09-27 17:53:25 1801

Python

Python实现某论坛自动签到功能

1.[文件]DakeleSign.py~4KB#!/usr/bin/envpython#-*-coding:utf-8-*-__author__='poppy''''dakelebbssigin'''importsysimporturllib2importurllibimportrequestsimportcookielibimportjsonfrompyqueryimportPyQueryaspqimportlogginglogging.basicCon

系统 2019-09-27 17:53:08 1801

Python

python入门之语句(if语句、while语句、for语句)

python入门之语句,包括if语句、while语句、for语句,供python初学者参考。//if语句例子name='peirong';ifname=='peirong':print'thisispeirong';elifname=='maojun':print'thisismaojun';else:print'others';//while语句i=0;a=range(10);whilei

系统 2019-09-27 17:52:55 1801