码迷,mamicode.com
首页 >  
搜索关键字:python __getitem__ ___setitem__ __delitem__ __len__    ( 140625个结果
【LeetCode】Remove Element
题目: Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn't matter what you leave beyond the new len...
分类:其他好文   时间:2014-05-05 12:58:57    阅读次数:294
笨方法学python(5)加分题
这篇对应的是习题16,读写文件 # -*- coding: utf-8 -*- #对文件更多操作复制A文件的内容到B文件 #from sys import argv from os.path import exists prompt = "> " from_file = raw_input("please input the filename where you want to copy...
分类:编程语言   时间:2014-05-05 12:54:02    阅读次数:402
Python学习(一):入门篇:python中的一些数据结构
Python里的一些基本知识点...
分类:编程语言   时间:2014-05-04 00:11:51    阅读次数:367
Python应用领域
Python应用领域 Web开发、数据库编程、桌面GUI应用开发、科学与数值计算、教育教学、网络应用开发、软件开发(控制、管理、测试等)、游戏与3D影像;游戏开发、网站建设、机器人和航天飞机控制等领域,Python几乎可以用在任何场合。
分类:编程语言   时间:2014-05-03 23:55:05    阅读次数:507
PYTHON包安装时发生Unable to find vcvarsall.bat的解决办法
今天遇到了这个方面的问题,目前找到两种办法。一种是换编译器如mingw,另一种是装vc。第一种方法没成功,现在正在等第二种。 第一种: 首先安装MinGW; 把MinGW的路径添加到环境变量path中,比如MinGW安装在D:\MinGW\中,就把D:\MinGW\bin添加到path中; 打开命令...
分类:编程语言   时间:2014-05-03 23:20:29    阅读次数:363
用python实现欧几里德算法求最大公约数
方法1:defgcd(x, y):whilen: x, y=y, x%yreturnx方法2:def yue(x,y): if y: return gcd(y,x%y) else: return x
分类:编程语言   时间:2014-05-03 22:46:11    阅读次数:344
自动检测&后台复制光盘内容
原理:利用python的win32模块,注册服务,让代码在后台运行,检测光盘并拷贝文件 启动的方法就是直接在cmd下,main.py install ,然后去windows 的服务下就可以看到The smallestpossible Python Service 这个服务,你可以启动,停止,还可以设置成开机自动启动。启动服务后,会自动检测光盘并在后台拷贝文件 main.py import...
分类:其他好文   时间:2014-05-03 15:58:45    阅读次数:235
python : BeautifulSoup 网页数据分析
BeautifulSoup 善于网页数据分析  请参考:  http://www.crummy.com/software/BeautifulSoup 例如: 抓取CSDN首页极客头条内容  soup.py import urllib2, re from BeautifulSoup import BeautifulSoup page = urllib2.urlopen("http://gee...
分类:编程语言   时间:2014-05-03 15:31:42    阅读次数:401
Python-Django中的那些命令
#在下载好的django路径下执行django的安装 #https://pypi.python.org/pypi/Django/1.6.4 python3setup.pyinstall # #新建django项目 django-admin.pystartprojectmysite # #运行django项目 python3manage.pyrunserver[port] # #创建一个app python3manage.pystartappappname # ..
分类:编程语言   时间:2014-05-03 14:48:38    阅读次数:413
[Redis]python连接redis
只是看看能不能成功使用python操作redis,redis具体的数据结构和使用会在以后学习。安装连接redis的包pipinstallredis本地已经在6379端口启动了redis服务。In[1]:importredis In[2]:r=redis.StrictRedis(host=‘localhost‘,port=6379,db=0) In[3]:r.set(‘foo‘,‘bar‘) Out[3]:Tru..
分类:编程语言   时间:2014-05-03 14:38:32    阅读次数:405
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!