python 代码片段9
2016-01-03 22:29
573 查看
#coding=utf-8 # 字符串指示符号 r表示raw u表示unicode mystring=u'this is unicode!--by' print mystring # 'raw'表示告诉解释器不要转换字符串任何字符 file=r'c:\temp\folder\robots.txt' print file # 另一个实用raw的地方是正则表达式 # 可以在'''内放任何的字符串,不需要转义,比如xml s='dongshen' print '%s is number %d' %(s[:6],1) hi='''hi there ''' print hi
相关文章推荐
- python 代码片段8
- convenient functions in numpy
- python第三方库推荐 - 通过ntplib在windows上同步时间
- Python copy a list
- Python---面向对象装饰器
- python项目之 ftp服务器
- Python 递归 list不正确
- Python------异常处理
- MCMC(Markov Chain Monte Carlo)的理解与实践(Python)
- python环境安装和在eclipse中插件的使用
- Python---IO的使用
- 第2章 Python基础语法 -- 数据类型
- 【Python千问 2】Python核心编程(第二版)-- 欢迎来到Python世界
- python运维开发坎坷之路-01
- 【Python千问 1】Python核心编程(第二版)导读
- python对json的相关操作
- Install python opencv on mac
- Python两种列表翻转方法的效率比较
- python学习笔记-Day10--(twisted)
- python学习笔记-Day10--(进程\线程\协程)