Python does not have such a mechanism. Prepend a #
to each line to block comment. For more information see PEP 8. Most Python IDEs support a mechanism to do the block-commenting-with-pound-signs automatically for you. For example, in IDLE on my machine, it’s Alt+3 and Alt+4.
Don’t use triple-quotes; as you discovered, this is for documentation strings not block comments, although it has a similar effect. If you’re just commenting things out temporarily, this is fine as a temporary measure.
Related Posts:
- What are the most common Python docstring formats?
- How do I disable “missing docstring” warnings at a file-level in Pylint?
- print(__doc__) in Python 3 script
- TypeError: ‘int’ object is not callable
- What exactly does numpy.exp() do? [closed]
- TypeError: ‘int’ object is not callable
- Is a Python dictionary an example of a hash table?
- Why does this iterative list-growing code give IndexError: list assignment index out of range?
- Modifing data while using iterrows() does not work
- difference between command prompt and anaconda prompt
- Do I understand os.walk right?
- Converting dictionary to JSON
- Saving and loading objects and using pickle
- numpy: Invalid value encountered in true_divide
- Invalid character in identifier
- What does ** (double star/asterisk) and * (star/asterisk) do for parameters?
- Conda uninstall one package and one package only
- Cannot find module cv2 when using OpenCV
- Getting TypeError: __init__() missing 1 required positional argument: ‘on_delete’ when trying to add parent table after child table with entries
- TypeError: list indices must be integers, not str (boolean convertion actually)
- ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL’s are there
- Pandas “Can only compare identically-labeled DataFrame objects” error
- ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL’s are there
- SyntaxError: multiple statements found while compiling a single statement
- How can I remove a trailing newline?
- Pycharm exit code 0
- How do you split a string in Python with multiple delimiters?
- syntaxError: ‘continue’ not properly in loop
- ValueError: all the input arrays must have same number of dimensions
- Get the data received in a Flask request
- Python function execution
- Python TypeError: cannot convert the series to
when trying to do math on dataframe - How do I do a case-insensitive string comparison?
- How to fix ‘ValueError: list.remove(x): x not in list’ error in Python
- How can I convert radians to degrees with Python?
- How to initialize a two-dimensional array in Python?
- IndexError: index 1 is out of bounds for axis 0 with size 1/ForwardEuler
- selenium – chromedriver executable needs to be in PATH
- TypeError: tuple indices must be integers, not str
- (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: truncated \UXXXXXXXX escape
- TypeError(“‘bool’ object is not iterable”,) when trying to return a Boolean
- Flask Template Not found
- Making a collatz program automate the boring stuff
- Implementing an efficient queue in Python
- Modify the legend of pandas bar plot
- Python int to binary string?
- Full examples of using pySerial package
- Checking whether a variable is an integer or not
- Using headers with the Python requests library’s get method
- How to measure elapsed time in Python?
- Issues using Keras np_utils.to_categorical
- Flask ImportError: No Module Named Flask
- Running an outside program (executable) in Python?
- UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\xa0′ in position 20: ordinal not in range(128)
- How to install PyQt5 on Windows?
- How do I get the day of week given a date?
- TypeError: ‘dict_keys’ object does not support indexing
- Add Variables to Tuple
- What does socket binding mean?
- How to strip all whitespace from string
- Python Binomial Coefficient
- Pandas – How to flatten a hierarchical index in columns
- What is the difference between json.load() and json.loads() functions
- Viewing all defined variables
- Difference between two dates in Python
- ImportError: No module named win32com.client
- Python, how to handle the “ValueError: unsupported pickle protocol: 4” error?
- python error: TypeError: an integer is required
- Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
- Get an attribute value based on the name attribute with BeautifulSoup
- getting ValueError : “Can only tuple-index with a MultiIndex “
- ModuleNotFoundError: No module named ‘seaborn’ in Python IDE
- UnicodeEncodeError: ‘charmap’ codec can’t encode characters
- Is there a ceiling equivalent of // operator in Python?
- Groupby value counts on the dataframe pandas
- How to plot an array in python?
- If statement for strings in python?
- How to create a numpy array of all True or all False?
- How to change legend size with matplotlib.pyplot
- An equivalent function to matplotlib.mlab.bivariate_normal
- Float must be a string or a number?
- Play audio with Python
- Inheritance and init method in Python
- TypeError: expected str, bytes or os.PathLike object, not _io.TextIOWrapper
- Replacing Pandas or Numpy Nan with a None to use with MysqlDB
- How do I merge lists in python? [duplicate]
- Releasing memory in Python
- Text progress bar in terminal with block characters
- Generator expression must be parenthesized if not sole argument
- Get a Try statement to loop around until correct value obtained
- Does python have header files like C/C++?
- Making a POST call instead of GET using urllib2
- Extract first and last row of a dataframe in pandas
- Python decoding Unicode is not supported
- TypeError: got multiple values for argument
- How can I recover the return value of a function passed to multiprocessing.Process?
- Python: OSError: [Errno 2] No such file or directory: ”
- bound method Response.json of Response [200]
- TypeError: coercing to Unicode: need string or buffer