上一页 1 2 3 4 5 6 ··· 14 下一页
摘要: 上诉办法是在需要清除浮动的地方加个div.clear或者br.clear,我们知道这样能解决基本清浮动问题。 但是这种方法的最大缺陷就是改变了html结构,虽然只是加个div。 最优浮动闭合方案(这是我们推荐的): 用法很简单,在浮动元素的父云素上添加class=”demo clearfix”。 你 阅读全文
posted @ 2016-07-13 14:01 xiaofoyuan 阅读(965) 评论(0) 推荐(0) 编辑
摘要: 如何在Python3.x中使用Beautiful Soup 1、BeautifulSoup中文文档:http://www.crummy.com/software/BeautifulSoup/bs3/documentation.zh.html 2、BeautifulSoup下载:http://www. 阅读全文
posted @ 2016-06-02 14:18 xiaofoyuan 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 一、创建函数 >>> import math >>> x=1 >>> y=math.sqrt >>> callable(x) #显示False >>> callable(y) #显示True 1、def,用来创建函数 >>> def hello(name) >>> return 'Hello, '+ 阅读全文
posted @ 2016-05-27 17:25 xiaofoyuan 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 一、函数导入 1、为模块提供别名 >>> import math as foobar #设置math 别名为foobar >>> foobar.sqrt(4) 显示:2.0 2、为函数提供别名 >>> from math import sqrt as foobar >>> foobar(4) 显示: 阅读全文
posted @ 2016-05-26 17:20 xiaofoyuan 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 一、创建和使用字典 1、创建字典 phonebook={'Alice':'2341','Beth':'9102','Cecil':'3258'} 2、dict,通过映射创建字典 >>> items=[('name','Gumby'),('age',34)] >>> d=dict(items) >>> 阅读全文
posted @ 2016-05-26 15:17 xiaofoyuan 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 一、字符串格式化 >>> format="Hello,%s. %s enough for ya?" >>> values=('World','Hot') >>> print(format % values) 显示:Hello,World. Hot enough for ya? 注:%,字符串格式化的 阅读全文
posted @ 2016-05-26 10:26 xiaofoyuan 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 一、成员资格 1、检查某个字符是否在某个字符串中:'a' in 'absent' 2、获取数组的长度、最大、最小值: numbers=[100,54,345] len(numbers) //长度 max(numbers) //最大值 min(numbers) //最小值 max(2,3)比较最大值 阅读全文
posted @ 2016-05-23 10:20 xiaofoyuan 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 一、Windows上Python的安装 1、打开web浏览器,访问http://www.python.org,进行下载安装 二、Python的使用 1、print打印:print('Hello,World!') 2、input函数:input("What's your name?") 3、pow幂函 阅读全文
posted @ 2016-05-20 14:46 xiaofoyuan 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 一、为Express添加about路由 1、新建js文件,about.js 2、打开about.js,并输入以下代码: var express=require('express'); var router=express.Router(); router.get('/',function(req,r 阅读全文
posted @ 2016-05-19 22:22 xiaofoyuan 阅读(1522) 评论(0) 推荐(0) 编辑
摘要: 一、如何运行NodeJS文件? 1、打开文本编辑器,输入以下内容: var http=require('http'); http.createServer(function(req,res){ res.writeHead(200,{'Content-Type':'text/plain'}); res 阅读全文
posted @ 2016-05-19 20:59 xiaofoyuan 阅读(196) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 14 下一页