32位python的bug:os.system返回码一直为0
windows上subprocess.Popen的参数close_fds=True与管道不能共存

python多行字符拼接使用小括号

妙音 posted @ 2017年2月02日 21:33 in python with tags 拼接 字符 , 2203 阅读
* 多行字符串拼接使用小括号
 
s = ('select *'
     'from atable'
     'where id=888')
print s, type(s)

#输出
select *from atablewhere id=888 <type 'str'>
 
* python遇到未闭合的小括号,自动将多行拼接为一行,相比三个引号和换行符,这种方式不会把换行符、前导空格当作字符。
 
Avatar_small
Robinjack 说:
2020年12月23日 17:33

Exactly what I was searching for, thank you for posting. where to buy medical masks


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter