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

Data manipulation with numpy: tips and tricks, part 2

Data manipulation with numpy: tips and tricks, part 2 More examples on fast manipulations with data using numpy. First part may be foundhere. In[1]: from __future__ import print_function import numpy...

View Article


Python 常用 PEP8 编码规范和建议

目录 代码布局 缩进 每级缩进用4个空格。 括号中使用垂直隐式缩进或使用悬挂缩进。 EXAMPLE: # (垂直隐式缩进)对准左括号 foo = long_function_name(var_one, var_two, var_three, var_four) # (悬挂缩进) 一般情况只需多一层缩进 foo = long_function_name( var_one, var_two,...

View Article


Python unittest模块简介

作者:杨冬 欢迎转载,也请保留这段声明。谢谢! 出处: https://andyyoung01.github.io/ 或 http://andyyoung01.16mb.com/ unittest测试框架是python的内置模块。它与其它语言的单元测试框架如JUnit类似。本文简单看一下此模块的使用。 unittest模块一般的使用流程如下: import unittest...

View Article

Flask 502 错误解决:upstream sent too big header

本站文章除注明转载外,均为本站原创或者翻译。 本站文章欢迎各种形式的转载,但请18岁以上的转载者注明文章出处,尊重我的劳动,也尊重你的智商; 本站部分原创和翻译文章提供markdown格式源码,欢迎使用 文章源码 进行转载; 本博客采用WPCMD 维护; 本文标题:Flask 502 错误解决:upstream sent too big header 本文链接:...

View Article

Image may be NSFW.
Clik here to view.

Machine Learning with Python-A Revolution in the field of Data Analytics

Introduction A data analysis technique that introduces automation in the development of an analytical model is termed as Machine Learning. Algorithms are employed by machine learning which draws...

View Article


Django Weekly 20 - Django REST Chapter, View ORM SQL Query, Top 10 Django...

Django-Rest-Framework Draft Appendix in Test-Driven Development with python Book Harry the Author of the book is looking for feedback on the Appendix. Having said that if you haven't used DSF this is...

View Article

Getting Started with Pyparsing

The grammar specification should be a natural-looking part of the python program, easy-to-read, and familiar in style and format to Python programmers. - Zen of Pyparsing....

View Article

“MySQL server has gone away” in django ThreadPoolExecutor

mysql server has gone away报错 最近碰到 MySQL server has gone away 的报错,报错出现的现象是: 生产环境周末到周一上午会出现一些间断的报错,晚些恢复正常 测试环境每天上午会出现间断报错,晚些恢复正常 出错的场景都是通过 ThreadPoolExecutor 执行的异步任务中执行 mysql 查询操作,其他查询操作正常...

View Article


Image may be NSFW.
Clik here to view.

Let’s Tackle a Classic, Wicked Physics Problem. It’ll Be Fun―Promise

Here is classic (and difficult) physics problem that poses an interestingquestion: Take two points in space, Point 1 and Point 2. What is the path from point 1 to 2 that a frictionless object could...

View Article


Image may be NSFW.
Clik here to view.

Packaging and Publishing Python code

If you have been coding in python, even for a while, you must be familiar with the concept of ‘pip’ by now. It is a package management system used to install and manage software packages/libraries...

View Article

Keywords in Python | Set 2

python Keywords Introduction Keywords in Python | Set 1 More keywords: 16. try: This keyword is used for exception handling , used to catch the errors in the code using the keyword except. Code in...

View Article

Image may be NSFW.
Clik here to view.

Display System Information On The Onion Omega2 OLED Expansion

So I was a recent Kickstarter backer for the Onion Omega2 Internet of Things (IoT) device. My package finally came and I wanted to see what I can do with it. My package included the Omega2, expansion...

View Article

Image may be NSFW.
Clik here to view.

Getting all parent directories of a file

Few minutes ago I needed to solve trivial problem of getting all parent directories of file. It's very easy to do it imperatively, but it would simply not satisfy me. Hence, I challenged myself to do...

View Article


Image may be NSFW.
Clik here to view.

从python到java设计模式之命令模式

从python到java设计模式之命令模式 一点号前端交流2小时前 最近在看Hystrix,有博客提到这个里面使用到了命令模式。虽然命令模式在web开发中很少见,但神奇的是我也在前段时间的一次设计中使用了命令模式(或者说类似的模式)。 命令模式算是一个比较特别的模式,为什么说它特别?因为很多教你如何做好oop设计的书都会提到类似的观点: 不要把操作变成类。 然而命令模式就是把某一个操作封装成为类。...

View Article

Windows下使用C++编写Python的扩展模块详细说明

windows下使用C++编写python的扩展模块详细说明 一点号java交流1小时前 在Windows系统实现C++编写Python的扩展模块,折腾了很久,找到一篇文章,简单明了,给了我很大帮助。因为文章里的代码排版问题,空格丢失,让数据类型和函数名称等黏在一块,也会让刚接触C++写Python扩展模块的人产生障碍。...

View Article


Actually, you CAN do it

I maintain a lot of open source projects. In order to do so, I have to effectively manage my time. Most of my projects follow this philosophy: if you want something changed, send a patch. If you are...

View Article

Image may be NSFW.
Clik here to view.

0006 编程入门python语言之加法计算器

0006 编程入门python语言之加法计算器 一点号零基础学编程4小时前 php?url=0FPkAa1Vjm" alt="0006 编程入门python语言之加法计算器" />这节课我们来做一个加法计算器,也就是输入2个数字,让程序计算出结果。 直接在python环境输入代码并运行 打开“LX终端”程序,输入python命令,进入python运行环境:...

View Article


Getting Started with the IPython Notebook

Ipython Notebook * Until now we have worked directly via the interactive Python console, or by writing Python programs. IPython is a set of tools developed to make it easier for the programmers to work...

View Article

Image may be NSFW.
Clik here to view.

Making the Python REPL output Pretty

Recently, there was a tweet by Ned Batchelder that illustrated how to make python REPL output prettier. I went to implement it, and wanted to put together some instructions for the future....

View Article

Image may be NSFW.
Clik here to view.

FBI网站被黑致数据泄露?官方称这根本是个骗局

著名黑客CyberZeist最近入侵了FBI网站(FBI.gov),并将几个备份文件(acc_102016.bck,acc_112016.bck,old_acc16.bck等)公布在了Pastebin,数据内容包括姓名、SHA1加密密码、SHA1盐和电子邮件等。 【1.6 更新】黑客宣称攻破FBI官网利用的是Plone...

View Article
Browsing all 9596 articles
Browse latest View live