作者:LAMP小白  点击:1724  发布日期:2013-10-22 00:33:20  返回列表

#!/usr/bin/python

#coding:utf8

import textwrap

str="""

Return a list of the words in the string, using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done (thus, the list will have at most maxsplit+1 elements). If maxsplit is not specified or -1, then there is no limit on the number of splits (all possible splits are made).

If sep is given, consecutive delimiters are not grouped together and are deemed to delimit empty strings (for example, '1,,2'.split(',') returns ['1', '', '2']). The sep argument may consist of multiple characters (for example, '1<>2<>3'.split('<>') returns ['1', '2', '3']). Splitting an empty string with a specified separator returns [''].

If sep is not specified or is None, a different splitting algorithm is applied: runs of consecutive whitespace are regarded as a single separator, and the result will contain no empty strings at the start or end if the string has leading or trailing whitespace. Consequently, splitting an empty string or a string consisting of just whitespace with a None separator returns [].

"""

str = textwrap.dedent(str)

print "this text is: n %s" % textwrap.fill(str, width=60)

上一篇:python模板引擎

下一篇:快递查询API

0

python 匹配段落_python格式化段落相关推荐

  1. python时间格式_python 格式化日期

    常用的时间函数如下 获取当前日期:time.time() 获取元组形式的时间戳:time.local(time.time()) 格式化日期的函数(基于元组的形式进行格式化): (1)time.asct ...

  2. python成绩转换_Python格式化输出%与format能不能互相转换?

    使用format可以实现%的所有功能,%只能按照固定的顺序去格式化字符串,而format使用起来会更灵活一些,下面对两者的功能做一个对比. 字符串格式化功能: 如果使用%,每个%只匹配一个参数,而且只 ...

  3. python美化输出模块_Python 格式化输出 ( 颜色 )

    In [1]: from termcolor import colored # 只导入这一个方法,因为别的用不到 In [2]: colored??# 查看支持哪些参数,当然下面还有程序提供的示例,这 ...

  4. python表格对齐_python 格式化输出 列表对齐左对齐右对齐

    原博文 2020-10-14 09:30 − python对齐输出 https://www.cnblogs.com/nul1/p/11136495.html python - 输出列表自动对齐(支持中 ...

  5. python strftime函数_Python 格式化输出时间字符串函数 strftime

    strftime()函数将时间格式化 我们可以使用strftime()函数将时间格式化为我们想要的格式.它的原型如下: size_t strftime( char *strDest, size_t m ...

  6. python转化为字符串格式_Python格式化字符串~转

    在编写程序的过程中,经常需要进行格式化输出,每次用每次查.干脆就在这里整理一下,以便索引. 格式化操作符(%) "%"是Python风格的字符串格式化操作符,非常类似C语言里的pr ...

  7. python输出举例_python字符串格式化输出及相关操作代码举例

    字符串的格式化 Python 支持格式化字符串的输出 .尽管这样可能会用到非常复杂的表达式,但最基本的用法是将一个值插入到一个有字符串格式符 %s 的字符串中.在   Python 中,字符串格式化使 ...

  8. python strftime模块_python datetime模块用strftime 格式化时间

    datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") datetime.datetime.now().strftime(&qu ...

  9. python实现括号匹配代码_python实现括号匹配的思路详解

    1.用一个栈[python中可以用List]就可以解决,时间和空间复杂度都是O(n) # -*- coding: utf8 -*- # 符号表 SYMBOLS = {'}': '{', ']': '[ ...

最新文章

  1. 数组对称_对称性应用在物理中的几个小例子
  2. 接私活渠道,你有技术,就有钱!
  3. vault-使用kubernetes作为认证后端
  4. 必然之势:从结构、时间、媒介的角度看信息的发展趋势
  5. Centos6.5_x86_64 编译安装Subversion-1.8.5
  6. 解决通过 Visual Studio 打不开 ui 文件的问题
  7. 剑指offer之反向打印链表值
  8. [GAN学习系列2] GAN的起源
  9. node 连接mongodb
  10. Android 系统(260)---Android 读取SIM卡参数
  11. 冷热分离和直接使用大数据库_【TBase开源版测评】深度测评TBase的shard分片和冷热分离存储特性...
  12. 用Python读写Word文档入门
  13. 信息安全快讯丨一起为亚运健儿加油!
  14. xpwifi热点设置android,WinXP笔记本设置WiFi热点的方法
  15. 【Unity3D游戏开发】之游戏目录结构之最佳实践和优化 (十一)
  16. ios html调用相册,ios html标签调用相册
  17. Check list of writing
  18. 【自学51单片机】3 -- 硬件基础知识(电容、三极管、74HC245、74HC138三八译码器)介绍和闪烁LED小灯
  19. centos mysql安装包_Centos7下安装包方式安装MySQL
  20. 语法分析器(syntax analyzer)【Perl实现】

热门文章

  1. [从架构到设计]第一回:设计,应该多一点
  2. Centos7(Ubuntu)密码登录失败锁定设置(亲测)
  3. CentOS下MFS分布式文件系统搭建
  4. Linux安全运维进阶:SSH常见配置
  5. 教你在Zabbix环境下快速升级nginx版本!
  6. 网络故障处理手册大全
  7. VBA实现数据库中的字段处理(下划线去掉,后面的字母变大写)之版本1.0。
  8. 苹果审核之遇到IPV6问题被拒的解决方法
  9. 解决java中对URL编码的问题
  10. SSM 生成mapper中xml文件:未能解析映射资源:“文件嵌套异常