About 22,300 results
Open links in new tab
  1. Is it possible to hide your code comments? : r/learnpython - Reddit

    Jul 31, 2022 · You only comment on code that is not obvious, or have specific requirements/functionality. For example, you don't need to comment on a function with the name getCurrentDate() as that should be obvious from the name.

  2. Deactivate code in python without changing indentation or adding comments

    Jan 29, 2016 · Is there a way to deactivate (temporarily) long code snippets without having to comment every line or putting an if FALSE: and indenting every line? As an example, say I have the code for A in range(1,LargeNumber): DoSuff(A) ###DO Mode stuff ###....

  3. Avoid over-commenting in Python - Python Morsels

    Feb 12, 2025 · Comments that describe what code does can often be refactored away if code is rewritten to clarify its purpose. Comments that describe why code operates a certain way are usually much more helpful. What code does and even how it does what it does can usually be inferred by reading the code.

  4. How to hide/unhide comments with Microsoft VSCode?

    Dec 1, 2023 · According to this reference page you can use Ctrl+K Ctrl+/ to fold all block comments. Doesn't seem to work for Python docstrings. You can download from inside Visual Studio 2022 called unobtrusive code and it will hide all comments and put "+" symbols on the collapsed line to the left of your code that you can open or close them with.

  5. Hiding Python Notes in VSCode: Reddit Tips & Tricks - Toxigon

    Apr 10, 2025 · Using Code Folding. One of the easiest ways to hide notes in VSCode is by using code folding. This feature lets you collapse sections of your code, including comments and notes. Here's how you can do it:

  6. (How) can I automatically hide all comments in PyCharm? Or, is …

    Feb 5, 2017 · I know in PyCharm you can hide blocks folding them into one line, but I want to automatically hide all lines of comments in a file, even a single line, and even comments made at the end along a line of code... For ex: if char == aStr[guessMidPos]: return True # We found it!

  7. Writing Comments in Python (Guide) – Real Python

    In this tutorial, you’ll cover some of the basics of writing comments in Python. You’ll learn how to write comments that are clean and concise, and when you might not need to write any comments at all. You’ll also learn: Why it’s so important to comment your code; Best practices for writing comments in Python

  8. Strip comments from python code - Pybites Platform

    In this Bite you will strip off all comments from some Python source code. Complete strip_comments that takes some multiline code string and strip out: Single line comments = lines that start with #. PEP8-compliant inline comments, so code followed by 2 …

  9. Mastering Comment Blocking in Python: A Comprehensive Guide

    Apr 22, 2025 · Fundamental Concepts of Block Comments in Python; Usage Methods. Using Triple - Quote Strings for Block Comments; Temporary Code Disabling with Block Comments; Common Practices. Documenting Complex Code Sections; Providing Context for Functionality; Best Practices. Maintaining Consistency; Avoiding Over - …

  10. Python Comment Out: A Comprehensive Guide - CodeRivers

    Mar 3, 2025 · Commenting out parts of your code allows you to temporarily disable certain lines or blocks of code, which can be extremely useful during debugging, code development, and sharing code with others.

  11. Some results have been removed
Refresh