About 26,100 results
Open links in new tab
  1. How to write an inline-comment in Python - Stack Overflow

    Dec 15, 2019 · No, there are no inline comments in Python. From the documentation: A comment starts with a hash character (#) that is not part of a string literal, and ends at the end of the physical line. A …

  2. python - Proper use of comments - Stack Overflow

    Sep 23, 2017 · Inline-comments = Explanation of why the code is written the way it is written. See the requests library for a great example of a project that uses comments appropriately. When to use Doc …

  3. syntax - Mid-line comment in Python? - Stack Overflow

    Mar 6, 2015 · I'm wondering if there is any way to comment out part of a line, like you can do in c++ with /*this*/. The only comments I know about are # this which always goes to the end of the line and the ""...

  4. How do I create multiline comments in Python? - Stack Overflow

    111 Python does have a multiline string/comment syntax in the sense that unless used as docstrings, multiline strings generate no bytecode -- just like # -prepended comments. In effect, it acts exactly …

  5. How to wrap and align comments in Python code? - Stack Overflow

    And, quoting Inline Comments in PEP 8: Use inline comments sparingly. An inline comment is a comment on the same line as a statement. This is the very beginning of the style guide for inline …

  6. python - How to tell flake8 to ignore comments - Stack Overflow

    Using an inline comment # noqa: E501 should ignore this issue for you. If you have a multi-line comment, you can ignore inline at the end of the multi-line string like so:

  7. python - Inline comments for ConfigParser - Stack Overflow

    Feb 29, 2012 · The current Python 3.5.2 ConfigParser documentation mentions a customization capability for this. [You can use comments] # like this ; or this # By default only in an empty line. # …

  8. Space between line-comment character(s) and start of actual comment

    Sep 24, 2016 · Python's official style guide, PEP 8, is very clear about this issue: Each line of a block comment starts with a # and a single space (unless it is indented text inside the comment). and: …

  9. How to "comment-out" (add comment) in a batch/cmd?

    I have a batch file that runs several python scripts that do table modifications. I want to have users comment out the 1-2 python scripts that they don't want to run, rather than removing them fr...

  10. python - Writing comments to files with ConfigParser - Stack Overflow

    Jul 8, 2011 · How can one write comments to a given file within sections? If I have: import ConfigParser with open('./config.ini', 'w') as f: conf = ConfigParser.ConfigParser() conf.set('DEFAULT', 'tes...