Strings inside of comments - string

I noticed that when I place quotations around something in a comment line, the words in quotations change color to indicate that the interpreter sees them as a string. I found this confusing because I thought that the interpreter was supposed to ignore comments. I am curious to know if I did something wrong. The code is below.
# The output of the concatenation above would be:
# 'spameggs'
'spameggs' changes color even though it is part of a comment line.

Its showing me as comment ,No change of color of the text you are mentioning,which editor are you using .Seems like some editor problem.Try to open it in IDLE.IT will be all red color.
Thanks

It is a bug in Qpython3 for android. In Liclipse this worked fine, and remained as a comment.

Related

How to transform lines of code into a comment in Python3

just wondering how to convert a set of code into comments, without having to go through each individual line of code and put a # at the beginning. Was thinking that maybe there was a quick way to highlight the code and then convert it into comment, atm i'm just cutting it off the code and then re-pasting it in later on.
Much appreciated :)
P.S. i m using Pycharm as my IDE
In jupyter notebook, we select lines of code and press ctrl and / key simultaneously to convert a set of code into comments. Also same for vice versa.
You can try it in Pycharm.
You can use the (""") symbol before and after the text you want to comment out. It is not exactly a comment and more of a text constant, but either way it is often used for documentation, so you can use it for multiline comments except for some cases when it causes unexpected errors
To avoid such cases you could simply use multiple single line comments by selecting the desired lines and using ctrl+/ to comment them out

Changing one word's color in Linux terminal/Putty?

Do you think there is a way of changing a specific word's color on the Linux terminal or on Putty?
I'm using the "make" command though terminal (and putty sometimes), and I just thought of how nice it would be if among all the warnings, the printed line containing the "error:" would be in red/marked somehow.
It doesn't really matter, because I guess the solution would be somehow terminal recognizing a specific word related, but just for clarafication - I'm compiling a makefile of C/Assembly code.
There is off course the solution of not printing the warnings at all, but I want to see the warnings.
Thanks,
Barak.
See the ANSI terminal escape sequences. Most terminals implement them.
For example, to display a word in red:
The word at the end is in <Esc>[31m red <Esc>[30m .
I have inserted some spaces for clarity, which should be removed.
Unfortunately, this assumes that the foreground color is initially black. If the text is originally white on a black background, this will make subsequent text seem to disappear. (I say seem because it is there and can be viewed by selecting the text.)

Mediawiki/wikipedia text format issue

so i got an issue with text formatting and i have no idea how this problem is called or what i should search after, so i thought i try to explain it here.
It's literally nothing dramatic or should take long, i simply want to write stuff like
''italic'' or '''bold'''
without that it actually gets italic or bold... i literally want
''italic''
to be displayed. I've also tried to use code blocks but even within the blocks it writes italic then.. i'm sure there is a <..> command but i simply can not find it
Does anyone know?
try this:
<nowiki>''italic''</nowiki>

Easy way to colour ALL user input in terminal?

I know that there is lots of info for colouring the output of certain commands, but I want to have a specific colour for everything I write into the Mac terminal.
It would allow me to have a special colour for everything I input - not the output, just the code I personally input - making it easy to scan the code to where the last command was. I want to find a way to do it without having to write a colour alias for every single command - A way that by default will implement a unique colour for everything I write in the terminal.
Thanks for your help.
I have now sorted this...
Open your ~/.bash_profile in whatever editor you prefer.
Add the following code:
export PS1="\e[0;32m[\u#\h \W]\$ \e[m"
and save.
You will now see that your command prompt is coloured green, and it's super easy to find yourself in the terminal :)
Hope that's helpful for anyone trying to fix the same problem!
P.S> These instructions cover more than just the colour in the terminal... They also control what it shown in your command prompt. I'm afraid that it will need someone way more advanced at coding than me to decipher which bit refers to what... Sorry!

Vim - Emphasis words or lines permanently

Is there a possibility to emphasis text passages, words s or single lines in a file permanently?
I'm thinking of something similar to the function in Word where you can emphasis your text selection by changing the background colour.
This would be helpful since I sometimes have code or text that I want to review later. Having a annotation command could come in quite handy.
Regards
This vim plugin does exactly what you want! The screenshots seem encouraging enough to try it out.

Resources