Posting Source Code on WordPress

backtick backtick backtick python
def example_func():
 """This is an example_func inside
 backtick backtick backtick python
 l_squareBracket /code r_squareBracket
 language can = "python" or "html" or ???
backtick backtick backtick

See also


#markdown, #quicktags, #shortcodes, #wordpress

Documenting Python Function Arguments for use with Eclipse

Here’s a method that pretty much WORKED to document Python function Arguments for use with Eclipse. It is based on A Guide to NumPy/SciPy Documentation.

Here’s a sample.

def chordAscore(score, startMeasureNum, endMeasureNum, sharpFlatNonePref, stripOctaveInfo):
    """Returns a string of the chordnames for an excerpt from a Music21 score.

    score :
        the Music21 score.
    startMeasureNum : int [1-Number of Measures in the Music21 score.]
        start Measure Number of the excerpt.
    endMeasureNum : int [1-Number of Measures in the Music21 score.]
        end Measure Number of the excerpt.
    sharpFlatNonePref : string
        ['sharp':PreferSharp, 'flat':PreferSharp, 'none':PreferNeitherSharpNorFlat] Chordnames.
    stripOctaveInfo : boolean
        True: strips the octave information, False: does NOT strip the octave information

#documentation, #python