Quantcast
Channel: CodeSection,代码区,Python开发技术文章_教程 - CodeSec
Browsing all 9596 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Why I started to use golang more than python or ruby

Interpreted, dynamically typed languages such as python, Ruby or javascript are: easy to use, allow fast development and have a great number of libraries. Unfortunately, they are not very good when it...

View Article


python之最强王者(8)――字典(dictionary)

1.python 字典 (Dictionary) 字典是另一种可变容器模型,且可存储任意类型对象。 字典的每个键值 (key=>value) 对用冒号 (:) 分割,每个对之间用逗号 (,) 分割,整个字典包括在花括号 ({}) 中 , 格式如下所示: d = {key1 : value1, key2 : value2 } 键必须是唯一的,但值则不必 。...

View Article


Image may be NSFW.
Clik here to view.

Book Contest: Win a Copy of Python 201

I have decided to sponsor a contest for my second book, python 201: Intermediate Python . I will be giving away 3 copies of my eBook bundle (PDF, EPUB and MOBI) and 2 copies of the paperback, which I...

View Article

Django Shortcuts

This module is a collection of helper classes generally used in view functions/classes. All the shortcuts are available in the module django.shortcuts . render Params: def render(request,...

View Article

Pysolr ―― Solr 轻量的 Python 应用

Pysolr,是基于python的Apache Solr轻量级封装。它提供了服务器查询并返回基于查询的结果接口。 特性: 基本功能,选择、更新和删除 索引优化 超时支持 使用环境: Python 2.7 - 3.5 Requests 2.0+ Optional- simplejson Optional- kazoo for SolrCloud mode 示例代码: # If on Python...

View Article


Dougal Matthews: Retrace - Configurable, elegant retrying

After I mentioned Retrace hererecently a few people have asked me about it, so I thought I'd write up a quick post. Retrace is, essentially, a retry decorator. There are many projects like this but...

View Article

Dask and Celery

This post compares two python distributed task processing systems, Dask.distributed and Celery. Disclaimer: technical comparisons are hard to do well. I am biased towards Dask and ignorant of correct...

View Article

Elasticsearch & Python: Tips for faster re-indexing

Some valuable lessons learned while going through an elasticsearch re-indexing exercise. (For the uninitiated, re-indexing data basically means getting large volumes of documentsfrom elasticsearch,...

View Article


Image may be NSFW.
Clik here to view.

Python如此神奇,让繁琐工作自动化

“你在2个小时里完成的事,我们3个人要做两天。”21世纪早期,我的大学室友在一个电子产品零售商店工作。商店偶尔会收到一份电子表格,其中包含竞争对手的数千种产品的价格。由3个员工组成的团队,会将这个电子表格打印在一叠厚厚的纸上,然后3个人分一下。针对每个产品价格,他们会查看自己商店的价格,并记录竞争对手价格较低的所有产品。这通常会花几天的时间。...

View Article


Image may be NSFW.
Clik here to view.

【技术分享】关于Python的那些不得不提的事儿

前言 python因其在开发更大、更复杂应用程序方面独特的便捷性,使得它在计算机环境中变得越来越不可或缺。虽然其明显的语言清晰度和使用友好度使得软件工程师和系统管理员放下了戒备,但是他们的编码错误还是有可能会带来严重的安全隐患。 这篇文章的主要受众是还不太熟悉Python的人,其中会提及少量与安全有关的行为以及有经验开发人员遵循的规则。 输入函数...

View Article

Beta reduction: The difference typing makes

Beta reduction is essentially function application. If you have a function described by what it does to x and apply it to an argument t , you rewrite the x s as t s.The formal definition of...

View Article

[译] 使用 Python 和 Asyncio 编写在线多人游戏

[译] 使用 python 和 Asyncio 编写在线多人游戏 1小时前来源:开发者头条 你在 Python 中用过异步编程吗?本文中我会告诉你怎样做,而且用一个能工作的例子来展示它:这是一个流行的贪吃蛇游戏,而且是为多人游戏而设计的。 1、简介 在技术和文化领域,大规模多人在线游戏(MMO)毋庸置疑是我们当今世界的潮流之一。很长时间以来,为一个 MMO...

View Article

Image may be NSFW.
Clik here to view.

Jupyter notebooks features

Jupyter (Ipython) notebooks features It is very flexible tool to create readable analyses, because one can keep code, images, comments, formula and plots together: Jupyter is quite extensible, supports...

View Article


Image may be NSFW.
Clik here to view.

The PlayRust Classifier

For those who weren’t able to attend RustConf 2016 , I thought I’d summarize my and /u/staticassert’s talk in written form. I’ve only focused on a subset of talking points below; for the full talk,...

View Article

Image may be NSFW.
Clik here to view.

Build an Alexa Skill with Python and AWS Lambda

Introduced in 2015, Amazon Echo is a wireless speaker and microphone device that allows users to interact with online services by voice. Alexa is the name of the speech service that powers Echo (and...

View Article


Image may be NSFW.
Clik here to view.

【在线直播】Python网络爬虫快速入门实战

演讲嘉宾 韦玮 重庆韬翔网络科技有限公司CEO/董事长/总经理 嘉宾介绍:重庆韬翔网络科技有限公司董事长兼CEO,国内知名出版社IT作家,CSDN学院特邀IT专家,《知道日报》特约作者,国家工信部高级网络营销师,蜻蜓FM独家签约主播,国家专利发明人。 多年IT技术实战开发经验,曾做过程序员,也做过技术总监,现在运营一家专注于中大型软件开发与IT技术服务的公司。...

View Article

以python理解Linux的IO多路复用,select、poll、epoll

题外话 之前在看Unix环境高级编程的时候,看完高级IO那一章,感觉自己萌萌哒,0.0 ,有点囫囵吞枣的感觉,之后翻了几篇博客,从纯系统的角度理解,稍微有了点概念,以这两篇为例,可以以后参考: http://www.cnblogs.com/Anker/p/3265058.html https://segmentfault.com/a/1190000003063859%20...

View Article


Image may be NSFW.
Clik here to view.

Jamal Moir: An Introduction to Scientific Python (and a Bit of the Maths...

An Introduction to Scientific python (and a Bit of the Maths Behind It) - NumPy data science numpy python scientific 18:05 Oh the amazing things you can do with Numpy. NumPy is a blazing fast maths...

View Article

Flask Blueprint AttributeError function 错误检查

Flask 算是新手上路,之前写过小玩意儿,但是基本没有用到 Bluprint 这个 API 基本不是很了解。 报错内容: Traceback (most recent call last): File "/Users/home/PycharmProjects/Demo/Run.py", line 9, in <module> app = Create_apps() File...

View Article

PyQuery 中循环获取一段内容

最近在捣腾爬虫,比较习惯用 PyQuery 这个模块来解析 HTML 提取内容。简单看了一下文档,发现国内有些文档的写法是错的,自己试验了一下。 首先,循环一段内容比如循环我博客的文章标题,按照别人的文章来操作了一下发现是错误的。代码如下 import requests from pyquery import PyQuery as pq from lxml import etree try:...

View Article
Browsing all 9596 articles
Browse latest View live