![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python学习-总结笔记
且行且忆
这个作者很懒,什么都没留下…
展开
-
python-学习-打印
单引号和双引号: formatter = "%r %r %r %r" print formatter % ( "I had this thing.", "That you could type up right.", "But it didn't sing.", "So I said goodnight." )原创 2014-08-22 11:08:30 · 424 阅读 · 0 评论 -
python学习-错误-多行打印合并成一行
line1 = raw_input("line 1: ") line2 = raw_input("line 2: ") line3 = raw_input("line 3: ") print "I'm going to write these to the file." target.write(line1) target.write("\n") target.write(li原创 2014-08-24 21:24:43 · 3065 阅读 · 0 评论 -
python学习-read和seek
在对文件read之后,一个类似gua原创 2014-08-26 16:49:50 · 815 阅读 · 0 评论 -
python学习-打开文件并读取用一行表示
一般打开文件后读取: input = open(from_file) indata = input.read()原创 2014-08-26 10:30:04 · 794 阅读 · 0 评论 -
python学习-python list中append()与extend()用法
列表是以类的形式实现的。“创建”列表实际上是将一个类实例化。因此,列表有多种方法可以操作。 1. 列表可包含任何数据类型的元素,单个列表中的元素无须全为同一类型。 2. append() 方法向列表的尾部添加一个新的元素。只接受一个参数。 3. extend()方法只接受一个列表作为参数,并将该参数的每个元素都添加到原有的列表中。 *******************原创 2014-08-28 20:18:35 · 443 阅读 · 0 评论 -
在python中调用自己写的方法或函数function
一、在command中调用 1 在终端里先用 cd 指令到指定路径(D盘) 2 切到 python 交互环境下,输入 import myfunc (如果 myfunc.py 是你的文件全名的话) >>> import myfunc 3 输入 myfunc.函数名(参数) 二、在IDE编辑器中调用 import sys sys.原创 2017-06-28 16:40:11 · 6653 阅读 · 0 评论