#๐ colored words on idle?
34 messages ยท Page 1 of 1 (latest)
@kindred trail
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
it doesnt seem like an error and more like glitched out rendering
does the code run fine?
no it errors out starting at the first colored line, if i backspace and manually type the entire paragraph or section, the color goes away and code runs
if i backspace one letter from colored words, when i complete the word again, color comes back
The text is being considered as Python code by the highlighter. and is colored because that's a keyword, and r's to the end of the line is colored because r' starts a raw string.
how do i resolve this? i have the exact formatting for other text earilier in the code that does not do this, it only happens when i paste from notepad
can you paste your code as text instead of a screenshot
i have 15 or so of these, the first one is ok and i had the other 14 written in a notepad and pasted into IDLE, it creates the wierd colors and errors out
SyntaxError: unterminated string literal (detected at line 37)
i know its messy guys, its still getting worked on!
you likely didn't terminate the string before it
Its terminated
it doesn't look so in the screenshot
you'd have to provide more context to be sure
SyntaxError: unterminated string literal (detected at line 44)
all i did was backspace one letter from each colored word, the error moved down to next lines
no more colored text
no error regarding those lines anymore
the colored text and the syntax error are two different things
the colored text is causing the syntax error
no it isn't
how do you figure? i remove the colored text and the error goes away
the colored text is your IDE trying to highlight python syntax, it probably thinks the text in the string literal is python code as a result of the previous syntax error
i can't be more specific unless you provide your actual code
this actually helped me figure it out
i was forgetting a the 3 "s it needed after the first entry
i have been using python for 4 days, its so much fun
thanks!
np
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.