新手到Python语法错误怀疑使用了单引号/双引号

2024-04-27 21:00:06 发布

您现在位置:Python中文网/ 问答频道 /正文

这是我第一次使用Python,我在尝试运行脚本时收到了附加的消息。在

这是代码(第32行是以“字体”开头的行-大小:。。。“:

# County style
'font-size:12px;fill-rule:nonzero;stroke:#FFFFFF;stroke-opacity:1;
stroke-width:0.1;stroke-miterlimit:4;stroke-dasharray:none;stroke-linecap:butt;
marker-start:none;stroke-linejoin:bevel;fill:'

有什么有用的人能告诉我这里发生了什么事吗?enter image description here


Tags: 代码脚本none消息sizestrokestyle字体
1条回答
网友
1楼 · 发布于 2024-04-27 21:00:06

如果使用多行字符串,则需要三个引号('''或{})。示例:

'''font-size:12px;fill-rule:nonzero;stroke:#FFFFFF;stroke-opacity:1;
stroke-width:0.1;stroke-miterlimit:4;stroke-dasharray:none;stroke-linecap:butt;
marker-start:none;stroke-linejoin:bevel;fill:'''

相关问题 更多 >