2017年10月2日

python 中的流程控制语句

摘要: 原文 if 语句 >>> x = int(input("Please enter an integer: ")) Please enter an integer: 42 >>> if x < 0: ... x = 0 ... print('Negative changed to zero') ... 阅读全文

posted @ 2017-10-02 21:56 Lemo_wd 阅读(209) 评论(0) 推荐(0)

python 中 打印及格式化字符串的相关方法

摘要: 原文 将值转换为字符串 Python 有多种方式将任何值转为字符串: 将它传给 repr() 或 str() 函数. repr() 和 str() 的区别,看几个例子: >>> print(str('123')) 123 >>> print(str(123)) 123 >>> print(repr( 阅读全文

posted @ 2017-10-02 21:53 Lemo_wd 阅读(390) 评论(0) 推荐(0)

python 中 try ...except

摘要: 捕捉异常 try: 下的代码段 即为 需要捕捉异常的代码段; except: 捕获某一模块的异常,须带异常模块名称,可带原因参数;except 下代码为该异常发生时,所执行的代码;一个try可对应多个except子句。 注意:Python 2 和 3 在异常原因这边的处理比较不同 ,Python2 阅读全文

posted @ 2017-10-02 21:51 Lemo_wd 阅读(417) 评论(0) 推荐(0)

python 中面向对象的概念

摘要: 原文 域和作用空间 本地域,函数域(nonlocal)和 全局域(global) def scope_test(): def do_local(): spam = "local spam" def do_nonlocal(): nonlocal spam spam = "nonlocal spam" 阅读全文

posted @ 2017-10-02 21:49 Lemo_wd 阅读(193) 评论(0) 推荐(0)

python 多返回值

摘要: 多返回值: 定义了一个for...in 循环,count() 返回值是3个函数 阅读全文

posted @ 2017-10-02 00:52 Lemo_wd 阅读(499) 评论(0) 推荐(0)

2017年10月1日

java 中的闭包

摘要: 原文地址:https://sylvanassun.github.io/2017/07/30/2017-07-30-JavaClosure/ 1.自由变量: 对于内部函数function(x)来说,y就是自由变量.而y是函数Add(y)内的参数,所以Add(y)对内部函数function(x)形成了一 阅读全文

posted @ 2017-10-01 21:22 Lemo_wd 阅读(399) 评论(0) 推荐(0)

2017年9月29日

python中的 set 中的元素

摘要: set存储的元素和dict的key类似,必须是不变对象,因此,任何可变对象是不能放入set中的。 阅读全文

posted @ 2017-09-29 12:43 Lemo_wd 阅读(908) 评论(0) 推荐(0)

2017年9月28日

linux 下修改键盘映射

摘要: 参考文档 原因: 输入 键盘原本的 “\ |”,结果映射到 "< >",而 < 与 > 对应的键名分别是 less 与 greater 查看键名: 查询: 首先查询键名为 less 的映射 可以看到有两个映射,一个是正常的 59键 “,<”,另一个是出错的 94键“ less greater” 修改 阅读全文

posted @ 2017-09-28 19:37 Lemo_wd 阅读(2200) 评论(0) 推荐(0)

2017年9月27日

node-sass 安装

摘要: 设置 export ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/" export SASS_BINARY_SITE="https://npm.taobao.org/mirrors/node-sass" 这样,下载的时候,会进入淘宝 阅读全文

posted @ 2017-09-27 20:21 Lemo_wd 阅读(200) 评论(0) 推荐(0)

2017年9月21日

vscode 的 vue模板

摘要: 12 阅读全文

posted @ 2017-09-21 19:43 Lemo_wd 阅读(193) 评论(0) 推荐(0)

导航