4
<title>CodeMirror: Python mode</title>
5
<link rel="stylesheet" href="../../lib/codemirror.css">
6
<script src="../../lib/codemirror.js"></script>
7
<script src="python.js"></script>
8
<link rel="stylesheet" href="../../doc/docs.css">
9
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
12
<h1>CodeMirror: Python mode</h1>
14
<div><textarea id="code" name="code">
25
79228162514264337593543950336L
27
79228162514264337593543950336
43
his only begotten\' '''
44
'that whosoever believeth \
55
== != <= >= <> << >> // **
59
() [] {} , : ` = ; @ . # Note that @ and . require the proper context.
60
+= -= *= /= %= &= |= ^=
64
as assert break class continue def del elif else except
65
finally for from global if import lambda pass raise
66
return try while with yield
68
# Python 2 Keywords (otherwise Identifiers)
71
# Python 3 Keywords (otherwise Identifiers)
75
bool classmethod complex dict enumerate float frozenset int list object
76
property reversed set slice staticmethod str super tuple type
78
# Python 2 Types (otherwise Identifiers)
79
basestring buffer file long unicode xrange
81
# Python 3 Types (otherwise Identifiers)
82
bytearray bytes filter map memoryview open range zip
86
from package import ParentClass
92
class ExampleClass(ParentClass):
94
def example(inputStr):
99
def __init__(self, mixin = 'Hello'):
104
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
105
mode: {name: "python",
107
singleLineStringErrors: false},
114
<h2>Configuration Options:</h2>
116
<li>version - 2/3 - The version of Python to recognize. Default is 2.</li>
117
<li>singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.</li>
120
<p><strong>MIME types defined:</strong> <code>text/x-python</code>.</p>