python使用pymysql库+conf文件链接mysql的"坑"
因为跨平台需要,我mac的mysql端口不是3306,所以读取conf文件的时候需要在里面设置端口 比如这样的 [db] db_user = root db_pass = root db_database = mscan db_port = 3306 db_host = 127.0.0.1 然而在连接mysql的时候提示端口不能是字符串,我跑print type看了下是......
View ArticlePython学习笔记-Day1-Python基础
1.高级语言翻译成机器语言方式:解释和编译 python属于解释型语言 1.1语法常见三种错误类型 语法错误(syntax errors) 运行错误(runtime errors) 语意错误(semantic errors) 1.3变量和类型 变量:顾名思义就是变化的量值,定义变量可重复调用。提高开发效率 变量类型(调用范围):全局变量,局部变量...
View Article编程入门:详细对比9门主流编程语言
编程入门:详细对比9门主流编程语言 一点号w3cschool昨天 如果你正在考虑从哪里入门编程,看完这篇你也许会清晰一些。 在学习编程之前,我们需要清楚学习编程的目的和方向,了解每种语言的优势、劣势。这些是国外一个网站做的流行语言对比图,希望帮你更好的理解各种语言的用处、难易程度。 python...
View Article使用python发送和接收邮件
关于电子邮件 大学之前,基本不用邮箱,所以基本感觉不到它的存在,也不知道有什么用;然而大学之后,随着认识的人越来越多,知识越来越广泛,邮箱已然成为很重要的通讯工具,大学一些课程作业需要有邮箱发给老师,注册网站需要邮箱,找工作也需要邮箱;那么电子邮箱是什么原理呢? 发送邮件 SMTP协议 SMTP(Simple Mail Transfer...
View ArticleDigital Offers: Learn to build apps from scratch for only $39!
The phrase "there's an app for that" covers just about everything these days. Want a date? There's an app for that. Want some food? There's an app for that. Want to learn more about how to please a...
View ArticlePython_实现三级目录展示
要求: 1、三级菜单 2、可依次选择进入各子菜单,选择序号进入目录 3、输入b返回上级目录,q退出更改目录 代码实现: 1 #!/bin/env python 2 #!--*--coding:utf-8 --*-- 3 # ----*auth:freem* 4 import sys 5 #flag=True 6 #def flas(): 7 #flag=False; 8...
View ArticlePyflame: Uber Engineering’s Ptracing Profiler for Python
At Uber, we make an effort to write efficient backend services to keep our compute costs low. This becomes increasingly important as our business grows; seemingly small inefficiencies are greatly...
View ArticlewxPython Cookbook Available for Pre-Order
I am excited to announce that the wxpython Cookbook is now available for Pre-Order. You can get your digital copy on Gumroad or Leanpub now. You can get a sample of the book on Leanpub if you’d like...
View ArticleDjango Tips #15 Using Mixins With Class-Based Views
I was reading today the book Two Scoops of Django by Audrey and Daniel Roy Greenfeld and found some interesting tips about using class-based views with mixins. Some general rules to use mixins to...
View ArticlePython Engineering at Microsoft: Microsoft’s participation in the 2016 Python...
From September 5th to the 9th a group of python core developers gathered for a sprint hosted at Instagram and sponsored by Instagram , Microsoft , and the Python Software Foundation . The goal was to...
View ArticlePython代码注释应该怎么写?
写代码注释是一件很重要的事情,如果你写的一段函数给别人调用那么往往都需要配上一些基本的注释。写好代码可以让别人容易阅读你的代码。试想一下:如果你在github上面找到一段你想要的代码,这段代码有200行,可能这些代码我们要进行改造,那么这时候如果代码中都没有恰当的注释,我们可能要用比较久的时间去通读一下他的代码。...
View ArticleCan Cython make Python Great in Programming Contests?
python is getting very popular as the first programming language in both home and aborad. I know many of the Bangladeshi universities have started using Python to introduce beginners to the wonderful...
View ArticleScrapy定向爬虫教程(三)――爬取多个页面
本部分所实现的功能是,批量的爬取网页信息,不再是像以前那样只能下载一个页面了。也就是说,分析出网页的url规律后,用特定的算法去迭代,达到把整个网站的有效信息都拿下的目的。 因为本部分讲完后,功能已经到了可以使用的地步,所以我把本部分的结果独立出来,把项目上传到了github,小伙伴可以下载参考,地址 https://github.com/kongtianyi/heartsong...
View ArticlePyCharm 2016.3 EAP is Available with Initial Support for Python 3.6
Great news: a couple of weeks ago python 3.6.0 beta 1 was released, marking the end of the feature development phase for Python 3.6 . And today we give you the first PyCharm 2016.3 Early Access...
View Article通过Registrator进行服务的自动注册
作者:杨冬 欢迎转载,也请保留这段声明。谢谢! 出处: https://andyyoung01.github.io/ 或 http://andyyoung01.16mb.com/...
View Article2 Factor Authentication in Django
Introduction 2 Factor Authentication ― or 2FA in short ― is a special version of the general Multi Factor Authentication ( MFA ) and generally describes the idea that is also followed by Universal 2...
View ArticlePython生成csv中文乱码解决办法
一、前言 在linux下面用python进行数据处理,然后输出为csv格式,如果没有中文一切正常,但是如果有中文,就会出现乱码的问题,本篇将讲述怎么处理这个问题 二、处理过程 原始代码 #!/usr/bin/env python# -*- coding: UTF-8 -*-import csv#import codecswith open('test.csv', 'wb') as...
View ArticlePython3.x新特性及10大变化
这篇文章主要介绍了python 3.x 新特性及10大变化,本文讲解了Python之父Guido van Rossum谈到了Python 3.0的构思,Python3版本的一些变化如print() and exec() 函数、整数及除法、input()代替raw_input()等,需要的朋友可以参考下 Python 3.x 起始版本是Python 3.0,目前的最新版本是 3.3.3...
View ArticleAnwesha Das: First time PyLadies presence in Pycon India
The title for the blog post is not something I wrote but copy pasted a tweet by @kushaldas. Kushal is being attending PyCon India since 2010, a year after it started. This one tweet of his says if not...
View Article