Edit File by line
/home/barbar84/www/wp-conte.../plugins/wp-file-.../lib/codemirr.../mode/python
File: index.html
<!doctype html>
[0] Fix | Delete
[1] Fix | Delete
<title>CodeMirror: Python mode</title>
[2] Fix | Delete
<meta charset="utf-8"/>
[3] Fix | Delete
<link rel=stylesheet href="../../doc/docs.css">
[4] Fix | Delete
[5] Fix | Delete
<link rel="stylesheet" href="../../lib/codemirror.css">
[6] Fix | Delete
<script src="../../lib/codemirror.js"></script>
[7] Fix | Delete
<script src="../../addon/edit/matchbrackets.js"></script>
[8] Fix | Delete
<script src="python.js"></script>
[9] Fix | Delete
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
[10] Fix | Delete
<div id=nav>
[11] Fix | Delete
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
[12] Fix | Delete
[13] Fix | Delete
<ul>
[14] Fix | Delete
<li><a href="../../index.html">Home</a>
[15] Fix | Delete
<li><a href="../../doc/manual.html">Manual</a>
[16] Fix | Delete
<li><a href="https://github.com/codemirror/codemirror">Code</a>
[17] Fix | Delete
</ul>
[18] Fix | Delete
<ul>
[19] Fix | Delete
<li><a href="../index.html">Language modes</a>
[20] Fix | Delete
<li><a class=active href="#">Python</a>
[21] Fix | Delete
</ul>
[22] Fix | Delete
</div>
[23] Fix | Delete
[24] Fix | Delete
<article>
[25] Fix | Delete
<h2>Python mode</h2>
[26] Fix | Delete
[27] Fix | Delete
<div><textarea id="code" name="code">
[28] Fix | Delete
# Literals
[29] Fix | Delete
1234
[30] Fix | Delete
0.0e101
[31] Fix | Delete
.123
[32] Fix | Delete
0b01010011100
[33] Fix | Delete
0o01234567
[34] Fix | Delete
0x0987654321abcdef
[35] Fix | Delete
7
[36] Fix | Delete
2147483647
[37] Fix | Delete
3L
[38] Fix | Delete
79228162514264337593543950336L
[39] Fix | Delete
0x100000000L
[40] Fix | Delete
79228162514264337593543950336
[41] Fix | Delete
0xdeadbeef
[42] Fix | Delete
3.14j
[43] Fix | Delete
10.j
[44] Fix | Delete
10j
[45] Fix | Delete
.001j
[46] Fix | Delete
1e100j
[47] Fix | Delete
3.14e-10j
[48] Fix | Delete
[49] Fix | Delete
[50] Fix | Delete
# String Literals
[51] Fix | Delete
'For\''
[52] Fix | Delete
"God\""
[53] Fix | Delete
"""so loved
[54] Fix | Delete
the world"""
[55] Fix | Delete
'''that he gave
[56] Fix | Delete
his only begotten\' '''
[57] Fix | Delete
'that whosoever believeth \
[58] Fix | Delete
in him'
[59] Fix | Delete
''
[60] Fix | Delete
[61] Fix | Delete
# Identifiers
[62] Fix | Delete
__a__
[63] Fix | Delete
a.b
[64] Fix | Delete
a.b.c
[65] Fix | Delete
[66] Fix | Delete
#Unicode identifiers on Python3
[67] Fix | Delete
# a = x\ddot
[68] Fix | Delete
a⃗ = ẍ
[69] Fix | Delete
# a = v\dot
[70] Fix | Delete
a⃗ = v̇
[71] Fix | Delete
[72] Fix | Delete
#F\vec = m \cdot a\vec
[73] Fix | Delete
F⃗ = m•a⃗
[74] Fix | Delete
[75] Fix | Delete
# Operators
[76] Fix | Delete
+ - * / % & | ^ ~ < >
[77] Fix | Delete
== != <= >= <> << >> // **
[78] Fix | Delete
and or not in is
[79] Fix | Delete
[80] Fix | Delete
#infix matrix multiplication operator (PEP 465)
[81] Fix | Delete
A @ B
[82] Fix | Delete
[83] Fix | Delete
# Delimiters
[84] Fix | Delete
() [] {} , : ` = ; @ . # Note that @ and . require the proper context on Python 2.
[85] Fix | Delete
+= -= *= /= %= &= |= ^=
[86] Fix | Delete
//= >>= <<= **=
[87] Fix | Delete
[88] Fix | Delete
# Keywords
[89] Fix | Delete
as assert break class continue def del elif else except
[90] Fix | Delete
finally for from global if import lambda pass raise
[91] Fix | Delete
return try while with yield
[92] Fix | Delete
[93] Fix | Delete
# Python 2 Keywords (otherwise Identifiers)
[94] Fix | Delete
exec print
[95] Fix | Delete
[96] Fix | Delete
# Python 3 Keywords (otherwise Identifiers)
[97] Fix | Delete
nonlocal
[98] Fix | Delete
[99] Fix | Delete
# Types
[100] Fix | Delete
bool classmethod complex dict enumerate float frozenset int list object
[101] Fix | Delete
property reversed set slice staticmethod str super tuple type
[102] Fix | Delete
[103] Fix | Delete
# Python 2 Types (otherwise Identifiers)
[104] Fix | Delete
basestring buffer file long unicode xrange
[105] Fix | Delete
[106] Fix | Delete
# Python 3 Types (otherwise Identifiers)
[107] Fix | Delete
bytearray bytes filter map memoryview open range zip
[108] Fix | Delete
[109] Fix | Delete
# Some Example code
[110] Fix | Delete
import os
[111] Fix | Delete
from package import ParentClass
[112] Fix | Delete
[113] Fix | Delete
@nonsenseDecorator
[114] Fix | Delete
def doesNothing():
[115] Fix | Delete
pass
[116] Fix | Delete
[117] Fix | Delete
class ExampleClass(ParentClass):
[118] Fix | Delete
@staticmethod
[119] Fix | Delete
def example(inputStr):
[120] Fix | Delete
a = list(inputStr)
[121] Fix | Delete
a.reverse()
[122] Fix | Delete
return ''.join(a)
[123] Fix | Delete
[124] Fix | Delete
def __init__(self, mixin = 'Hello'):
[125] Fix | Delete
self.mixin = mixin
[126] Fix | Delete
[127] Fix | Delete
</textarea></div>
[128] Fix | Delete
[129] Fix | Delete
[130] Fix | Delete
<h2>Cython mode</h2>
[131] Fix | Delete
[132] Fix | Delete
<div><textarea id="code-cython" name="code-cython">
[133] Fix | Delete
[134] Fix | Delete
import numpy as np
[135] Fix | Delete
cimport cython
[136] Fix | Delete
from libc.math cimport sqrt
[137] Fix | Delete
[138] Fix | Delete
@cython.boundscheck(False)
[139] Fix | Delete
@cython.wraparound(False)
[140] Fix | Delete
def pairwise_cython(double[:, ::1] X):
[141] Fix | Delete
cdef int M = X.shape[0]
[142] Fix | Delete
cdef int N = X.shape[1]
[143] Fix | Delete
cdef double tmp, d
[144] Fix | Delete
cdef double[:, ::1] D = np.empty((M, M), dtype=np.float64)
[145] Fix | Delete
for i in range(M):
[146] Fix | Delete
for j in range(M):
[147] Fix | Delete
d = 0.0
[148] Fix | Delete
for k in range(N):
[149] Fix | Delete
tmp = X[i, k] - X[j, k]
[150] Fix | Delete
d += tmp * tmp
[151] Fix | Delete
D[i, j] = sqrt(d)
[152] Fix | Delete
return np.asarray(D)
[153] Fix | Delete
[154] Fix | Delete
</textarea></div>
[155] Fix | Delete
[156] Fix | Delete
<script>
[157] Fix | Delete
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
[158] Fix | Delete
mode: {name: "python",
[159] Fix | Delete
version: 3,
[160] Fix | Delete
singleLineStringErrors: false},
[161] Fix | Delete
lineNumbers: true,
[162] Fix | Delete
indentUnit: 4,
[163] Fix | Delete
matchBrackets: true
[164] Fix | Delete
});
[165] Fix | Delete
[166] Fix | Delete
CodeMirror.fromTextArea(document.getElementById("code-cython"), {
[167] Fix | Delete
mode: {name: "text/x-cython",
[168] Fix | Delete
version: 2,
[169] Fix | Delete
singleLineStringErrors: false},
[170] Fix | Delete
lineNumbers: true,
[171] Fix | Delete
indentUnit: 4,
[172] Fix | Delete
matchBrackets: true
[173] Fix | Delete
});
[174] Fix | Delete
</script>
[175] Fix | Delete
<h2>Configuration Options for Python mode:</h2>
[176] Fix | Delete
<ul>
[177] Fix | Delete
<li>version - 2/3 - The version of Python to recognize. Default is 2.</li>
[178] Fix | Delete
<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>
[179] Fix | Delete
<li>hangingIndent - int - If you want to write long arguments to a function starting on a new line, how much that line should be indented. Defaults to one normal indentation unit.</li>
[180] Fix | Delete
</ul>
[181] Fix | Delete
<h2>Advanced Configuration Options:</h2>
[182] Fix | Delete
<p>Usefull for superset of python syntax like Enthought enaml, IPython magics and questionmark help</p>
[183] Fix | Delete
<ul>
[184] Fix | Delete
<li>singleOperators - RegEx - Regular Expression for single operator matching, default : <pre>^[\\+\\-\\*/%&amp;|\\^~&lt;&gt;!]</pre> including <pre>@</pre> on Python 3</li>
[185] Fix | Delete
<li>singleDelimiters - RegEx - Regular Expression for single delimiter matching, default : <pre>^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]</pre></li>
[186] Fix | Delete
<li>doubleOperators - RegEx - Regular Expression for double operators matching, default : <pre>^((==)|(!=)|(&lt;=)|(&gt;=)|(&lt;&gt;)|(&lt;&lt;)|(&gt;&gt;)|(//)|(\\*\\*))</pre></li>
[187] Fix | Delete
<li>doubleDelimiters - RegEx - Regular Expression for double delimiters matching, default : <pre>^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&amp;=)|(\\|=)|(\\^=))</pre></li>
[188] Fix | Delete
<li>tripleDelimiters - RegEx - Regular Expression for triple delimiters matching, default : <pre>^((//=)|(&gt;&gt;=)|(&lt;&lt;=)|(\\*\\*=))</pre></li>
[189] Fix | Delete
<li>identifiers - RegEx - Regular Expression for identifier, default : <pre>^[_A-Za-z][_A-Za-z0-9]*</pre> on Python 2 and <pre>^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*</pre> on Python 3.</li>
[190] Fix | Delete
<li>extra_keywords - list of string - List of extra words ton consider as keywords</li>
[191] Fix | Delete
<li>extra_builtins - list of string - List of extra words ton consider as builtins</li>
[192] Fix | Delete
</ul>
[193] Fix | Delete
[194] Fix | Delete
[195] Fix | Delete
<p><strong>MIME types defined:</strong> <code>text/x-python</code> and <code>text/x-cython</code>.</p>
[196] Fix | Delete
</article>
[197] Fix | Delete
[198] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function