搜索到与相关的文章
Python

python购物车

python文件部分:user={'username':None}shopping_trolley={}shopping_num=[0]money=[0]my_money=[0]#获取商品列表defget_goods_list():withopen('shopping.txt',encoding='utf-8')asfr:shopping_dic=eval(fr.read())returnshopping_dicshopping_dic=get_goods

系统 2019-09-27 17:45:36 2079

Python

python类中super()和__init__()的区别

单继承时super()和__init__()实现的功能是类似的classBase(object):def__init__(self):print'Basecreate'classchildA(Base):def__init__(self):print'creatA',Base.__init__(self)classchildB(Base):def__init__(self):print'creatB',super(childB,self).__init__

系统 2019-09-27 17:37:52 2079

Python

Python 使用PIL numpy 实现拼接图片的示例

python纵向合并任意多个图片,files是要拼接的文件list#-*-coding:utf-8-*-defmergeReport(files):fromPILimportImageimportnumpyasnpbaseimg=Image.open(files[0])sz=baseimg.sizebasemat=np.atleast_2d(baseimg)forfileinfiles[1:]:im=Image.open(file)#resizetosam

系统 2019-09-27 17:37:43 2079

编程技术

j2me j2ee 数据库连接问题

本人刚接触j2me,公司现在做一个移动办公系统要求用j2ee和j2me结合,手机客户端用到j2me,可是要求手机客户端能够连到J2ee的Oracle数据库上,登陆的时候需要有用户名权限之类的,请各位帮下忙,j2me怎么通过http连到Oracle,并且可以实现web层和wap层能实现功能?紧急。。。。。j2mej2ee数据库连接问题

系统 2019-08-29 23:04:17 2079

编程技术

how to count files in directory

http://techgurulive.com/2009/08/09/how-to-count-files-in-the-current-directory-in-linux/referenceasabovels-l|wc-lCAUTION,thelinkofcurrentfoleralsoasafile,soascommonsense,theresultyoushouldminusone,that'syouwanthowtocountfilesindir

系统 2019-08-29 22:55:37 2079

编程技术

for,while,do-while,continue(无标号) 之间微

原来对continue的理解停留在表面,粗略的以为就是在执行这条语句之后返回到迭代的头部(自认为是进口处),没想到还有巨大的细节问题。先举个例子:publicclassTest...{/***//***@paramargs*/publicstaticvoidmain(String[]args)...{//TODOAuto-generatedmethodstubintk=0;do...{k++;if(k<10)...{System.out.println("

系统 2019-08-29 22:17:19 2079

各行各业

元数据

元数据是用来描述数据的数据(Datathatdescribesotherdata)。单单这样说,不太好理解,我来举个例子。下面是契诃夫的小说《套中人》中的一段,描写一个叫做瓦莲卡的女子:(她)年纪已经不轻,三十岁上下,个子高挑,身材匀称,黑黑的眉毛,红红的脸蛋--一句话,不是姑娘,而是果冻,她那样活跃,吵吵嚷嚷,不停地哼着小俄罗斯的抒情歌曲,高声大笑,动不动就发出一连串响亮的笑声:哈,哈,哈!这段话里提供了这样几个信息:年龄(三十岁上下)、身高(个子高挑)

系统 2019-08-12 01:32:27 2079

Python

Python使用指定端口进行http请求的例子

使用requests库classSourcePortAdapter(HTTPAdapter):""""Transportadapter"thatallowsustosetthesourceport."""def__init__(self,port,*args,**kwargs):self.poolmanager=Noneself._source_port=portsuper().__init__(*args,**kwargs)definit_poolman

系统 2019-09-27 17:56:58 2078

Python

leetcode 汉明距离 - python3

两个整数之间的汉明距离指的是这两个数字对应二进制位不同的位置的数目。给出两个整数x和y,计算它们之间的汉明距离。注意:0≤x,y<231.classSolution:defhammingDistance(self,x:int,y:int)->int:x_str=str(bin(x)).replace('0b','')y_str=str(bin(y)).replace('0b','')max_len=max(len(x_str),len(y_str))x_s

系统 2019-09-27 17:56:07 2078

Python

python机器学习库scikit-learn:SVR的基本应用

scikit-learn是python的第三方机器学习库,里面集成了大量机器学习的常用方法。例如:贝叶斯,svm,knn等。scikit-learn的官网:http://scikit-learn.org/stable/index.html点击打开链接SVR是支持向量回归(supportvectorregression)的英文缩写,是支持向量机(SVM)的重要的应用分支。scikit-learn中提供了基于libsvm的SVR解决方案。PS:libsvm是台

系统 2019-09-27 17:55:51 2078