Dưới đây là phiên bản nổi bật của cú pháp của nhạc cụ từ mã §.
import sys if sys.hexversion = 2] and [s[0:2] == '0x']: radix = 16 if [strLength >= 2] and [s[0:2] == '0X']: radix = 16 if [strLength >= 3] and [s[0:3] == '-0x']: radix = 16 if [strLength >= 3] and [s[0:3] == '-0X']: radix = 16 return int[s, radix] def readAllInts[self]: strings = self.readAllStrings[] ints = [] for s in strings: i = int[s] ints.append[i] return ints def readFloat[self]: s = self._readRegExp[r'[-+]?[\d+[\.\d*]?|\.\d+][[eE][-+]?\d+]?'] return float[s] def readAllFloats[self]: strings = self.readAllStrings[] floats = [] for s in strings: f = float[s] floats.append[f] return floats def readBool[self]: s = self._readRegExp[r'[True]|[False]|1|0'] if [s == 'True'] or [s == '1']: return True return False def readAllBools[self]: strings = self.readAllStrings[] bools = [] for s in strings: b = bool[s] bools.append[b] return bools def readString[self]: s = self._readRegExp[r'\S+'] return s def readAllStrings[self]: strings = [] while not self.isEmpty[]: s = self.readString[] strings.append[s] return strings def hasNextLine[self]: if self._buffer != '': return True else: self._buffer = self._stream.readline[] if sys.hexversion