![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
文章平均质量分 55
blockheading
Oracle rookie
展开
-
python3 文件迭代器
file_path =r'C:\Users\Administrator\Desktop\pwd.txt' for line in open(file_path): #Use file iterators to read by lines print(line, end='') #Calls __next__, catches Stoplteration 逐行读取文本文件的原创 2016-10-22 23:06:17 · 766 阅读 · 0 评论 -
linux下安装python3.5.2
从地址https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz下载安装包。 tar -xvzf Python-3.5.2.tgz --解压压缩包cd Python-3.5.2/ ./configure --prefix=/usr/python --添加配置 make make install[root@ocm1 Pyt原创 2016-10-16 18:31:29 · 2098 阅读 · 0 评论 -
python with子句浅析
with 语句的语法格式如下: 清单 1. with 语句的语法格式 with context_expression [as target(s)]: with-body 这里 context_expression 要返回一个上下文管理器对象,该对象并不赋值给 as 子句中的 target(s) ,如果指定了 as 子句的话,会将上下文管理器的 __en转载 2016-11-08 16:03:25 · 317 阅读 · 0 评论 -
用python爬虫csdn的内容,完美解决403 Forbidden
转自:http://www.yihaomen.com/article/python/210.htm csdn上偶尔还是有那么一两篇好文章的,如果遇到这样的好文章,你想直接把它弄到自己的网站里面,或者保存到本地处理,一般来说,两种方法: 1. copy and paste,这个不用多介绍,会用电脑的人都会。 2.自己写个爬虫,根据页面地址,自动爬出想要的内容。在这里采用python写爬转载 2016-10-28 00:35:02 · 4537 阅读 · 0 评论 -
pycharm快捷键
1、编辑(Editing) Ctrl + Space 基本的代码完成(类、方法、属性) Ctrl + Alt + Space 快速导入任意类 Ctrl + Shift + Enter 语句完成 Ctrl + P 参数信息(在方法中调用参数) Ctrl + Q 快速查看文档 Shift + F1 外部文档 Ctrl + 鼠标 简介 Ctrl + F1转载 2016-10-29 15:16:24 · 215 阅读 · 0 评论 -
python 嵌套函数使用方法
def linear(a, b): def result(x): return a * x + b return result --来源https://docs.python.org/3.5/faq/programming.html#how-do-you-make-a-higher-order-function-in-python >>> a = linear(原创 2016-10-31 23:50:52 · 1411 阅读 · 0 评论