摘要: https://github.com/django-ckeditor/django-ckeditor https://django-ckeditor.readthedocs.io/en/latest/     RichTextField, RichTextUploadingField, CKEditorWidget ... 阅读原文
2018-04-09 14:09:01 阅读(732) 评论(0)
摘要: xadmin后台管理 3.6.xadmin添加富文本插件 (1)xadmin/plugins文件夹下新建文件ueditor.py 代码如下: # xadmin/plugins/ueditor.py import xadmin from xadmin.views import BaseAdminPl... 阅读原文
2018-04-09 13:31:03 阅读(781) 评论(0)
摘要: filter 函数 filter() 函数用于过滤序列,过滤掉不符合条件的元素,返回由符合条件元素组成的新列表。 该接收两个参数,第一个为函数,第二个为序列,序列的每个元素作为参数传递给函数进行判,然后返回 True 或 False,最后将返回 True 的元素放到新列表中。 str = ['a', 'b', 'c'... 阅读原文
2018-04-09 12:01:02 阅读(731) 评论(0)
摘要:一、集合的定义和特点 阅读原文
2018-04-09 11:58:05 阅读(765) 评论(0)
摘要: Python文件处理 .note-content { font-family: "Helvetica Neue", Arial, "Hiragino Sans GB", STHeiti, "Microsoft YaHei", "WenQuanYi Micro Hei", SimSun, Song, sans-seri... 阅读原文
2018-04-09 10:53:06 阅读(734) 评论(0)
摘要:     在对比医院业务数据中的各类药品价格的时候,面对着成千上百种的药品。因而想到使用爬虫来自动获取网上的药品价格,保存下来导入数据库中就可以方便地比较院方的药品采购价格了。     通过百度搜索“药品价格查询”,在众多的网站中,这里选择了药价查询网(http://www.china-yao.com/),主要是因为这... 阅读原文
2018-04-09 07:35:02 阅读(756) 评论(0)
摘要: 采用ID3算法 (信息熵:H(X)=−∑i=0np(xi)log2p(xi))   下载一个决策树可视化软件:Graphviz (注意环境变量Path加:C:\Program Files (x86)\Graphviz2.38\bin)   代码: 导入需要用到的库: from sklearn.feature_ext... 阅读原文
2018-04-09 06:06:02 阅读(776) 评论(0)
摘要: 在大多数人使用Windows中文版本的情况下,使用Python从TXT文件中读取数据时,初学者经常会遇到由于文档编码规则差异导致文档读取报错,例如,如下报错: UnicodeDecodeError: 'gbk' codec can't decode byte 0xa7 in position 14: illegal ... 阅读原文
2018-04-09 00:52:02 阅读(792) 评论(0)
摘要: python第一次接触时感觉简洁明了,没有c语言烦多,第一课学了打印有关交互的知识。 '''username = input("userane:")password = input("password:")print(username,password)'''name = input("name:")age = in... 阅读原文
2018-04-08 22:58:01 阅读(770) 评论(0)
摘要: __new__方法 __new__和__init__方法的作用 11 class A(object): 12 def __init__(self): 13 print("这是__init__方法") 14 ... 阅读原文
2018-04-08 21:46:02 阅读(769) 评论(0)