Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Multi-Line Comment

Reply
Thread Tools

Multi-Line Comment

 
 
Doug Tolton
Guest
Posts: n/a
 
      08-11-2003
I've been using Python for quite some time now, and I'm a bit stumped.

Does it really not have a multi-line comment? I think I must just be
missing something simple and stupid.

Thanks in advance.

Doug Tolton
 
Reply With Quote
 
 
 
 
Aahz
Guest
Posts: n/a
 
      08-11-2003
In article <>,
Doug Tolton <> wrote:
>
>Does it really not have a multi-line comment? I think I must just be
>missing something simple and stupid.


'''
Most people use triple-quoted strings
for multi-line comments.
'''
--
Aahz () <*> http://www.pythoncraft.com/

This is Python. We don't care much about theory, except where it intersects
with useful practice. --Aahz
 
Reply With Quote
 
 
 
 
Doug Tolton
Guest
Posts: n/a
 
      08-11-2003
On Mon, 11 Aug 2003 14:17:38 -0500, Skip Montanaro <>
wrote:


>Nope, no multi-line comment. The python-mode package which is available for
>Emacs and XEmacs supports commenting a block of text. You can also use
>triple-quoted strings:
>


How do you comment the block of text with Emacs? That is what I'm
using for my code editor.

I was wondering if a triple-quoted string not assigned would work, but
I hadn't got arround to trying it yet.

Doug Tolton
 
Reply With Quote
 
David Bolen
Guest
Posts: n/a
 
      08-11-2003
Doug Tolton <> writes:

> How do you comment the block of text with Emacs? That is what I'm
> using for my code editor.


In Python mode, use C-c # to comment the selected region and C-u C-c #
to uncomment a region. The commenting is done with "##" at the front
of every line in the region, so it normally stands out from actual
comments due to the #-doubling.

-- David
 
Reply With Quote
 
John J. Lee
Guest
Posts: n/a
 
      08-12-2003
Doug Tolton <> writes:
[...]
> How do you comment the block of text with Emacs? That is what I'm
> using for my code editor.


C-c #

I use C-x r k to uncomment (kill-rectangle), but I'm sure there must
be an uncomment-region in there somewhere...


> I was wondering if a triple-quoted string not assigned would work, but
> I hadn't got arround to trying it yet.


The only trouble with TCSs is that emacs gets confused more easily
than with '## ' multiline-comments. And recent CVS python-modes have
had broken docstring fill (still broken, actually, whitespace gets
collapsed sometimes... must file a bug).


John
 
Reply With Quote
 
Isaac To
Guest
Posts: n/a
 
      08-12-2003
>>>>> "John" == John J Lee <> writes:

John> Doug Tolton <> writes: [...]
>> How do you comment the block of text with Emacs? That is what I'm
>> using for my code editor.


John> C-c #

John> I use C-x r k to uncomment (kill-rectangle), but I'm sure there
John> must be an uncomment-region in there somewhere...

Just do C-u C-c #

Regards,
Isaac.
 
Reply With Quote
 
John J. Lee
Guest
Posts: n/a
 
      08-12-2003
Isaac To <> writes:

> >>>>> "John" == John J Lee <> writes:

[...]
> John> I use C-x r k to uncomment (kill-rectangle), but I'm sure there
> John> must be an uncomment-region in there somewhere...
>
> Just do C-u C-c #


D'oh!


John
 
Reply With Quote
 
Christopher Blunck
Guest
Posts: n/a
 
      08-13-2003
On Mon, 11 Aug 2003 14:17:38 -0500, Skip Montanaro wrote:

>
> Doug> I've been using Python for quite some time now, and I'm a bit
> Doug> stumped. Does it really not have a multi-line comment? I think I
> Doug> must just be missing something simple and stupid.
>
> Nope, no multi-line comment. The python-mode package which is available for
> Emacs and XEmacs supports commenting a block of text. You can also use
> triple-quoted strings:


That always stumped me as well. Any idea what the justification for this
was, Skip?


-c

 
Reply With Quote
 
Sean 'Shaleh' Perry
Guest
Posts: n/a
 
      08-13-2003
On Tuesday 12 August 2003 22:07, Christopher Blunck wrote:
> >
> > Nope, no multi-line comment. The python-mode package which is available
> > for Emacs and XEmacs supports commenting a block of text. You can also
> > use triple-quoted strings:

>
> That always stumped me as well. Any idea what the justification for this
> was, Skip?
>


none of the other shell/script languages have one either. I rarely miss it.


 
Reply With Quote
 
Doug Tolton
Guest
Posts: n/a
 
      08-13-2003
On Tue, 12 Aug 2003 23:21:16 -0700, Chad Netzer <>
wrote:

>(along with block indent/dedent with a decent editor)


In emacs what are the key strocks for block indent and dedent?

Man, I wonder if I'll even learn 10% of the Emacs keystrokes.

Doug Tolton
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox extensions comment History Fan Firefox 4 11-17-2005 02:10 AM
Comment about Firefox Bad Dog Firefox 1 10-02-2005 02:49 AM
? ELSE Conditional Comment / Using Conditional Comments Inside Other Tags To Comment Out Attributes Alec S. HTML 10 04-16-2005 02:21 AM
comment faire une d彋ection de niveau haut ou "1" en vhdl ? Arnaud VHDL 2 02-11-2004 06:34 PM
To comment if it's a good style 三人行必有我師 VHDL 6 11-12-2003 08:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57