Python Forum
How to add multi-line comment section?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to add multi-line comment section?
#1
Edit (since this forum doesn't support deleting a thread): My mistake. After using the (shift+)TAB keys, the script runs. Guess there were useless TAB characters.

-----------------

Hello,

Is there a way to add a multi-line comment block that keeps Python happy?

import glob

for item in glob.glob("*.txt"):
	print(f"**************** Handling {item}")

	name = True
	if name:
		print("True1")
	else:
		print("False1")

  #=========== blah
  """ IndentationError: unindent does not match any outer indentation level
  some
  comment
  """
	if name:
		print("True2")
	else:
		print("False2")
Note: Unlike displayed above, in the source code, the block is at the same level as the two "if name" lines.

Thank you.
Reply


Messages In This Thread
How to add multi-line comment section? - by Winfried - Mar-24-2024, 01:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Information Is it possible to multi line a Basic Function Construct line statement? If so how? BrandonKastning 7 391 May-23-2024, 03:02 PM
Last Post: deanhystad
Question remove all comment ? SpongeB0B 7 1,661 Oct-27-2023, 05:40 PM
Last Post: deanhystad
  Regular Expression search to comment lines of code Gman2233 5 1,788 Sep-08-2022, 06:57 AM
Last Post: ndc85430
  regex multi-line kucingkembar 6 1,697 Aug-27-2022, 10:27 PM
Last Post: kucingkembar
  Append data to Yaml section tbaror 0 7,169 Feb-09-2022, 06:56 PM
Last Post: tbaror
  multi-line CMD in one-line python kucingkembar 5 4,225 Jan-01-2022, 12:45 PM
Last Post: kucingkembar
  Multi-line console input lizze 4 2,495 Dec-26-2020, 08:10 AM
Last Post: lizze
  Block comment in Intellij kam_uk 2 2,388 Nov-15-2020, 05:22 PM
Last Post: kam_uk
  Python 3 Elementtree and Comment First gw1500se 3 3,892 May-25-2020, 09:02 PM
Last Post: gw1500se
  Youtube Comment bot mateusz135 4 86,943 Mar-14-2020, 04:18 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020