SciTE输出面板中Python脚本print()输出变红:特性还是Bug?
Hey there! Let me confirm first: this behavior is totally normal for your version of SciTE, and it's tied to how the editor's output panel handles syntax highlighting for common error/traceback patterns.
Why the Color Change Happens
SciTE's output panel has built-in rules to automatically highlight lines that look like code error messages—think Python tracebacks that include line to indicate where an issue occurred.
Your SciTE 3.6.0 (compiled for GTK+ 3.16.7 in 2015) uses default configuration rules that target lines containing the word line in specific contexts. Here's how it applies to your script:
print(" at data line "): The phrase follows the pattern[some text] line, which matches SciTE's rule for marking potential error lines, so it gets colored red.print(" at line "): Without any characters betweenatandline, the pattern doesn't trigger the error-line highlight rule, so it uses the default black text.print(" at . line "): Similar to the first case, the extra character (.) betweenatandlinemakes it fit the[text] linepattern, triggering the red highlight again.
Under the hood, this is controlled by properties in SciTE's configuration files (like SciTEGlobal.properties). For example, rules like output.error.line define regex patterns to match lines that should be colored red, and your output lines are hitting those regex matches.
This was intentional design in older SciTE versions—its output panel tries to make it easier to spot error lines by highlighting them, even if they're not actual tracebacks.
内容的提问来源于stack exchange,提问作者user7711283

