Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
disable a block of code
#1
while doing some initial testing, i want to disable a block of code. many other languages have a specific comment start and end symbol. but Python doesn't.

can i achieve this by adding a line with ''' before and after the code to be disabled as long as the indentation resumes at the same depth? i tried and it works. but i don't what pitfalls there are, besides some other existing use of '''.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
disable a block of code - by Skaperen - Aug-18-2018, 04:10 AM
RE: disable a block of code - by micseydel - Aug-18-2018, 05:14 AM
RE: disable a block of code - by Gribouillis - Aug-18-2018, 05:23 AM
RE: disable a block of code - by Skaperen - Aug-19-2018, 11:18 PM
RE: disable a block of code - by metulburr - Aug-20-2018, 02:03 AM
RE: disable a block of code - by Skaperen - Aug-20-2018, 07:55 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python multiple try except block in my code -- can we shorten code mg24 10 6,939 Nov-10-2022, 12:48 PM
Last Post: DeaD_EyE
  Errors when trying to disable tkinter checkbutton rrick_88 7 3,180 Feb-17-2022, 10:30 PM
Last Post: deanhystad
  "If Len(Word) == 0" Code Block in Pig Latin Program new_coder_231013 3 2,224 Jan-02-2022, 06:03 PM
Last Post: deanhystad
  Try,Except,Else to check that user has entered either y or n (Code block pasted) RandomNameGenerator 3 2,447 Jun-29-2021, 08:21 PM
Last Post: RandomNameGenerator
  Block of code, scope of variables and surprising exception arbiel 8 3,670 Apr-06-2020, 07:57 PM
Last Post: arbiel
  zlib decompress error: invalid code lengths set / invalid block type DreamingInsanity 0 7,088 Mar-29-2020, 12:44 PM
Last Post: DreamingInsanity
  an easy way to disable exception handling Skaperen 6 5,733 Jun-02-2019, 10:38 PM
Last Post: Gribouillis
  Use a block of code only one time rlinux57 14 6,559 Sep-21-2018, 12:53 PM
Last Post: rlinux57
  gnureadline: disable temporarily? klaymen 1 2,610 May-08-2018, 11:16 AM
Last Post: Larz60+
  Repeating a block of code owdcoder 8 5,882 Jul-14-2017, 03:37 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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