随笔分类 -  Python

摘要:一、使用Screen创建一个Session screen -S sessionName 注:sessionName是要删除的session名字 二、结束一个Screen创建的session 1、首先使用screen -ls命令查看全部session列表 2、使用screen -S sessionNa 阅读全文
posted @ 2016-12-16 15:02 xiaofoyuan 阅读(8664) 评论(0) 推荐(0)
摘要:1、首先下载PSCP.exe,下载地址:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html 2、将PSCP.exe拷贝到C:/windows/system32下面,这样可以全局访问此命令 3、打开windows命令窗口输入: 阅读全文
posted @ 2016-12-16 13:59 xiaofoyuan 阅读(1951) 评论(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 阅读(208) 评论(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 阅读(237) 评论(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 阅读(324) 评论(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 阅读(219) 评论(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 阅读(157) 评论(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 阅读(147) 评论(0) 推荐(0)