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

urllib2源码解读三(探索OpenerDirector的add_handler)

OpenerDirector是怎么把这些handler分类的 上篇文章说到,在build_opener中只是调用了OpenerDirector的add_handler方法,并不是直接操作的属性来完成handler的添加的。那么来看看OpenerDirector.add_handler具体做了些什么工作。...

View Article


Image may be NSFW.
Clik here to view.

编程的力量――控制流

程序就是一系列指令。但编程真正的力量不仅在于运行(或“执行”)一条接一条的指令,就像周末的任务清单那样。根据表达式求值的结果,程序可以决定跳过指令,重复指令,或从几条指令中选择一条运行。实际上,你几乎永远不希望程序从第一行代码开始,简单地执行每行代码,直到最后一行。“控制流语句”可以决定在什么条件下执行哪些python语句。...

View Article


Image may be NSFW.
Clik here to view.

Real Python: Flask by Example - Custom Angular Directive with D3

Welcome back. With Angular set up along with a loading spinner and our refactored Angular controller, let’s move on to the final part and create a custom Angular Directive to display a frequency...

View Article

Impatient Data Analysis Series:Introduction

作者:flying dutchman Introduction This blog is created to help impatient people, or people under impatient boss/supervisors, to learn to perform statistical analysis in a fast yet dirty way. The content...

View Article

Image may be NSFW.
Clik here to view.

Reuven Lerner: Implementing “zip” with list comprehensions

I love python’s “ zip ” function. I’m not sure just what it is about zip that I enjoy, but I have often found it to be quite useful. Before I describe what “zip” does, let me first show you an...

View Article


Image may be NSFW.
Clik here to view.

Feature Importance and Feature Selection With XGBoost in Python

A benefit of using ensembles of decision tree methods like gradient boosting is that they can automatically provide estimates of feature importance from a trained predictive model. In this post you...

View Article

100% test coverage [in python]

Tl;dr: I reached 100% test coverage (as measured by coverage ) on several of my projects, and I'm planning on continuing that trend for the important projects I maintain. We were chatting about this,...

View Article

Confidant version 1.1 released

Nearly a year ago we announced the initial release of Confidant . Since then we’ve continued active development, and today are happy to announce the release of version 1.1, with some new major...

View Article


在 Twisted Web 中调用同步方法

发现一个隐藏了很久的BUG,记一笔。 我原来给 Scrapyd 写过一个 小插件 ,希望可以同步等待爬虫的结果,并在接口中返回。 原来的实现是: class CrawlService(scrapyd.resources.JsonResource): def render_POST(self, request): resp = self.DO_SOME_SYNC_OPERATION(request)...

View Article


Image may be NSFW.
Clik here to view.

What books should I read to move past the beginner stage in Python?

I want to answer a question that I got on Twitter the other day: Someone asked for book recommendations to move past the “beginner” stage in python The person was looking for intermediate-level books...

View Article

Image may be NSFW.
Clik here to view.

深入理解Python中的ThreadLocal变量(上)

【引自selfboot的博客】我们知道多线程环境下,每一个线程均可以使用所属进程的全局变量。如果一个线程对全局变量进行了修改,将会影响到其他所有的线程。为了避免多个线程同时对变量进行修改,引入了线程同步机制,通过互斥锁,条件变量或者读写锁来控制对全局变量的访问。...

View Article

Image may be NSFW.
Clik here to view.

python中类的全面分析

面向对象重要的概念就是类(Class)和实例(Instance),类是抽象的模板,而实例是根据类创建出来的一个个具体的“对象”,每个对象都拥有相同的方法,但各自的数据可能不同。 先回顾下 OOP 的常用术语: 类:对具有相同数据和方法的一组对象的描述或定义。 对象:对象是一个类的实例。 实例(instance):一个对象的实例化实现。 实例属性(instance...

View Article

Weblate 2.8

Quite on schedule (just one day later), Weblate 2.7 is out today. This release brings Subversion support or improved zen mode. Full list of changes: Documentation improvements. Translations. Updated...

View Article


Image may be NSFW.
Clik here to view.

[iOS] 不依赖 Parse 或 Firebase,如何开始为你的 iOS 应用程序创建后端

你的iOS应用程序需要后端。随着Parse关闭了商店,现在我们该做什么呢?找到一个Parse替换或建立自己的后端? 我坚定地站在“学会建立自己的”后端阵营这边。...

View Article

Automating OSINT: Dark Web OSINT With Python Part Three: Visualization

Welcome back! In this series of blog posts we are wrapping the awesome OnionScan tool and then analyzing the data that falls out of it. If you haven’t read partsone andtwoin this series then you...

View Article


Dougal Matthews: Automate publishing to PyPI with pbr and Travis

Releasing new versions of your Open Source projects is a time demanding task. So in a recent , and admittedly small, project I decided to try and make it as easy as possible. I started using pbr and...

View Article

Brett Cannon: Introducing Which Film

What I'm announcing Today I'm happy to announce the public unveiling of Which Film ! I'll discuss how the site came about and what drives it, but I thought I would first explain what it does: it's a...

View Article


Image may be NSFW.
Clik here to view.

Python开发实战教程(8)-向网页提交获取数据

python开发实战教程(8)-向网页提交获取数据 一点号CSharp自学1小时前 来这里找志同道合的小伙伴!↑↑↑ Python应用现在如火如荼,应用范围很广。因其效率高开发迅速的优势,快速进入编程语言排行榜前几名。本系列文章致力于可以全面系统的介绍Python语言开发知识和相关知识总结。希望大家能够快速入门并学习Python这门语言。...

View Article

Image may be NSFW.
Clik here to view.

Python学习入门教程,字符串函数扩充详解

python学习入门教程,字符串函数扩充详解 一点号CSharp自学1小时前 因有用户反映,在基础文章对字符串函数的讲解太过少,故写一篇文章详细讲解一下常用字符串函数。本文章是对:程序员带你十天快速入门Python,玩转电脑软件开发(三)中字符串函数的详解与扩充。 如果您想学习并参与本教程的完善与写作。请在下方讨论区,回复相关问题。一起完善本文章教程的书写。 Python字符串常用函数。...

View Article

Image may be NSFW.
Clik here to view.

web2py--------------用web2py写 django的例子 --------开发环境

我们先从广为人知的例子说起xi 也就是官方的例子,我会在最后给出代码; ============================环境=================== 编译器使用vs code ,插件只有 python,PowerShell ,第二个插件这个教程中用不到, 为了不产生混淆,不使用版本管理器, py版本2.7.12, 系统,win10 web2py 版本...

View Article
Browsing all 9596 articles
Browse latest View live