
Python Learn
业余时间学习Python记录
GP0071
不想写
展开
-
Python2.7 -- WSGI接口
通过WSGI接口,实现一个简单的WEB应用参考:https://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/001386832689740b04430a98f614b6da89da2157ea3efe2000有过开发经验的都知道,如果要运行起一个web应用,我们优先要将我们的代码托管原创 2018-02-01 09:04:26 · 560 阅读 · 0 评论 -
Python3 -- 删除本地无用jar文件(window版本)
由于项目用maven构建,日记月累,版本不断迭代,本地的maven仓库多了很多历史版本的产物,没什么用,而且还占用硬盘空间,所以通过python3写了一个脚本,根据正则表达式,删除无用jar文件。代码如下:# -*- coding:utf-8 -*-import osimport reimport shutil__format1_prefix = '[^\s]*dx-[^\s原创 2018-02-05 17:49:16 · 800 阅读 · 0 评论 -
Python -- From Zero to Hero
翻译自:https://medium.freecodecamp.org/learning-python-from-zero-to-hero-120ea540b567此篇博客,简单易懂的描述了python的基础知识,适用于0基础入门的同学,1小时基本就能搞懂。所以翻译了后,分享…首先,Python是什么?根据它的创建者Guido van Rossum,Python是一个: “翻译 2018-02-06 14:29:25 · 924 阅读 · 0 评论 -
Python2.7 -- 爬虫之百度贴吧
源码参考;https://cuiqingcai.com/993.html使用python,写爬虫,知识含量满满 涉及:调用URL模块正则表达式模块文件流读写模块代码如下粘贴出来直接可以运行:# -*- coding:utf-8 -*-__author__ = 'GP'import urllibimport urllib2import re#处理页面标签类原创 2018-01-24 13:59:23 · 563 阅读 · 0 评论 -
python -- java与python的区别
下面这张图,很直观的体现了java与pyhton的区别原创 2017-12-11 10:20:15 · 862 阅读 · 0 评论 -
Python2.7 -- 基本用法备忘
基础类型用法# coding:utf-8print 'int type : %s' % 1print 'float type : %s' % 1.1print 'String type : %s' % 'OK'print 'boolean type : %s' % Trueprint 'and : %s' % True and Falseprint 'or type : %原创 2018-01-08 17:24:05 · 416 阅读 · 0 评论 -
Python2.7 -- 如何使用函数
函数使用和创建入门# coding:utf-8def my_def(): return '你调用我想干啥!!!!!'def my_pass(): passdef my_return_more(x, y, z): return x, y, zprint '官网的函数参考:http://docs.python.org/2/library/funct原创 2018-01-09 10:44:06 · 694 阅读 · 0 评论 -
Python2.7 -- 装饰器模式(类似Java拦截器)
# coding:utf-8import functoolsdef log(func): def wrapper(*args, **kw): print 'call %s():' % func.__name__ return func(*args, **kw) return wrapper# 高阶函数def log(text):原创 2018-01-09 14:40:02 · 1985 阅读 · 0 评论 -
Python2.7 -- 模块的使用
看下面的代码,相当于java类中,通过main方法启动,执行一个方法的逻辑。# coding:utf-8import sysdef test(): args = sys.argv if len(args) == 1: print 'Hello, world!' elif len(args) == 2: print 'Hello原创 2018-01-09 16:44:23 · 554 阅读 · 0 评论 -
Python2.7 -- 连接MYSQL小程序
# coding:utf-8import mysql.connectorconn = mysql.connector.connect(host='192.168.15.32', port='3306', user='devuser', password='1001hk', database='dx20', \ use_unicod原创 2018-01-10 15:22:51 · 534 阅读 · 0 评论