473,609 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Codig style: " or """

Hi!

Suppose you're writing a module & writing the
definition of each function in that module in " or
""".
for example:
a) "This function does this & that"
or:
b) """This function does blah blah blah"""

What are the differences between " and """ ?
I'm using gedit & I wanna know a bit about coding
style.

To be very honest: I have a very strict boss who looks
for bugs in my codes & he insists to know exactly
which 'CODING STYLE AUTHORITATIVE SOURCE' I've based
my coding style on when using " or """.

Can anybody out there give me some hint?
Can anybody tell me where to find a document on python
coding style.

tnx,
Sara

_______________ _______________ ____
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
Jul 18 '05 #1
3 1570
Sara Khalatbari <sa************ @yahoo.com> wrote:
What are the differences between " and """ ?
The triple-quote form lets you write multi-line quoted strings:

"""This function does a lot of neat stuff. It takes
many lines of text to describe what it does.

Multiple paragraphs, even.
"""
To be very honest: I have a very strict boss who looks
for bugs in my codes & he insists to know exactly
which 'CODING STYLE AUTHORITATIVE SOURCE' I've based
my coding style on when using " or """.


Show him PEP-8 (http://www.python.org/peps/pep-0008.html). PEP-8, in
turn, references a few other style PEPs. If adopting them wholesale
as authoritative is all you need to keep your PHB happy, go for it.
Jul 18 '05 #2
Sara Khalatbari wrote:
Hi!

Suppose you're writing a module & writing the
definition of each function in that module in " or
""".
for example:
a) "This function does this & that"
or:
b) """This function does blah blah blah"""

What are the differences between " and """ ?
I'm using gedit & I wanna know a bit about coding
style.

To be very honest: I have a very strict boss who looks
for bugs in my codes & he insists to know exactly
which 'CODING STYLE AUTHORITATIVE SOURCE' I've based
my coding style on when using " or """.

Can anybody out there give me some hint?
Can anybody tell me where to find a document on python
coding style.


Triple quotes allow you to have quotes inside the string. I tend to use
triple quotes if I'm writing text of any length, that way I dont need to
change anything if I do need to insert a quote. I dont think its a
matter of coding style, its purely a practical issue. If your PHB
insists on consistency, I would just use """
Will McGugan

--
http://www.willmcgugan.com
"".join( [ {'*':'@','^':'. '}.get(c,None) or chr(97+(ord(c)-84)%26) for c
in "jvyy*jvyyzptht na^pbz" ] )
Jul 18 '05 #3
Sara Khalatbari wrote:
Hi!

Suppose you're writing a module & writing the
definition of each function in that module in " or
""".
for example:
a) "This function does this & that"
or:
b) """This function does blah blah blah"""

What are the differences between " and """ ?
I'm using gedit & I wanna know a bit about coding
style.

To be very honest: I have a very strict boss who looks
for bugs in my codes & he insists to know exactly
which 'CODING STYLE AUTHORITATIVE SOURCE' I've based
my coding style on when using " or """.

Can anybody out there give me some hint?
Can anybody tell me where to find a document on python
coding style.


PEP 8:

http://www.python.org/peps/pep-0008.html

and for docstrings, PEP 257:

http://www.python.org/peps/pep-0257.html

which says:

For consistency, always use """triple double quotes""" around docstrings.

STeVe
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
40699
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div style="display:none"> can be displayed by setting the style attribute to "display:", or hidden with "display:none". This gives the illusion that the person filling out the form is switching from page to page...without the overhead of extra hits on the server,...
1
686
by: Markus Elfring | last post by:
How much are you interested that the attribute "style" will offer the same or similar capabilities like they are provided by the element "style" in the element "head"? Do you want that the document "Syntax of CSS rules in HTML's "style" attribute" (http://www.w3.org/TR/css-style-attr) will become an official recommendation in the near future? Best regards, Markus Elfring
4
4661
by: mike | last post by:
regards: <a href="JavaScript:loadwindow(106,90);" style="font-family:Verdana;">元智Intranet</a> In HTML spec,are "href" and "style" called "attribute"?....@@ Could someone good give me the hand? @@. thank you may god be with you
5
17684
by: johnsuth | last post by:
I want to produce a trivial demonstration of dynamic modification. I thought that pressing a button might change its color. I studied O'Reillys books and successfully created the button with a fancy style, but the onclick fails to do anything no matter what permutation of parameters I try. <input type=button style=background-color:yellow;color:blue;font-family:Arial;font-style:italic;font-weight:bold name="xyz" value="CHANGE COLOUR"...
5
5481
by: Tobin Fricke | last post by:
In posting to a blog, I would like to bold every list item (<li>). Because I cannot influence the <head>...</head> section of the HTML document, I can neither add a <style>...</style> block, nor reference an external style sheet. Is there a way to accomplish this using the "style" attribute and/or using div or span tags? I want to do something like this: <!-- desired application of css !--> <div style="li {font-weight: bold;}">
2
5153
by: SAL | last post by:
I have the following line of code in my Page_Load Event of my ASP.net page: txtExplanationofChange.Attributes.Add ("style","overflow :hidden"); which allows me to can turn off the Scrollbar of my multiline textbox. I am still fairly new to developing in ASP.net and C#, and I'm not sure if there is a better way to disable the scrollbar. The code above turns off the scrollbar just fine, however the textbox does not remain in the location...
0
2639
by: =?Utf-8?B?QXR1bA==?= | last post by:
When .Net 1.0 webservice (VS2003) generates a wsdl - <wsdl:binding name="TestSoap" type="tns:TestSoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/(note: style attribute present) <wsdl:operation name="HelloWorld"> <soap:operation soapAction="http://tempuri.org/HelloWorld" style="document" /> But when .Net 2.0 webservice (VS2005) generates a wsdl -
2
8678
by: Steve Richter | last post by:
I would like to use display:inline and other CSS attributes to build an entry form. Where the heading to the left of the text box is always a set width. It is not working so I am experimenting with two divs to get them to render side by side: <div style="width:12em;border: 2px solid #EFCE8C; padding: 0.5em;display:inline;">abc</div> <div style="width:12em;border: 2px solid #EFCE8C; padding:
1
6431
by: msg2ajay | last post by:
hi, i am working on <div> i have to hide some part of the table. I am not able to hide that table part can anybady tell me where is the error. <html> <head> <script type="text/javascript"> function callme(){ document.getElementById("hid").style.visibility="visible"; }
0
8067
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8567
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8527
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8215
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5509
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.