Reputation: 914
I know that in regular lines it can do this
#print "Comment Line."
and the whole line is a comment
But I want to comment a "define line" in Python.
For example
# -*- coding: utf-8 -*-
I thought it will "comment" the whole line, so the interpreter will ignore it, but it's not what happen. The interpreter refer to it as"regular define
In C if I remember it right it's simple, and it's something like this
//#define Hello Holly
But how can I do that in Python?
Upvotes: 1
Views: 78
Reputation: 280973
There's no such thing as a "define line" in Python. The coding
thing you show is already a comment, but it's a comment with special interpretation.
If you want to prevent a coding
comment from taking effect without removing it, move it down to the third line of the file or lower by inserting blank lines or more comments above it.
Upvotes: 4
Reputation: 434
I think /*
and */
might be block-all comments, but if not, docstrings (triple quotes) are.
Upvotes: -1