首页 软件开发 代码片段 python ( Page 2 )

python 1073

#Python
Python获取Linux系统内存情况

[Python]代码     import subprocess import re keydic = {"MemTotal":"总内存(单…

2016-01-28 388

#Python
python 爬虫

    学习python就一直想做爬虫的东西,还要继续学     理论上的东西一要加强 #!/usr…

2016-01-23 793

#Python
python包含中文字符串长度

一个中文utf8编码后是占3个字符,所以求长度的函数可以这样写 def str_len(str): try: row_l=len(str) utf8_l=len(str.encod…

2016-01-23 974

#Python
django 文件上传

template html(模板文件): <form enctype=”multipart/form-data” method=”POST…

2016-01-23 595

#Python
django 非常实用的无限级分类功能

利用model中的save方法,变相的实现递归循环,所有子分类都能在其中更新,感觉挺巧妙,之前的实现方式确实太烂了。    order的方法竟然支持1:23:2…

2016-01-23 346

#Python
Djano发送邮件

转自:https://django-chinese-docs-14.readthedocs.org/en/latest/topics/email.html#django.core.…

2016-01-23 779

#Python
Python获取脚本所在目录的正确方法

1 C:test   [dir] getpath     [file] path.py  …

2016-01-23 220

#Python
python根据股票代码获取当前数据

上班时间通过浏览器打开股票网站怕会被别人看到,没关系,试试在命令行下执行代码看数据就行了。输入sh,就可以查看到上证指数输入sz,就可以查看深圳指数输入cyb,就可以查看创业板指数…

2016-01-22 841

#Python
Python爬虫-抓取手机APP数据

抓取超级课程表话题数据。博文:http://my.oschina.net/jhao104/blog/606922 #!/usr/local/bin/python2.7 # -*- …

2016-01-22 464

#Python
Python 中使用 MongoDB 存储爬虫数据

现在在做一个简单的搜索引擎,使用今日头条的新闻数据作为数据源。这些数据都是非结构性的,比较适合用 MongoDB 来进行存储。 以下为简单使用的示例。 #!/usr/bin/pyt…

2016-01-13 401

#Python
Python代码运行助手

#!/usr/bin/env python3 # -*- coding: utf-8 -*- r''' learning.py A Python 3 tutorial from h…

2016-01-13 263

#Python
模拟登录封包python实现

#!/usr/bin/env python # encoding:utf-8 from socket import * from ctypes import create_stri…

2016-01-03 251