上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 37 下一页
摘要: l:local e:enclosing g:global b:buitl-in 函数变量有作用域 if else while 变量没有作用域 不能修改全局变量 若要修改需加global 阅读全文
posted @ 2017-10-25 22:36 howhy 阅读(207) 评论(0) 推荐(0) 编辑
摘要: centos 6.x Python2.7x安装 yum install -y gcc gcc-develwget https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tgztar xf Python-2.7.14.tgzcd /root/Py 阅读全文
posted @ 2017-10-23 13:34 howhy 阅读(157) 评论(0) 推荐(0) 编辑
摘要: import logging #logging.basicConfig(level=logging.DEBUG, # format='[line:%(lineno)d] %(asctime)s %(levelname)s %(message)s', # datefmt='%a,%Y %b %d %H:%M:%S', ... 阅读全文
posted @ 2017-10-21 11:16 howhy 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 首先在window的文件夹窗口输入 : %APPDATA% 然后在底下新建pip文件夹,然后到pip文件夹里面去新建个pip.ini,然后再里面输入内容 [global] timeout = 6000 index-url = http://pypi.douban.com/simple trusted 阅读全文
posted @ 2017-10-19 09:39 howhy 阅读(753) 评论(0) 推荐(0) 编辑
摘要: """ 1. makestrans()用法 语法: str.maketrans(intab, outtab]); Python maketrans() 方法用于创建字符映射的转换表,对于接受两个参数的最简单的调用方式, 第一个参数是字符串,表示需要转换的字符,第二个参数也是字符串表示转换的目标。 注:两个字符串的长... 阅读全文
posted @ 2017-10-18 16:31 howhy 阅读(566) 评论(0) 推荐(0) 编辑
摘要: 1、locals() 和 globals() 是python 的内建函数,他们提供了字典的形式访问局部变量和全局变量的方式。 示例代码: 输出为: 2、locals() 返回是当前局部变量的深拷贝,修改locals() 中变量值的时候,实际上对于原变量本身是没有任何影响的。而globals()返回的 阅读全文
posted @ 2017-10-17 19:57 howhy 阅读(546) 评论(0) 推荐(0) 编辑
摘要: 打印结果: One (in Thread-A) Two (in Thread-B) Main-Thread threading.local()这个方法的特点用来保存一个全局变量,但是这个全局变量只有在当前线程才能访问, localVal.val = name这条语句可以储存一个变量到当前线程,如果在 阅读全文
posted @ 2017-10-17 19:20 howhy 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 线程;线程是计算机中工作的最小单元 io密集型 进程:默认有一个主线程,并且有多个线程,共享内部资源 计算密集型 协程:是一个线程,使用进程中的一个线程执行多个任务,微线程 阅读全文
posted @ 2017-10-15 17:08 howhy 阅读(135) 评论(0) 推荐(0) 编辑
摘要: #-*-coding:utf-8-*- from flask import Flask from flask import request import time from xml.etree import ElementTree as ET app=Flask(__name__) @app.route('/wechat',methods=['GET','POST']) def index():... 阅读全文
posted @ 2017-09-26 10:34 howhy 阅读(228) 评论(0) 推荐(0) 编辑
摘要: #-*- coding:utf-8 -*- from flask import Flask from flask import render_template from flask import request from flask import views from flask_sqlalchemy import SQLAlchemy import config import urllib2 ... 阅读全文
posted @ 2017-09-26 09:54 howhy 阅读(188) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 37 下一页