compiler/interpreter ,how to detect comment in source code ?

A forum for general discussion of the Python programming language.

compiler/interpreter ,how to detect comment in source code ?

Postby vijaykumbhani » Wed Sep 04, 2013 5:55 am

compiler/interpreter , how to detect comment in source code file,
any language
[b][i]With Regards,
Vijay Kumbhani[/i][/b]
vijaykumbhani
 
Posts: 33
Joined: Wed Aug 14, 2013 4:26 am
Location: Surat, Gujarat, India

Re: compiler/interpreter ,how to detect comment in source co

Postby stranac » Wed Sep 04, 2013 12:34 pm

WTF?
Learn how to ask questions.
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1212
Joined: Thu Feb 07, 2013 3:42 pm

Re: compiler/interpreter ,how to detect comment in source co

Postby micseydel » Wed Sep 04, 2013 4:23 pm

stranac wrote:WTF?
Learn how to ask questions.

+1
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1441
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: compiler/interpreter ,how to detect comment in source co

Postby metulburr » Wed Sep 04, 2013 8:56 pm

New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1507
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: compiler/interpreter ,how to detect comment in source co

Postby XndrK » Fri Sep 06, 2013 6:55 pm

What do you mean by "detect comment"?
Proverbs 26:14 describes me a bit too well.

Version: Python 2.7.5

https://github.com/4of92000
https://github.com/PythonForum/
User avatar
XndrK
 
Posts: 172
Joined: Sat Jun 15, 2013 7:57 pm

Re: compiler/interpreter ,how to detect comment in source co

Postby vijaykumbhani » Tue Sep 10, 2013 6:11 am

do you know any programming language supported single line comment and multiple line comment ?
i discuss about this comment
[b][i]With Regards,
Vijay Kumbhani[/i][/b]
vijaykumbhani
 
Posts: 33
Joined: Wed Aug 14, 2013 4:26 am
Location: Surat, Gujarat, India

Re: compiler/interpreter ,how to detect comment in source co

Postby XndrK » Fri Sep 13, 2013 8:46 pm

Are you trying to learn how to insert comments or read them?

If it's insert, it's like this.

Code: Select all
"""Multi-line comment or docstring
    like this"""

#single line comment


That's for Python, of course.

If you're trying to read the docstrings, you do it like this:

Code: Select all
def doc():
    """Documentation time!"""
    pass

print doc.__doc__


You can do this in the interpreter or just run it all at once.

Hope this helped.
Proverbs 26:14 describes me a bit too well.

Version: Python 2.7.5

https://github.com/4of92000
https://github.com/PythonForum/
User avatar
XndrK
 
Posts: 172
Joined: Sat Jun 15, 2013 7:57 pm


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 5 guests