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

Image may be NSFW.
Clik here to view.

Python进阶:函数式编程(高阶函数,map,reduce,filter,sorted,返回函数,匿名函数,偏函 ...

函数式编程 函数是python内建支持的一种封装,我们通过把大段代码拆成函数,通过一层一层的函数调用,就可以把复杂任务分解成简单的任务,这种分解可以称之为面向过程的程序设计。函数就是面向过程的程序设计的基本单元。 而函数式编程(请注意多了一个“式”字)――Functional Programming,虽然也可以归结到面向过程的程序设计,但其思想更接近数学计算。...

View Article


Image may be NSFW.
Clik here to view.

Getting Started with Mocking in Python

Introduction Mocking is simply the act of replacing the part of the application you are testing with a dummy version of that part called a mock . Instead of calling the actual implementation, you would...

View Article


Image may be NSFW.
Clik here to view.

代码这样写不止于优雅(Python版)

Martin(Bob大叔)曾在《代码整洁之道》一书打趣地说:当你的代码在做 Code Review 时,审查者要是愤怒地吼道: “What the fuck is this shit?” “Dude, What the fuck!” 等言辞激烈的词语时,那说明你写的代码是 Bad Code,如果审查者只是漫不经心的吐出几个 “What the fuck?”, 那说明你写的是 Good...

View Article

Image may be NSFW.
Clik here to view.

pychallenge(3)-re

pychallenge之三 题目还是下面一幅图配上一段话。 One small letter, surrounded by EXACTLY three big bodyguards on each of its sides. 纸面意思是一个小写字母被两边各三个大家伙包围着,其中着重加粗的EXACTLY表明只能正好是三个, 不能多也不能少。和之前一样看网页source发现一段文字,代码如下: 1 #...

View Article

Image may be NSFW.
Clik here to view.

The ANTLR mega tutorial

Parsers are powerful tools, and using ANTLR you could write all sort of parsers usable from many different languages. In this complete tutorial we are going to: explain the basis : what a parser is,...

View Article


Logging verbosity in django management commands

Tags: django Django has a command line --verbosity 0/1/2/3 option, but it only has influence on some of django’s internal output. It does not affect generic python logging levels. For management...

View Article

Image may be NSFW.
Clik here to view.

实战 | Python自动生成PPT调研报告

实战 | python自动生成PPT调研报告 一点号编程派6小时前 全文约 3821 字,读完可能需要 5 分钟。 文/JSong @2017.02.28 在数据分析里面有一句话是说,80%的时间要用于数据清洗和整理,而我觉得理想的状态应该是把更多的把时间花在数据背后的洞察当中。去年11月在简书占了个坑,说要自己写一个工具来解决,今天我来填坑了。1、解决方案概述...

View Article

通过例子学python基础篇1

现在做运维工作,要求具备python编程能力已经成了一个不争的事实,所以现在不管你是刚入门还是已经参加工作几年了,如果不具备python编程能力,在过几年竞争里会越来越弱,如果不突破这个枷锁,你的技术发展很快就达到了天花板,说的这么吓人,那该咋办呢?当然是要尽快学习了,所以下一步我们讨论下如何学习。...

View Article


Image may be NSFW.
Clik here to view.

Why Technical Skills Are Fundamental For Entrepreneurs Looking To Build...

Entrepreneur has an affiliate partnership with StackCommerce so we may get a share of the revenue from your purchase. It might seem like anyone with an entrepreneurial streak is bootstrapping their way...

View Article


Image may be NSFW.
Clik here to view.

A simple evolutionary process in 40 lines of Python

At PyCon Namibia I gave a talk entitled Rock, Paper, Scissors, Lizard, Spock with python . I spoke about how it’s easy to compute equilibria of 2 player games with Nashpy but also spoke a bit about...

View Article

Image may be NSFW.
Clik here to view.

Mastermind: Using Uber Engineering to Combat Fraud in Real Time

Where there’s money, there’s fraud. To help fight fraud on such a large scale, Uber Engineering’s fraud prevention platform team built Mastermind, a rules engine that can detect highly evolved forms...

View Article

4 Ways to manage the configuration in Python

I’m not a native speaker. Sorry for my english. Please understand. When develop the server applications, you could encounter a problem for managing the configuration. Of course, This issue can be...

View Article

Image may be NSFW.
Clik here to view.

线下培训 | python数据分析实战

线下培训 | python数据分析实战 一点号中国统计网昨天 你是即将毕业的大学生? 在职数据分析师? 零基础数据分析入门者? 对数据感兴趣却无从下手的人员? 中国统计网 Python与数据分析实战 php?url=0FoyEPY4Xj" alt="线下培训 | python数据分析实战"...

View Article


Image may be NSFW.
Clik here to view.

Fitting Gaussian Process Models in Python

A common applied statistics task involves building regression models to characterize non-linear relationships between variables. It is possible to fit such models by assuming a particular non-linear...

View Article

Will Kahn-Greene: Bleach v2.0 released!

What is it? Bleach is a python library for sanitizing and linkifying text from untrusted sources for safe usage in HTML. Bleach v2.0 released! Bleach 2.0 is a massive rewrite. Bleach relies on the...

View Article


Scraping with BeautifulSoup

BeautifulSoup is a handy library for web scraping that's mature, easy to use and feature complete. It can be regarded as jQuery's equivalent in the python world. In this post we're going to scrape the...

View Article

Image may be NSFW.
Clik here to view.

使用python抓取并分析数据―链家网(requests+BeautifulSoup)

本篇文章是使用python抓取数据的第一篇,使用requests+BeautifulSoup的方法对页面进行抓取和数据提取。通过使用requests库对链家网二手房列表页进行抓取,通过BeautifulSoup对页面进行解析,并从中获取房源价格,面积,户型和关注度的数据。 准备工作...

View Article


One hundred prisoners and a light bulb simulation

This is a little off my usual topic of IT Security but it's something I've been thinking about a bit lately. I recently came across the "One hundred prisoners and a light bulb" riddle. It was posed as...

View Article

Reuven Lerner: 2+2 might be 4, but what is True+True?

In python, we know that we can add two integers together: >> 2 + 24 And of course, we can add two strings together: >> 'a' + 'b''ab' We can even add two lists together: >> [1,2,3] +...

View Article

Image may be NSFW.
Clik here to view.

5 个开源 Python 库,让机器学习更简单

机器学习令人兴奋,但实际操作却很困难也很复杂。它涉及到很多手动操作,如集合工作流和管道,设置数据源,以及在内部部署与云部署的资源之间切换等。 python 是一款强大的工具语言,被广泛应用在大数据和机器学习之中。以下推荐了 5 个 Python 库,帮你疏通机器学习之路。 PyWren PyWren 允许你将基于 Python 的科学计算工作负载作为多个 AWS Lambda 函数来运行。The...

View Article
Browsing all 9596 articles
Browse latest View live