New in Python: Syntax for variable annotations
python 3.6 added another interesting new feature that is known as Syntax for variable annotations . This new feature is outlined in PEP 526 . The basic premise of this PEP is take the idea of Type...
View ArticlePyCharm 2017.1 EAP 2 发布,Python IDE
今天我们将为PyCharm 2017.1发布我们的第二个EAP。PyCharm 是一种 python IDE,带有一整套可以帮助用户在使用 Python 语言开发时提高其效率的工具,比如调试、语法高亮、Project 管理、代码跳转、智能提示、自动完成、单元测试、版本控制。此外,该 IDE 提供了一些高级功能,以用于支持 Django 框架下的专业 Web 开发。 在这个版本中,我们修复了几个问题:...
View ArticleTricks with Django URLs and knowing you suck doing RE
RE or regular expressions and I don't really see eye to eye. But as a programmer, I have to work with them. So it's awkward like your ex works in the same office as you. But lucky for us, we just stick...
View ArticlePython高手之路【十二】socket网络编程
什么是客户/服务器架构? 什么是客户/服务器架构?不同的人有不同的答案。这要看你问的是什么人,以及指的是软件系统还是硬件系统了。但是,有一点是共通的:服务器是一个软件或硬件,用于提供客户需要的“服务”。服务器存在的唯一目的就是等待客户的请求,给这些客户服务,然后再等待其它的请求。另一方面,客户连上一个(预先已知的)服务器,提出自己的请求,...
View ArticleXML parsing in Python
This article focuses on how one can parse a given XML file and extract some useful data out of it in a structured way. XML:XML stands for eXtensible Markup Language. It was designed to store and...
View ArticleStatic Websites with Flask
I was investigating static site generators last week, I have used a couple of them before; this website is generated by Pelican , I am one of the maintainers of MkDocs , I use Sphinx regularly and I...
View Article关于MongoDB未授权访问的学习
最近MongoDB的未授权访问不知道为啥,就是这样突然火了,其实你要是留意的话,其实在2014年的时候就已经有人在乌云刷过这个了,其实很简单,就是没密码,然后暴露到公网上喽。 本次主要做一些redis的一个测试,刚好最近再开发一个系统,刚好写几个脚本做插件,也提高下工作效率。 具体漏洞细节请参考: redis未授权访问 然后利用ZoomEye和Shodan API进行条件批量筛选 ZoomEye:...
View Article通过python为ZABBIX发告警邮件
最近部署ZABBIX的邮件告警时,用刚学的python来写告警邮件脚本。 python代码如下 #!/usr/bin/python #coding:utf-8 import smtplib from email.mime.text import MIMEText import sys mail_host = 'smtp.163.com' mail_user = 'XXXX@163.com'...
View ArticleThe only problem with Python 3's str is that you don't grok it
I’ve found myself explaining python 3’s str to people online more and more often lately. There’s this ridiculous claim about that Python 3’s string handling is broken or somehow worse than Python 2,...
View ArticleData Processing and Enrichment in Spark Streaming with Python and Kafka
In myprevious blog post I introduced Spark Streaming and how it can be used to process 'unbounded' datasets. The example I did was a very basic one - simple counts of inbound tweets and grouping by...
View ArticleQMASM: A Quantum Macro Assembler
QMASM: A Quantum Macro Assembler Description QMASM fills a gap in the software ecosystem for D-Wave's adiabatic quantum computers by shielding the programmer from having to know system-specific...
View ArticlePython for PL/SQL Developers Series
How hard it is to learn a new language? It depends on the learner, of course; but everyone will agree that it is easier to get your feet wet if you learn the corresponding structures of a language you...
View ArticleTable of Contents: Deep Learning for Computer Vision with Python
A couple of days agoI mentioned that on Wednesday, January 18th at 10AM EST I am launching a Kickstarter to fund my new book ― Deep Learning for Computer Vision with python . As you’ll see later in...
View ArticleNewsBits - MongoDB ransoms, Python and PostgreSQL, Eagles and Beams and more
NewsBits for the week ending January 13th: MongoDB ransoms continue, picking the right PostgreSQL/python driver, Apache Eagle and Beam are now full Apache projects, the best of The Morning Paper, Go...
View ArticleWhy is runserver/daphne so slow?
(tl;dr) I installed django-channels and now my runserver command is very very slow. django-debug-toolbar was sort of the culprit (not really, because it was my own fault) The problem I've just started...
View ArticleA favorite development tool: direnv
direnv has been the most useful tool in my software development repository in the last two years. It's a simple tool: it loads and unloads environment variables when you move into or out of a...
View ArticleCorey Oordt: The road to Docker, Django and Amazon ECS, part 5
For part 1 For part 2 For part 3 For part 4 Making the container able to serve its own static media files Since each container will be behind a CDN or other caching proxy, we want each container able...
View Article对PyObject的一点理解
很久之前看过一篇 有关python的list的博客 ,里面提到,Python中list的数据结构是这样的: typedef struct { PyObject_VAR_HEAD PyObject **ob_item; Py_ssize_tallocated; } PyListObject; 我很不理解的是,list完全可以存储×ob_item就可以了啊,为什么要存放××ob_item呢?...
View Article为什么执行 x in range(y) 如此快(Python)
题图:unsplash.com 在 python 中,表达式 1000000000000000 in range(1000000000000001) 的执行速度能有多快? 判断一个元素 x 是否存在于集合 y 中最简单粗暴地方法就是迭代,每次取出一个值与之比较,如果集合中存在一个值 z 等于 x 就返回 true ,它的时间复杂度是 O(n),使用哈希算法的理论时间复杂度是...
View Article推荐给Python研发的书籍
近期跟1个留美博士开展数据感知方面的工作,1个多月来实行996工作制度,虽然工作比较辛苦,但是还是有所收获的。美中不足的是,前公司chuanbay拖欠了工资了2个月了,而公司负责人却相互推诿责任,手机不是关机就是无法接听,极其没有诚意。 虽然,我们程序猿拿它没办法,每次都说等他回来再说,而自己却跑去韩国汉城旅游,但是在这个世上一物降一物,不是不报是时辰未到。...
View Article