A new way to declare dependencies for your Python applications
Pipfile Warning: this project is under active development. A Pipfile is a new (and much better!) way to declare dependencies for your python applications. It will be a full replacement for the...
View Articlepython 变量
在数学概念中,变量(Variable)表示没有固定值,可改变的数。但从计算机系统实现角度来看,变量是一段或多段用来存储数据的内存。 编程语言允许你定义变量(variable)。所谓变量就是在程序中为了方便地引用内存中的值而为它取的名称。在 python 中,我们用 = 来给一个变量赋值。 我们先来声明一个变量 >>> a = 7 >>> print(a) 7...
View ArticlePython数据结构练习
1. 给定列表L,如[2,5,3,8,10,1],对其进行升序排序并输出。 代码: list = [2,5,8,10,1] print(list) list.sort() print(list) 2.给定字符串s,如‘123456’,将其逆序输出,使用切片 代码: str = '123456' print(str[::-1])...
View ArticleDatastore indexes basics
If you’ve been developing apps to host on Google App Engine (GAE) and use Google Cloud Datastore database (further referred to simply as Datastore), then you are probably aware of indexes. Simply put,...
View ArticlePay What You Want: Learn to Code 2017 Bundle
Have you always wanted to learn to code but were afraid it would cost you too much to learn? Get this bundle, and you can pay whatever you want. With the Pay What You Want: Learn to Code 2017 Bundle...
View Articlepython 列表
1.1.2 列表 列表由一系列按特定顺序排列的元素组成。你可以创建包含字母表中所有字母、数字0~9或 所有家庭成员姓名的列表;也可以将任何东西加入列表中,其中的元素之间可以没有任何关系。 鉴于列表通常包含多个元素,给列表指定一个表示复数的名称(如names)是个不错的主意。...
View ArticleMicropython开发之TPYBoard制作声光控开关教程实例
详细教程、实例以及更多Micropython的开发和DIY实例可参考TPYBoard官网: 链接内容 实验目的 学习在PC机系统中扩展简单I/O 接口的方法。 进一步学习编制数据输出程序的设计方法。 学习光敏模块的工作原理。 学习声音的工作原理。 学习TPYboard与声音传感器与光敏传感器的接线方法以及利用声音与光控制发光二极管亮灭。 所需元器件 TPYBoard板子一块 声音传感器一个...
View Articlebrut3k1t - 一款模块化的服务端暴力破解工具
项目地址: https://github.com/ex0dus-0x/brut3k1t 1. Introduction brut3k1t是一款服务端的暴力破解模块,支持多种协议的字典攻击。目前完整支持的协议有: ssh ftp smtp XMPP instagram facebook 将来会针对不同协议和服务实现对应的爆破模块(包括 Twitter, Facebook, Instagram)。...
View ArticleOS Module in Python with Examples
The OS module in python provides functions for interacting with the operating system. OS, comes under Python’s standard utility modules. This module provides a portable way of using operating system...
View ArticlePython测试函数的方法之一
python测试函数的方法之一 首先介绍简单的try......except尝试运行的放例如下面的图和代码来简单介绍下: 注释:提醒以下代码环境为2.7.x 请3.x以上的同学们老规矩print(把打印内容放入括号内) #!/usr/bin/env python # -*-coding:utf-8 -*- def test(x,y): print x+y try: test() except:...
View Article爬虫Selenium&bs4 + Miku分享
本文设计内容如下: 语言:python(3.x),R 工具:Spyder,Jupyter 内容:爬虫 模块/库/包:Python(selenium, bs4,rpy2) DateBase :网易云音乐、bilibili 本人互联网行业分析师一枚,由于现在分析&挖掘界限不是很明显,同时爱好写代码,所以喜欢每个方面都接触一下,技多不压身嘛。 最近想练习一下爬虫,之前使用R的时候接触过RCurl...
View Articlepython基础学习笔记第三天 s t r方法
七个重要的函数 # '_'.join("as") 将字符串中的每一个元素按照指定分隔符进行拼接 # split 移除指定字符串进行分割 # find 从开始往后找,找到第一个之后,获取其位置 # strip 移除字符串两边的空白, lstrip,rstrip 移除左,右空白 # upper 将字符串全部变成大写 isupper 判断字符串是否为大写,是返回true否则返回false # lower...
View ArticleWriting less code
Have you had that feeling that you have to write too much code to build simple functionality? Some things just feel repetitive, they feel you should be not have to write them yourself, instead a...
View Article从写博到出书:过程全记录
从读博士起,我对编程的兴趣忽然浓厚起来。当时做大规模并行运算,需要自己写很多程序和脚本。作为新进研究组的新人,我自觉负担起很多写程序的活儿。写得多了,兴趣也变得浓厚。 那个时候抓紧一切机会学习编程。在我读博的研究所里,有一位英国教授也喜欢编程。她叫爱玛希尔(Emma Hill),教我们用编程语言处理地球科学的数据。有一天,我路过她的办公室。她问我最近的学习进度。...
View ArticleVisualization's Twisted Path
Visualization is not a straight path from vision to reality. It is full of twists and turns, rabbit trails and road blocks, foul-ups and failures. Initial hypotheses are often wrong, and promising...
View ArticlePython性能分析工具简介
python性能分析工具简介 一点号复旦大数据昨天 总会遇到一个时候你会想提高程序执行效率,想看看哪部分耗时长成为瓶颈,想知道程序运行时内存和CPU使用情况。这时候你会需要一些方法对程序进行性能分析和调优。 By Context Manager可以上下文管理器自己实现一个计时器, 参见之前的介绍 timeit 文章里做的那样,通过定义类的 __enter__ 和 __exit__...
View Articlevcspull synchronize your repos
vcspull - synchronize your repos. built onlibvcs add repos to ~/.vcspull.yaml ~/code/: flask: "git+https://github.com/mitsuhiko/flask.git" ~/study/c: awesome: 'git+git://git.naquadah.org/awesome.git'...
View Article如何进行python编程:一个简单的收入波动分析模型
环境准备:sublime+ipython 打开代码编辑器sublime――本质上,txt文本编辑器也可以写代码,并保存为以.py为后缀的python文件,但专业的代码编辑器可以实现语法高亮、自动补全等功能,并支持项目管理,大大提高编写代码的效率和代码的管理。因此,选择一款合适的代码编辑器便不可少...
View ArticleHexagonal Number
Given an integer n, the task is to find the n’th hexagonal number . The n’th hexagonal number Hn is the number of distinct dots in a pattern of dots consisting of the outlines of regular hexagons with...
View ArticleScrapy+Selenium+Phantomjs Demo
前段时间学习了用python写爬虫,使用Scrapy框架爬取京东的商品信息。商品详情页的价格是由js生成的,而通过Scrapy直接爬取的源文件中无价格信息。 通过Selenium、Phantomjs便能实现。下面先介绍Phantomjs。 Phantomjs 作为一个基于webkit内核的没有UI界面的 浏览器...
View Article