
Python
文章平均质量分 66
xc_tsao
路漫漫其修远兮,吾将上下而求索。
展开
-
Python核心编程学习笔记(二)
7、 8、 9、 10、 11、 12、原创 2014-05-07 11:17:53 · 809 阅读 · 4 评论 -
Python核心编程学习笔记(八)——第五章习题
第五章练习 5-原创 2014-05-09 16:22:58 · 961 阅读 · 0 评论 -
Python核心编程学习笔记(七)
26、Python对象,所有的Python对象都拥有三个特征:身份、类型 和 值。 身份:可以使用内建函数id()来得到,可以被认为是该对象的内存; 类型:可以使用内建函数type()查看对象的类型; 值: 对象表示的数据项。 27、标准类型(基本数据类型)数字(分为几个子类型,其中有三个是整型)整型布尔型原创 2014-05-09 11:27:39 · 610 阅读 · 0 评论 -
Python核心编程学习笔记(四)
16、文件和内建函数open()、file() 打开文件:handle = open(file_name, access_mode = 'r') access_mode中,'r'表示读取,'w'表示写入,'a'表示添加,'+'表示读写,'b'表示二进制访问。如果未提供access_mode,默认值为'r'。 以下代码提示用户输入文件名,然后打开原创 2014-05-08 00:26:14 · 1112 阅读 · 0 评论 -
Python核心编程学习笔记(三)
12、if语句 if expression1: if-suiteelif expression2: elif_suiteelse: else_suite 13、while循环while expression: while_suite 语句while_suite会被连续不断地循环执行,直到表达原创 2014-05-07 12:22:04 · 856 阅读 · 0 评论 -
Python核心编程学习笔记(十二)——文件和输入输出
33、文件内建函数[open() 和 file() ]——提供了初始化输入/输出(I/O)操作的通用接口。open() 内建函数成功打开文件后会返回一个文件对象,否则引发一个错误。 open() 的基本语法是:file_object = open(file_name, access_mode='r', buffering=-1)file_name 是包含要打开的文件名字的原创 2014-05-15 23:50:53 · 795 阅读 · 0 评论 -
Python正则表达式
39、input()原创 2014-05-19 22:51:32 · 655 阅读 · 0 评论 -
Python核心编程学习笔记(十一)
31、原创 2014-05-15 23:08:16 · 672 阅读 · 0 评论 -
Python核心编程学习笔记(九)——集合
29、集合类型 (1) 创建集合,只有唯一的方法——用集合的工厂方法set()(可变集合)和frozenset()(不可变集合)>>> s = set('cheeseshop')>>> sset(['c', 'e', 'h', 'o', 'p', 's'])>>> t = frozenset('bookshop')>>> tfrozenset(['b',原创 2014-05-11 11:48:48 · 656 阅读 · 0 评论 -
Ubuntu下安装Pycharm
1) 系统需求:Sun JDK 1.6+2) 去官网下载tar包:http://www.jetbrains.com/pycharm/download/(目前能下到的最新版为:pycharm-professional-3.4.1.tar.gz)3) 打开终端,切换到该文件所在目录,执行:tar zxvf pycharm-professional-3.4.1.tar.g原创 2014-09-28 22:41:53 · 889 阅读 · 0 评论 -
Python的platform模块
python中,platform模块给我们提供了很多方法去获取操作系统的信息原创 2015-03-01 22:20:29 · 16486 阅读 · 0 评论 -
python中常用的列表类型内建函数
1、list.append(obj) 向列表中添加一个对象obj list = ['apple', 'pear', 'orange']>>> list.append('apple')>>> list['apple', 'pear', 'orange', 'apple'] 2、list.count(obj) 返回一个原创 2014-05-10 10:38:26 · 2312 阅读 · 0 评论 -
Python核心编程学习笔记(五)——第二章习题
第二章原创 2014-05-08 13:34:40 · 724 阅读 · 0 评论 -
Python核心编程学习笔记(十三)——第九章习题
9-1原创 2014-05-16 13:07:13 · 1290 阅读 · 0 评论 -
Python核心编程学习笔记(六)
22、yuju原创 2014-05-08 18:02:00 · 708 阅读 · 0 评论 -
Python中常见的文件对象内建函数
文件对象内建方法列表文件对象的方法操作file.close()关闭文件file.fileno()返回文件的描述符(file descriptor,FD,整数值)file.flush()刷新文件的内部缓冲区file.isatty()判断fil原创 2014-05-16 10:42:56 · 1395 阅读 · 0 评论 -
Python核心编程学习笔记(十)——第七章习题
未完待续。。。原创 2014-05-15 22:44:36 · 1180 阅读 · 0 评论 -
Using Lists as Stacks in Python----在Python中把链表当作堆栈使用
The list methods make it very easy to use a list as a stack, where the last element added is thefirst element retrieved (``last-in, first-out''). To add an item to the top of the stack, useappend(原创 2014-05-03 21:15:45 · 706 阅读 · 0 评论 -
More on Lists in Python----深入Python列表
此文档为Python2.7自带文档内容。原创 2014-05-03 17:44:21 · 603 阅读 · 0 评论 -
Using Lists as Queues in Python----在Python中把链表当作队列使用
此文出自Python2.7自带文档。原创 2014-05-03 21:28:57 · 828 阅读 · 0 评论 -
python中常用的字典内建函数
1、len(mapping) 返回映射的长度(键-值对的个数) 2、hash(obj) 返回obj的哈希值>>> myDict = {'name':'earth', 'port':'80'}>>> len(myDict)2>>> hash('name')15034981 3、dict.copy原创 2014-05-10 17:44:24 · 2913 阅读 · 0 评论 -
Python核心编程学习笔记(一)
把一个字符串原创 2014-05-07 09:16:14 · 1249 阅读 · 1 评论 -
Python中常见的集合内建函数
一、集合类型方法方法名称操作s.issubset(t)如果s是t的子集,则返回True,否则返回Falses.issuperset(t)如果s是t的超集,则返回True,否则返回Falses.union(t)返回一个新集合,该集合是s和t的并集s.intersection(t)返回一个新集合,该集合原创 2014-05-15 22:43:26 · 1681 阅读 · 0 评论 -
Python中常用的字符串内建函数
1、string.capitalize() 把字符串的第一个字符大写。>>> myString = "hello world, hello everyone!">>> myString.capitalize()'Hello world, hello everyone!' 2、string.center(width) 返回一个原创 2014-05-09 23:59:51 · 2494 阅读 · 0 评论 -
Sublime text 设置Tab为4个空格
Preferences,Settings-Defalut, Settings - User【将Tab键自动替换为4个空格】// The number of spaces a tab is considered equal to“tab_size”: 4,// Set to true to insert spaces when tab is pressed“translate_tabs_原创 2014-09-28 19:50:58 · 1792 阅读 · 0 评论