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

Image may be NSFW.
Clik here to view.

A little data munging

July 24, 2016 at 8:45 PM by Dr. Drang For the past couple of weeks, I’ve been doing analyses of other people’s data. Usually, the data comes in the form of a spreadsheet, which works out fine. I don’t...

View Article


Image may be NSFW.
Clik here to view.

如何测试代码覆盖率:coverage.py 简介

本文作者为 Mike Driscoll,译者为 linkcheng,校对 EarlGrey,是 python 翻译组完成的第二篇译文。本文为编程派微信公众号首发。 Coverage.py是一个用来测试代码覆盖率的 Python 第三方库。它起初是由 Ned Batchelder 创建。在编程界,术语“覆盖”通常是用来描述测试的有效性,以及测试的实际覆盖率。coverage.py 库支持 Python...

View Article


Image may be NSFW.
Clik here to view.

Python黑帽编程1.3 Python运行时与包管理工具

python 黑帽编程 1.3 Python 运行时与 包管理工具 0.1 本系列教程说明 本系列教程,采用的大纲母本为《 Understanding Network Hacks Attack and Defense with Python 》一书,为了解决很多同学对英文书的恐惧,解决看书之后实战过程中遇到的问题...

View Article

Image may be NSFW.
Clik here to view.

Django: how to create PDF, MS Word and Excel documents fromtemplates

If you’re building a Django system that implies serving some kind of documents like reports or bills, chances are you want to provide docs in various formats from PDF to MS Word to HTML . But how to...

View Article

Packing and Unpacking Arguments in Python

Background Consider a situation where we have a function that receives four arguments. We want to make call to this function and we have a list of size 4 with us that has all arguments for the...

View Article


Image may be NSFW.
Clik here to view.

Jupyter Lab发布了!

相信python开发者都对Jupyter Notebook这种笔记本式的开发环境非常喜欢。这种基于网页的开发环境不仅允许用户创建和共享含有代码的文档,还可以植入公式、可视化图片和描述性的文本等等。前身为IPython Notebook,由于颇受Python开发者的欢迎,Jupyter Notebook目前已经广泛应用于很多其它流行的编程语言,如R、Julia、Perl、Lua和Scala等。...

View Article

SQLAlchemy and "Lost connection to MySQL server during query"

... a weird behaviour when pool_recycle is ignored Preface:This is quite a standard problem for apps/websites with low traffic or those using heavy caching and hitting the database quite seldom. Most...

View Article

Image may be NSFW.
Clik here to view.

初识django, 一起进入python的世界吧

[size=medium]这几天花了点时间看了一下python世界中的django,正如某大所说,掌握另外一门语言是有必要的,同样我也作出了自己的选择。从这几天的学习中,我确实也发现其他语言及其框架等确实有一种与众不同的感觉。下面我把自己这几天看到的东西稍微作了一下总结,本文并不是django的教程,而是ahuaxuan对django的一些自己的理解,可能有些不成熟的地方,希望大家不要吝惜手中的砖头...

View Article


Image may be NSFW.
Clik here to view.

Python笔记 : 第一章 Python概述

python是一种计算机程序设计语言。你可能已经听说过很多种流行的编程语言,比如非常难学的C语言,非常流行的Java语言,适合初学者的Basic语言,适合网页编程的javascript语言等等。 那Python是一种什么语言?...

View Article


Speeding up protocol decoders in python

Decoding binary protocols in python Decoding binary protocols like the mysql Client/Server Protocol or MySQL's new X Protocol involves taking a sequence of bytes and turning them into integers. In...

View Article

Image may be NSFW.
Clik here to view.

notepad++ 配置Python 调试环境 简洁实用版

一、 安装python 1. 下载python 2.7版本并安装; 2. 在安装到自定义python的时候选择 add python to ptah项: 3. 点next直到完成安装。 二 、 配置notepad++ 1. 安装 nppexec 插件: 点击 插件---plugin manager --- show plugin manager ,选择 nppexec 插件安装; 2....

View Article

Django Tips #8 Blank or Null?

Django models API offers two similar options that usually cause confusion on many developers: null and blank . When I first started working with Django I couldn’t tell the difference and always ended...

View Article

PyDev of the Week: Nicholas Tollervey

This week we welcome Nicholas Tollervey ( @ntoll ) as our PyDev of the Week. He is the author of the python in Education booklet and the co-author of Learning jQuery Deferreds: Taming Callback Hell...

View Article


ShipIt Day Recap - July 2016

We finished up last week with another successful ShipIt Day. ShipIt Days are quarterly events where we put down client work for a little bit and focus on learning, stretching ourselves, and sharing....

View Article

Image may be NSFW.
Clik here to view.

How to Share Your Python Packages

Overview python packages are the building blocks of Python applications. They encapsulate some coherent functionality that can be imported and used by many applications and systems. But first,...

View Article


Image may be NSFW.
Clik here to view.

使用Python的Tornado框架实现一个Web端图书展示页面

首先,为什么选择Tornado:1.高性能的网络库,这可以和gevent,twisted,libevent等做对。提供了异步io支持,超时事件处理,在此基础上提供了tcpserver,httpclient,尤其是curlhttpclient,在现有http客户端中肯定排第一。可以用来做爬虫,游戏服务器,据我所知业界已有使用tornado作为游戏服务器2.web框架,这可以和django,flask对...

View Article

Image may be NSFW.
Clik here to view.

Windows中使用wxPython和py2exe开发Python的GUI程序的实例教程

python是支持可视化编程,即编写gui程序,你可以用它来编写自己喜欢的桌面程序。使用wxPython来做界面非常的简单,只是不能像C#一样拖动控件,需要自行写代码布局。在完成编写之后,由于直接的py文件不能再没有安装python的电脑上运行,能否有一个打包成在任意电脑都能运行的工具,网上找找发现了py2exe正好可以完成这个功能。wxPython和py2exe都是开源免费软件。环境配置wxPyt...

View Article


Image may be NSFW.
Clik here to view.

Python的requests网络编程包使用教程

早就听说requests的库的强大,只是还没有接触,今天接触了一下,发现以前使用urllib,urllib2等方法真是太搓了……这里写些简单的使用初步作为一个记录一、下载官方项目页: https://pypi.python.org/pypi/requests/#downloads可以从上面直接下载。二、发送无参数的get请求>>> r =...

View Article

Python的SQLalchemy模块连接与操作MySQL的基础示例

一、SQLalchemy简介SQLAlchemy是一个开源的SQL工具包,基本python编程语言的MIT许可证而发布的对象关系映射器。SQLAlchemy提供了“一个熟知的企业级全套持久性模式,使用ORM等独立SQLAlchemy的一个优势在于其允许开发人员首先考虑数据模型,并能决定稍后可视化数据的方式。二、SQLAlchempy的安装首先需安装mysql,这里就不再多说了.....然后,下载SQ...

View Article

Python中的异常处理相关语句基础学习笔记

异常是指因为程序出现了错误而在正常控制流以外采取的行动,其分为两个阶段,第一阶段是引发异常的错误,当系统检测到错误并且意识到异常条件,解释器(也可以是程序员引发异常)会引发一个异常通知前段控制流有错误发生,对异常的处理发生在第二阶段,异常引发后,可以调用很多不同的操作,可以是忽略错误,或是记录错误但不采取任何措施,采取补救措施后终止程序,或是江青问题的影响后设法继续执行程序...

View Article
Browsing all 9596 articles
Browse latest View live