3348 lines
191 KiB
PostScript
3348 lines
191 KiB
PostScript
%!
|
|
%%Title: A Python Quick Reference
|
|
%%Creator: html2ps version 1.0 beta1
|
|
%%EndComments
|
|
save
|
|
2000 dict begin
|
|
/d {bind def} bind def
|
|
/D {def} d
|
|
/t true D
|
|
/f false D
|
|
/FL [/Times-Roman
|
|
/Times-Italic
|
|
/Times-Bold
|
|
/Times-BoldItalic
|
|
/Courier
|
|
/Courier-Oblique
|
|
/Courier-Bold
|
|
/Courier-BoldOblique
|
|
/Helvetica
|
|
/Helvetica-Oblique
|
|
/Helvetica-Bold
|
|
/Helvetica-BoldOblique] D
|
|
/WF t D
|
|
/WI 0 D
|
|
/F 1 D
|
|
/IW 453 F div D
|
|
/IL 671 F div D
|
|
/PS 842 D
|
|
/EF [0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 2 2] D
|
|
/EZ [11 9 19 17 15 13 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 8 8] D
|
|
/Ey [0 0 2 2 2 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] D
|
|
/EG [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1] D
|
|
/Tm [1 1 0.8 0.8 0.8 0.8 0.8 0.8 0 0 0 0 0 0 0.5 1 1 1 1 0 0 1.3 0 0] D
|
|
/Bm [1 1 0.5 0.5 0.5 0.5 0.5 0.5 0 0 0 0 0 0 0.5 1 1 1 1 0 0 1 0 0] D
|
|
/Lm [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 0 0 2 0 0 0] D
|
|
/Rm [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0] D
|
|
/EU [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0] D
|
|
/NO t D
|
|
/YY [[{()}1][{()}0][{()}2]] D
|
|
/ZZ [[{()}1][{()}0][{()}2]] D
|
|
/Ts EZ 0 get D
|
|
/TU f D
|
|
/Xp t D
|
|
/AU f D
|
|
/SN 0 D
|
|
/Cf f D
|
|
/Fe f D
|
|
/TI 1 Ts mul D
|
|
/FE {newpath -14 14 M CP BB 467 14 L 467 -685 L CP BB -14 -685 L closepath} D
|
|
/LA {TU PM 0 eq and{IW 56 F div add SA{Sf div}if 0 translate}
|
|
{71 757 translate F SA{Sf mul}if dup scale
|
|
CS CF FS Cf{CA CL get VC}if /Bb f D}ie 0 0 M TF not Tc or
|
|
{Cf{gsave SA{1 Sf div dup scale}if Cb VC FE fill grestore}if Df{Sd}if}if} D
|
|
/Pi 0 Ts mul D
|
|
/SG [0.8 1 1] D
|
|
/Ab 15 D
|
|
/J 0 D
|
|
/Tc f D
|
|
/NH 6 D
|
|
/Nf f D
|
|
/Pa f D
|
|
/LH 1.2 D
|
|
/XR f D
|
|
/Xr {/pN E D ( [p ) WB pN WB (] )WB} D
|
|
/Db [16#FF 16#FF 16#FF] D
|
|
/Dt [16#00 16#00 16#00] D
|
|
/eA f D
|
|
/Lc t D
|
|
/Dl [16#00 16#00 16#00] D
|
|
/LX f D
|
|
/Br 0.25 D
|
|
/IA ([IMAGE]) D
|
|
/DS {/PF f D()WB NL NP()pop RC ZF} D
|
|
/Gb f D
|
|
/Mb f D
|
|
/Hc [16#00 16#00 16#00] D
|
|
/Bl 3 D
|
|
/MI -15.2 D
|
|
/DX (DRAFT) D
|
|
/Di 0 D
|
|
/FD 2 D
|
|
/Dy 2 D
|
|
/cD [16#F0 16#F0 16#F0] D
|
|
/FW 0.6 D
|
|
/FU [16#00 16#00 16#00] D
|
|
/ET {/RM f D /A0 0 D /PN SN D /OU t D /Ou t D /W IW D /LL W D D1
|
|
Ms not TP and{Ip}if /TF f D} D
|
|
[{true statusdict/setduplexmode get exec} stopped cleartomark
|
|
[{true statusdict/settumble get exec} stopped cleartomark
|
|
%-- End of variable part --
|
|
/Cd {aload length 2 idiv dup dict begin {D} repeat currentdict end} D
|
|
/EX {EC cvx exec} D
|
|
/DU {} d
|
|
/BB {pop pop}d
|
|
/ie {ifelse} d
|
|
/E {exch} d
|
|
/M {moveto} d
|
|
/R {rmoveto} d
|
|
/L {lineto} d
|
|
/RL {rlineto} d
|
|
/CP {currentpoint} d
|
|
/SW {stringwidth} d
|
|
/GI {getinterval} d
|
|
/PI {putinterval} d
|
|
/Sg {setgray} d
|
|
/LW {setlinewidth} d
|
|
/S {dup () ne OU and{0 Co R AT 3 eq LB and HF not and A1 0 ne A2 0 ne or and
|
|
{A2 0 32 A1 0 6 -1 roll awidthshow}{show}ie 0 Co neg R}{pop}ie
|
|
OU PH 3 eq or{/Ms t D}if} D
|
|
/U {OU{gsave CP currentfont /FontInfo get /UnderlinePosition get
|
|
0 E currentfont /FontMatrix get dtransform E pop add newpath M dup SW pop
|
|
CJ 0 RL stroke grestore}if} D
|
|
/B {OU Br 0 gt and{CP Ts neg Ts .33 mul R gsave 0 Sg
|
|
CP newpath Ts Br mul 0 360 arc closepath UI 2 mod 0 eq{stroke}{fill}ie
|
|
grestore M CP E Ts Br 1 add mul sub E BB /Ms t D}if}D
|
|
/NP {Ms TP not or PA and OU and{TP{OR}if f1{mF k2 /mF E D /YC 0 D}if
|
|
TP TU not PM 0 eq or and{showpage}if DU Ip TE not{LA}if 0.6 LW
|
|
/CI 0 D /TP t D /Hs f D /hl 6 D /hL 6 D /HI hi D /Ms f D}if Bs XO BO M} D
|
|
/Np {LE sub CP E pop gt PL 0 eq and{NP}if}D
|
|
/Ip {/PN PN 1 add D /Pn RM{1}{4}ie PN Ns D /PM PN SN sub 2 mod D} D
|
|
/GP {E dup 3 -1 roll get PN 1 add 2 mod get dup type /integertype eq
|
|
{get 0 get}{E pop}ie}d
|
|
/Fc {dup 2 GP exec SW pop /S1 E D dup 1 GP exec SW pop /S2 E D 0 GP exec SW
|
|
pop /S3 E D S1 0 gt{S2 2 mul S1 add S3 2 mul S1 add 2 copy lt{E}if pop}{0}ie
|
|
S2 S3 add 2 copy lt{E}if pop IW .9 mul div dup 1 gt{1 E div}{pop 1}ie}D
|
|
/OR {gsave SA{1 Sf div dup scale}if Fe{Cf{FU VC}if FW LW 1 setlinejoin
|
|
FE stroke}if /YO {60 F div dup 40 gt{pop 40}if}D /cs CS D /cf CF D /CF 0 D
|
|
/pf PF D /PF f D /Fn FN D /At AT D /AT 0 D /FN EF Hf 1 add get D Fz Fs FS ZZ
|
|
Fc Fz mul Fs FS EU Hf 1 add get dup type /arraytype eq Cf and{VC}{pop 0 Sg}ie
|
|
IW IL neg YO sub M ZZ 1 GP exec dup SW pop neg 0 R Sh 0 IL neg YO sub M
|
|
ZZ 0 GP exec Sh ZZ 2 GP exec dup SW pop IW E sub 2 div IL neg YO sub M Sh
|
|
Fz Fs FS NO{/AW IW Pn SW pop sub D AW 2 div IL neg YO sub
|
|
S1 0 gt S2 AW .45 mul gt or S3 AW .45 mul gt or{Fz 2 mul sub}if M Pn Sh}if
|
|
EU Hf get dup type /arraytype eq Cf and{VC}{pop 0 Sg}ie
|
|
YY Fc /FN EF Hf get D Hz mul HS FS IW YO M YY 1 GP exec dup SW pop neg 0 R Sh
|
|
0 YO M YY 0 GP exec Sh YY 2 GP exec dup SW pop IW E sub 2 div YO M Sh
|
|
/FN Fn D /AT At D t Pb XO SZ SL get neg R /PF pf D grestore /CF 0 D cs cf FS}D
|
|
/Sh {dup () ne{CP Hz 4 div sub BB show CP CS add BB}{pop}ie}D
|
|
/Pb {/OU E D /Ou OU D /PB t D 0 0 M Ba{/Sa save D /BP t D /Fl t D RC /PL 0 D
|
|
/PH 0 D /W IW D /LE IL .7 mul D /EO 0 D SI ZF /YA 0 D /BO 0 D /C1 () D
|
|
BA 0 Ts neg R Bb{Xl Yl Xh Yh}if Bb CP Sa restore M
|
|
{/Yh E D /Xh E D /Yl E D /Xl E D}if /Fl t D}if
|
|
BL /OU t D /HM f D /Ou t D /PB f D} D
|
|
/Bs {/BP Ba not D}D
|
|
/reencodeISO {
|
|
dup dup findfont dup length dict begin{1 index /FID ne{D}{pop pop}ie}forall
|
|
/Encoding ISOLatin1Encoding D currentdict end definefont} D
|
|
/ISOLatin1Encoding [
|
|
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
|
|
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
|
|
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
|
|
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
|
|
/space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright
|
|
/parenleft/parenright/asterisk/plus/comma/hyphen/period/slash
|
|
/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon
|
|
/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N
|
|
/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright
|
|
/asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m
|
|
/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde
|
|
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
|
|
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
|
|
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
|
|
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
|
|
/.notdef/space/exclamdown/cent/sterling/currency/yen/brokenbar
|
|
/section/dieresis/copyright/ordfeminine/guillemotleft/logicalnot
|
|
/hyphen/registered/macron/degree/plusminus/twosuperior/threesuperior
|
|
/acute/mu/paragraph/periodcentered/cedilla/onesuperior/ordmasculine
|
|
/guillemotright/onequarter/onehalf/threequarters/questiondown
|
|
/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla
|
|
/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
|
|
/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis
|
|
/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute
|
|
/Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis
|
|
/aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave
|
|
/iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex
|
|
/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis
|
|
/yacute/thorn/ydieresis
|
|
] D
|
|
[128/backslash 129/parenleft 130/parenright 141/circumflex 142/tilde
|
|
143/perthousand 144/dagger 145/daggerdbl 146/Ydieresis 147/scaron 148/Scaron
|
|
149/oe 150/OE 151/guilsinglleft 152/guilsinglright 153/quotesinglbase
|
|
154/quotedblbase 155/quotedblleft 156/quotedblright 157/endash 158/emdash
|
|
159/trademark]
|
|
aload length 2 idiv 1 1 3 -1 roll{pop ISOLatin1Encoding 3 1 roll put}for
|
|
/colorimage where{pop}{
|
|
/colorimage {
|
|
pop pop /Pr E D {/Cv Pr D /Gr Cv length 3 idiv string D 0 1 Gr length 1 sub
|
|
{Gr E dup /i E 3 mul D Cv i get 0.299 mul Cv i 1 add get 0.587 mul add
|
|
Cv i 2 add get 0.114 mul add cvi put}for Gr} image} D
|
|
}ie
|
|
/pdfmark where{pop}{userdict /pdfmark /cleartomark load put}ie
|
|
WF{FL{reencodeISO D}forall}{4 1 FL length 1 sub{FL E get reencodeISO D}for}ie
|
|
/Symbol dup dup findfont dup length dict begin
|
|
{1 index /FID ne{D}{pop pop}ie}forall /Encoding [Encoding aload pop]
|
|
dup 128 /therefore put D currentdict end definefont D
|
|
|
|
/SF {/CS E D SZ SL CS put FO SL FN put /YI CS LH neg mul D dup ST cvs ( ) join
|
|
CS ST cvs join C1 E join ( NF ) join /C1 E D CS NF /Wf WF FN 0 gt or D
|
|
/BW Wf{( ) SW pop}{0}ie D}D
|
|
/NF {/cS E D /cF E D cF 0 ge{FL cF get}{/Symbol}ie
|
|
findfont cS scalefont setfont} D
|
|
/FS {CF or /CF E D FR SL CF put CF CF 0 ge{FN 4 mul add}if E SF} D
|
|
/PC {SH /BP f D fin not GL not and{NL}if /HM t D /LL LS D} D
|
|
/BS {/TX E D Wf{/fin f D /CW 0 D /LK 0 D /SC 0 D
|
|
/RT TX D {RT ( ) search{/NW E D pop /RT E D /WH NW SW pop D CW WH add LL gt
|
|
{TX SC LK SC sub 1 sub NN GI GL{SH cF cS OC
|
|
2 copy cS ne E cF ne or{NF}{pop pop}ie}{PC /CW WH BW add D}ie
|
|
/SC LK D}
|
|
{GL{JC}if
|
|
/CW CW WH add BW add D /HM t D}ie /GL f D /Ph f D
|
|
/LK LK NW length 1 add add D}{pop exit}ie}loop
|
|
/fin t D TX SC LK SC sub GI SH RT () ne{GL not{CC}if}if
|
|
/LC TX length D /WH RT SW pop D CW WH add Hy{HC SW pop add}if LL gt
|
|
{RT GL{SH cF cS OC 2 copy cS ne E cF ne or{NF}{pop pop}ie
|
|
Hy{/Ph t D}if /LL LS D}{NL /LL LS D SH}ie}
|
|
{RT PC Hy{CC}if /Ph Ph Hy or D}ie RT () ne{/GL t D /HM t D}if}
|
|
{TX SW pop LL le{TX SH}{/NW () D 0 2 TX length 1 sub
|
|
{/CW E D TX 0 CW GI dup SW pop LL gt{pop NW SH /HM t D NL/LL W XO sub MR sub D
|
|
/CW CW 2 sub NN D /TX TX CW TX length CW sub GI D TX BS exit}
|
|
{/NW E D}ie}for}ie}ie /HM t D}D
|
|
/CC {C0 length 0 gt{JC}if /C0 [C1 L1 YA YB Mf NS NB TB AF Bw] D
|
|
/C1 () D /L0 L1 D /YA 0 D /YB 0 D /Mf 0 D /NS 0 D /NB 0 D}D
|
|
/JC {C0 aload length 0 gt{pop pop pop NB add /NB E D NS add /NS E D
|
|
dup Mf gt{/Mf E D}{pop}ie dup YB gt{/YB E D}{pop}ie
|
|
dup YA gt{/YA E D}{pop}ie pop C1 join /C1 E D /C0 [] D}if}D
|
|
/OC {C0 length 0 gt{C1 L1 L0 sub YA YB Mf NS NB TB AF Bw GL C0 aload pop
|
|
/Bw E D /AF E D /TB E D /NB E D /NS E D /Mf E D /YB E D /YA E D /C0 [] D
|
|
/L1 E D /C1 E D Ph{HC SH}if NL /GL E D /Bw E D /AF E D /TB E D /NB E D /NS E D
|
|
/Mf E D /YB E D /YA E D /L1 E D /LL W L1 sub XO sub MR sub WH sub D /CW 0 D
|
|
C1 E join /C1 E D}if}D
|
|
/BT {/LB t D dup length string copy RS dup dup () ne E ( ) ne and
|
|
{/CI 0 D /LS LL D /LL W L1 sub XO sub MR sub D BS}
|
|
{dup ( ) eq{/GL f D}if dup () eq L1 0 eq or{pop}{SH /BP f D /Ph f D}ie}ie
|
|
/LB f D} D
|
|
/BL {CP E pop XO E M} D
|
|
/NL {JC /GL f D /SK W XO sub MR sub L1 sub TB{Bw add}if D
|
|
/YA LF{Mf HM Fl not and PF or{LH mul}if}{0 /LF t D}ie YA 2 copy lt{E}if pop D
|
|
C1 () ne{/FB YB Mf SA{Sf mul}if 4 div 2 copy lt{E}if pop D}if Fl{/Ya YA D}if
|
|
CP E pop YA sub YB sub LE neg lt Fl not and PB not and{NP}if NT TL BL
|
|
OU PF not and PB or{/RE L1 TB{Bw sub}if
|
|
W XO sub MR sub div YA YB add LE BO add div 2 copy lt{E}if pop D
|
|
RE 1 gt{BL 1 RE div dup scale}if}if
|
|
AT 2 le{SK AT mul 2 div YA neg R}if
|
|
AT 3 eq{0 YA neg R TB{/NB NB 1 sub D /NS NS 1 sub D}if /NB NB 1 sub NN D
|
|
/A3 NS 6 mul NB add D NS NB add 0 eq
|
|
{/A1 0 D /A2 0 D}
|
|
{NS 0 eq{/A1 SK NB div dup J gt{pop 0}if D /A2 0 D}{J A3 mul SK lt
|
|
{/A1 J D /A2 SK J NB mul sub NS div dup Ab gt{/A1 0 D pop 0}if D}
|
|
{/A1 SK A3 div D /A2 A1 6 mul D}ie}ie}ie /A1 A1 NN D /A2 A2 NN D}if
|
|
AT 4 eq{0 YA neg R PH 2 le{PD 0 lt{/PD L1 D}if PD M1 gt{/M1 PD D}if
|
|
L1 PD sub M2 gt{/M2 L1 PD sub D}if}{DV ID 1 sub get 0 ge{Lo 0 R}if}ie}if
|
|
F0 cF ne Cs cS ne or{F0 Cs NF}if
|
|
/ms Ms D /Ms f D CP FB sub
|
|
C1 cvx exec XO EO sub L1 add TB{BW sub}if dup LM gt{/LM E D}{pop}ie
|
|
PH 0 eq PH 4 eq or Ms and{HF not{/PO t D /AH t D}if
|
|
BB CP YA add E AT 3 eq LB and{A1 sub}if TB{BW sub}if E BB}
|
|
{pop pop}ie Ms HM PH 3 eq and or{/BP f D /Fl f D}if
|
|
/Lo 0 D /L1 0 D /F0 cF D /Cs cS D BP not{0 YB NN neg R}if
|
|
OU f1 and mF not and{k2 /f1 f D}if
|
|
OU PF not and PB or{RE 1 gt{RE dup scale}if}if /Ms ms Ms or D
|
|
/C1 AF{(Cp )}{()}ie D /YA 0 D /YB 0 D BL
|
|
AT 4 eq LB not and PH 3 ge and
|
|
{ID DV length lt{DV ID get dup 0 ge{DO E sub /Lo E D /L1 Lo D}{pop}ie
|
|
/ID ID 1 add D}if}if /T t D CD{/LN LN 1 add D PD}if
|
|
/PD -1 D /NS 0 D /NB 0 D /TB f D /Ph f D /Mf 0 D /HM f D} D
|
|
/RS {/TM E D /CN 0 D TM{10 eq{TM CN ( ) PI}if /CN CN 1 add D}forall
|
|
/CN 0 D /BK HM EN and{0}{1}ie D TM
|
|
{dup 32 ne{TM CN 3 2 roll put /CN CN 1 add D /BK 0 D}
|
|
{pop BK 0 eq{TM CN 32 put /CN CN 1 add D}if /BK 1 D}ie}forall
|
|
TM 0 CN GI dup dup () ne E ( ) ne and
|
|
{dup CN 1 sub get 32 eq{/EN f D}{/EN t D}ie}if} D
|
|
/join {2 copy length E length add string dup 4 2 roll 2 index 0 3 index
|
|
PI E length E PI}d
|
|
/WR {(\n) search{dup () ne BP not or
|
|
{Li 4 le CP E pop YI Li mul add LE add 0 lt and PL 0 eq and{NP}if
|
|
SH NL pop /Li Li 1 sub D WR}{pop pop WR}ie}{SH}ie /CI 0 D /BP f D} D
|
|
/SH {dup dup () ne E ( ) ne and PF or CS Mf gt and{/Mf CS D}if
|
|
T not Wf and{( ) E join /T t D}if dup BP{/MF CS D}if
|
|
AT 3 eq{2 copy length dup 0 gt{/NB E NB add D
|
|
{( ) search{/NS NS 1 add D pop pop}{pop exit}ie}loop}{pop pop}ie}if
|
|
CD PD 0 lt and{dup DC search{SW pop /PD E L1 add D pop pop}{pop}ie}if
|
|
0 Np dup SW pop L1 add /L1 E D dup () ne
|
|
{C1 (\() join E join (\)) join AU AF and UF or Wf and{( U ) join}if
|
|
sF{( s ) join}if ( S ) join
|
|
/C1 E D dup length 1 sub get 32 eq /TB E D /Bw BW D}{pop pop}ie} D
|
|
/BG {AI LG BC add add 0 eq} D
|
|
/ON {OU{Ty AR AI NN get dup 1 add Ln Ns Ty 2 mod 0 eq{(. )}{(\) )}ie join
|
|
dup SW pop neg 0 R CP E 0 lt{0 E M}{pop}ie CP BB show /Ms t D}if} D
|
|
/Ln {AR AI 3 -1 roll put}D
|
|
/SP {dup CI lt BP not and{dup CI sub 0 E R /CI E D}{pop}ie} D
|
|
/BN {PF{WR /HM f D}{BT NL}ie} D
|
|
/NN {dup 0 lt{pop 0}if} D
|
|
/h {HI 0 gt{(h) HI ST cvs join cvx exec dup 1 get E
|
|
Nf{0 get E join}{pop}ie}{()}ie} D
|
|
/H {/fn FN D /Hi E 1 add D 1 sub /HL E D /H2 HL 2 add D /GS EZ H2 get D
|
|
E Tm H2 get GS mul BE dup 0 gt{1 sub}{pop EG H2 get dup 0 lt{pop AT}if}ie NA
|
|
WW Np /SL SL 1 add D /FN EF H2 get D GS Ey H2 get FS
|
|
EU H2 get Sc Hs not HL Hl lt and Hs HL hl lt and or Hi 0 eq or
|
|
{/HI Hi D /Hs t D /hl HL D /hL HL D}if HL Hl lt{/hi Hi D}if
|
|
Nf HI 0 gt and{(h) Hi ST cvs join cvx exec 0 get WB}if
|
|
/HF t D /AH f D /PO f D} D
|
|
/EH {Bm H2 get GS mul BE OA /SL SL 1 sub NN D /CF 0 D /FN fn D
|
|
SZ SL get FR SL get FS /HF f D /GS Ts D ()Ec} D
|
|
/P {E PF{WR}{PO{EP}{BN}ie Ts 4 mul Np AE not{Tm 0 get Ts mul neg SP}if
|
|
dup 0 ge AH and{Pi Pd}if}ie 1 sub dup 0 lt{pop AV AL get}if /AT E D /PO t D} D
|
|
/EP {PF{WR}{BN Ts 4 mul Np}ie AE not{Bm 0 get Ts mul neg SP}if
|
|
/AT AV AL get D /PO f D} D
|
|
/BE {E PO{EP}{BN}ie Ts 4 mul Np neg SP} D
|
|
/HR {/Aw W EO sub D /RW E dup 0 gt{Aw mul}{neg}ie dup Aw gt{pop Aw}if D /RZ E D
|
|
E BN Ts neg SP 1 sub 2 div Aw RW sub mul EO add CP E pop M PF{0 Ps neg R}if
|
|
0 Np OU{gsave RZ LW Cf{Hc VC}{0 Sg}ie CP BB RW 0 RL CP BB stroke grestore}if
|
|
/CI 0 D /BP f D PF not{Ts neg SP}if /Ms t D} D
|
|
/AD {I NL EG 14 get dup 0 lt{pop AT}if NA /AE t D Tm 14 get Ts mul neg SP
|
|
Cf{EU 14 get dup -1 eq{pop CA CL get}if Sc}if} D
|
|
/DA {BN ()ES OA /AE f D ()Ec Bm 14 get Ts mul neg SP} D
|
|
/PR {/MW E D /Li E D Tm 1 get Ps mul BE 0 NA /FN Fp D /PF t D SI /SL SL 1 add D
|
|
/CF 0 D Ps CS mul Ts div MW WC mul CS mul Ts div dup LL gt PL 0 eq and
|
|
{LL div div}{pop}ie Ey 1 get FS CP E pop LE add YI neg div cvi dup Li lt
|
|
AH and{4 lt YI Li mul 5 mul LE add 0 gt or PL 0 eq and{NP}if}{pop}ie
|
|
EU 1 get Sc /GS Ps D}D
|
|
/RP {WR NL () /PF f D SI /FN 0 D ES Bm 1 get Ps mul neg SP OA /GS Ts D} D
|
|
/SI {/XO Lm 15 get BC NN mul Lm 16 get AI UI sub NN mul add
|
|
Lm 17 get UI NN mul add Lm 20 get LG NN mul add Ts mul
|
|
PF{Lm 1 get Ps mul add}if EO add D
|
|
/MR Rm 15 get BC NN mul Rm 16 get AI UI sub NN mul add
|
|
Rm 17 get UI NN mul add Rm 20 get LG NN mul add Ts mul
|
|
PF{Rm 1 get Ps mul add}if D /LL W XO sub MR sub D} D
|
|
/DT {BN /LG LG 1 sub D SI /LG LG 1 add D WW 2 div Np BL} D
|
|
/DD {WB Cc 0 eq L1 0 eq or Lm 20 get Ts mul L1 sub TB{BW add}if Ts 2 div lt or
|
|
NL /LF E D SI BL} D
|
|
/DL {Dc LG Cc put /Cc E D BG{Tm 18 get Ts mul BE}{BN}ie /LG LG 1 add D BL} D
|
|
/LD {BN LG 0 gt{/LG LG 1 sub D}if /Cc Dc LG get D SI
|
|
BG{()Bm 18 get Ts mul BE}if BL} D
|
|
/UL {BG{Tm 17 get Ts mul BE}{BN}ie NR AI NN 0 put /UI UI 1 add D
|
|
/AI AI 1 add D SI BL} D
|
|
/LU {BN /UI UI 1 sub D /AI AI 1 sub D SI BG{()Bm 17 get Ts mul BE}if BL} D
|
|
/OL {E BG{Tm 16 get Ts mul BE}{BN}ie TR AI NN Ty put /Ty E D NR AI NN 1 put
|
|
/AI AI 1 add D SI BL 1 Ln} D
|
|
/LO {BN /AI AI 1 sub D /Ty TR AI get D SI BG{()Bm 16 get Ts mul BE}if BL} D
|
|
/LI {E BN -1 SP /BP f D /CI 0 D 0 Np NR AI 1 sub NN get 1 eq
|
|
{dup dup 0 gt E 4 le and{/Ty E D}{pop}ie
|
|
/L1 L1 Ty AR AI NN get Ns SW pop XO sub dup 0 lt{pop 0}if add D ( ON )}
|
|
{pop ( B )}ie C1 E join /C1 E D CS Mf gt{/Mf CS D}if BL} D
|
|
/BQ {Tm 15 get Ts mul BE /BC BC 1 add D SI BL} D
|
|
/QB {Bm 15 get Ts mul BE /BC BC 1 sub D SI BL} D
|
|
/Al {E EP 1 sub dup 0 lt{pop AV AL get}if NA} D
|
|
/Ea {EP OA} D
|
|
/WB {PF{WR}{BT}ie} D
|
|
/F1 {WB /FN 0 D CS 0 FS} D
|
|
/F2 {WB /FN WI D CS 0 FS} D
|
|
/HY {/Hy t D WB /Hy f D} D
|
|
/YH {WB} D
|
|
/A {/LT E D LT 1 eq{/RN E D}if /Lh E D WB /AF t D /C1 C1 ( Cp ) join D
|
|
Lc{Cl Sc}if} D
|
|
/EA {Lc AF and{Ec}{WB}ie TL Pa AF and Lh 0 ne and
|
|
{( \() Lh join (\)) join /AF f D WB}if /AF f D} D
|
|
/TL {C1 ( Tl ) apa /C1 E D} d
|
|
/apa {AF OU and Lh 0 ne LT 1 eq or and{LT 1 eq{RN ( /) E ST cvs join}
|
|
{(\() Lh join (\)) join}ie E join join}{pop}ie} d
|
|
/Cp {/Xc CP /Yc E D D} D
|
|
/SS {Cf{dup 0 ge{EU E get dup -1 eq{pop CA CL get}if}{pop CA CL get}ie Sc}
|
|
{pop}ie SZ SL get /SL SL 1 add D} D
|
|
/I {WB 8 SS 1 FS} D
|
|
/EM {WB 8 SS /CF CF 1 xor D 0 FS} D
|
|
/BD {WB 9 SS 2 FS} D
|
|
/TT {WB 10 SS /FN Fp D 0 FS} D
|
|
/KB {WB 11 SS /FN Fp D 2 FS} D
|
|
/CT {WB 12 SS 1 FS} D
|
|
/SM {WB 13 SS /FN Fp D 0 FS} D
|
|
/Q {/QL QL 1 add D QO QL 2 mod get La get join WB} D
|
|
/EQ {QC QL 2 mod get La get join WB /QL QL 1 sub D} D
|
|
/RO {WB -1 SS /CF 0 D 0 FS} D
|
|
/SY {WB -1 SS -1 FS} D
|
|
/ES {WB /SL SL 1 sub NN D /CF 0 D /FN FO SL get D SZ SL get FR SL get FS ()Ec}D
|
|
/FZ {3 sub 1.2 E exp GS mul E WB TL /C1 C1 ( Cp ) join D /SL SL 1 add D 0 FS} D
|
|
/Ef {WB TL ()ES /C1 C1 ( Cp ) join D} D
|
|
/BZ {dup /Bf E D FZ}D
|
|
/Sc {dup -1 ne Cf and{/CL CL 1 add D dup 0 eq{pop [0 0 0]}if
|
|
dup CA E CL E put VS ( VC ) join C1 E join /C1 E D}{pop}ie} D
|
|
/Ec {WB Cf{/CL CL 1 sub NN D CA CL get VS ( VC ) join C1 E join /C1 E D}if} D
|
|
/VS {dup type /arraytype eq{([) E {ST cvs join ( ) join}forall (]) join}if} D
|
|
/VC {{255 div}forall setrgbcolor} D
|
|
/Sl {dup type /integertype ne{Ds}if /La E D WB}d
|
|
/UN {WB /UF t D} D
|
|
/NU {WB /UF f D} D
|
|
/SE {WB /sF t D} D
|
|
/XE {WB /sF f D} D
|
|
/sM {/C1 C1 ( k1 ) join D}d
|
|
/eM {/C1 C1 ( k2 ) join D}d
|
|
/k1 {/YC CP E pop Ts add D /mF t D /f1 t D}d
|
|
/k2 {gsave 3 LW -9 CP E pop Ts 0.2 mul sub M -9 YC L stroke grestore /mF f D}d
|
|
/Ac {/AC E D WB}d
|
|
/Ca {eA{( \()join AC join(\) )join}if WB}d
|
|
/s {OU{gsave 0 CS .25 mul R dup SW pop CJ 0 RL stroke grestore}if}D
|
|
/CJ {AT 3 eq LB and{E dup dup length 1 sub A1 mul E
|
|
{( ) search{pop pop E A2 add E}{pop exit}ie}loop 3 -1 roll add
|
|
W CP pop sub 2 copy gt{E}if pop}if}D
|
|
/So {/Co E D} D
|
|
/SO {C1 Yo ST cvs join ( So ) join /C1 E D (j) SW pop 2 div Pd} D
|
|
/Se {E WB CS E div Pd}D
|
|
/Pd {dup type /stringtype eq{SW pop}if dup /L1 E L1 add D
|
|
ST cvs ( 0 R ) join C1 E join /C1 E D} D
|
|
/Sp {0.35 CO} D
|
|
/Sb {-0.2 CO} D
|
|
/CO {OV Io Yo put /Yo E CS mul Yo add D /Io Io 1 add D -1.5 Io mul 3 add FZ SO
|
|
CS Yo add dup YA gt{/YA E D}{pop}ie
|
|
Yo neg dup YB gt{/YB E D}{pop}ie} D
|
|
/Es {ES /Io Io 1 sub NN D /Yo OV Io get D SO} D
|
|
/SB {/N2 0 D 0 1 NI{/N E D{IX N2 get 0 lt{/N2 N2 1 add D}{exit}ie}loop
|
|
/K WS N get FC N get mul D /NY AY N2 get D /BV NY array D
|
|
0 1 NY 1 sub{/TM K string D currentfile TM readhexstring pop pop BV E TM put}
|
|
for BM N BV put /N2 N2 1 add D}for} D
|
|
/IC [{/MA E D /MB 0 D}{2 div /MA E D /MB MA D}{/MB E CS sub D /MA CS D}
|
|
{pop /MA YS AB mul D /MB 1 AB sub YS mul D}{pop /MA 0 D /MB 0 D}] D
|
|
/IP {BV N get /N N 1 add D} D
|
|
/II {/K E D IX K get 0 lt{/EC E D}if /TY E D
|
|
TY 4 eq{/Y E D /X E D}if TY 3 eq{/AB E D}if
|
|
/XW AX K get D /YW AY K get D /IS SG IT K get get D /XS XW IS mul D
|
|
/YS YW IS mul D YS IC TY get exec /MA MA Fl not{3 add}if D} D
|
|
/IM {II /ty TY D /xs XS D /ys YS D /ya YA D /yb YB D /ma MA D /mb MB D /k K D
|
|
/ec EC D /BP f D /CI 0 D WB TL L1 xs add dup XO add MR add W gt
|
|
{pop /ma ma Fl{3 add}if D NL /YA ma D /YB mb D /YS ys D /L1 xs D}
|
|
{/L1 E D ma YA gt{/YA ma D}if mb YB gt{/YB mb D}if}ie /TB f D
|
|
OU{CP E pop YS sub LE neg lt Fl not and PB not and{NP /YA ma D /YB mb D}if
|
|
/BP f D ty ST cvs ( ) join IX k get 0 lt{(\() join ec join (\) ) join}if
|
|
k ST cvs join ty 3 eq{AB ST cvs ( ) join E join}if
|
|
ty 4 eq{X ST cvs ( ) join Y ST cvs join ( ) join E join}if C1 E join
|
|
( DI ) join FP 2 eq FP 1 eq AF and or{( FM ) join}if
|
|
( Il Cp ) apa /C1 E D /EN f D}if /HM t D /T f D} D
|
|
/DI {II /Xc CP /Yc E D D /YN YW neg D /HM t D /CI 0 D /K2 IX K get D gsave
|
|
TY 4 eq{OX X IS mul add OY FY add YS sub Y IS mul sub}
|
|
{/FY YS D CP MB sub 2 copy /OY E D /OX E D}ie
|
|
translate K2 0 ge{/DP AZ K2 get D /BV BM K2 get D XS YS scale /N 0 D XW YW DP
|
|
[XW 0 0 YN 0 YW] {IP} FC K2 get 1 eq{image}{f 3 colorimage}ie}
|
|
{EX}ie grestore XS 0 R /Ms t D} D
|
|
/FM {gsave 0 Sg CP MB sub translate XS neg 0 M 0 YS RL XS 0 RL 0 YS neg RL
|
|
XS neg 0 RL stroke grestore} D
|
|
/NA {/AT E D /AL AL 1 add D AV AL AT put} D
|
|
/OA {AL 0 gt{/AL AL 1 sub D /AT AV AL get D}if} D
|
|
/D1 {/BR {CP E pop E BN Mb{CP E pop eq{0 YI R}if}{pop}ie} D
|
|
/Sn {OU{C1 E ST cvs join ( Ld ) join /C1 E D}{pop}ie} D} D
|
|
/D1 {/BR {BN} D /Sn {OU {C1 E ST cvs join ( Ld ) join /C1 E D} {pop} ie} D} D
|
|
/TC {/TF t D /ML 0 D HN{SW pop dup ML gt{/ML E D}{pop}ie}forall NP /RM RM not D
|
|
RC /OU Tc D Ep /PN 0 D Ms not TP and{Ip}if /W IW ML sub Ts sub D
|
|
/A0 0 D TH{/BR {( ) join BT} D /Sn {pop} D /Ti () D /Au () D}if} D
|
|
/TN {0 eq{E EA PF HF or not XR and{HN E get Xr}{pop}ie}
|
|
{OU{Tn 0 ge{() BN}if /Tn E D}{pop}ie WB}ie} D
|
|
/NT {OU LB not and Tn 0 ge and{PL 0 eq{Ms not{CS CF FS}if CP dup
|
|
/y E YA sub D W 9 sub CS -1.8 mul XO L1 add 2 add{y M (.) show}for
|
|
HN Tn get dup SW pop IW E sub y M show CP BB M}if /Tn -1 D}if} D
|
|
/Ld {/DN E D HN DN Pn put [/View [/XYZ -4 Fl{PS}{CP YA add US E pop}ie null]
|
|
/Dest DN ST cvs cvn /DEST pdfmark} D
|
|
/C {ND 1 eq{1 sub}if TI mul /XO E D NL Nf not{pop()}if 0 3 -1 roll 1 A} D
|
|
/OP {BP not{NP}if PN 2 mod 0 eq{NP}if}D
|
|
/Ep {Xp PN 2 mod 0 eq and{/Pn (-) D showpage /PM 1 D LA}if}D
|
|
/Dg [73 86 88 76 67 68 77] D
|
|
/Rd [0 [1 1 0][2 1 0][3 1 0][2 1 1][1 1 1][2 2 1][3 3 1][4 4 1][2 1 2]] D
|
|
/Ns {/m E D /c E 32 mul D /j m 1000 idiv D /p j 12 add string D
|
|
c 96 le m 0 gt and{c 32 le {/i 0 D /d 77 D /l 100 D /m m j 1000 mul sub D
|
|
j -1 1 {pop p i d c add put /i i 1 add D}for
|
|
4 -2 0 {/j E D /n m l idiv D /m m n l mul sub D /d Dg j get D
|
|
n 0 gt {/x Rd n get D x 0 get -1 1 {pop p i d c add put /i i 1 add D}for
|
|
p i x 1 get sub Dg x 2 get j add get c add put}if /l l 10 idiv D
|
|
}for p 0 i GI}
|
|
{/i ST length 1 sub D m {1 sub dup 0 ge{dup 26 mod c add 1 add
|
|
ST i 3 -1 roll put 26 idiv dup 0 eq{pop exit}if}if /i i 1 sub D}loop
|
|
ST i ST length i sub GI}ie}
|
|
{m p cvs}ie} D
|
|
/US {matrix currentmatrix matrix defaultmatrix matrix invertmatrix
|
|
matrix concatmatrix transform} D
|
|
/GB {Gb{US}if}D
|
|
/Tl {/Rn E D Xc CP pop ne{
|
|
[/Rect [Xc 1 sub Yc cS 0.25 mul sub GB CP E 1 add E cS 0.85 mul add GB]
|
|
/Subtype /Link /Border [0 0 Cf Lc and LX and AU or{0}{1}ie] Rn type
|
|
/nametype eq {/Dest Rn}{/Action [/Subtype /URI /URI Rn] Cd}ie
|
|
/ANN pdfmark}if} D
|
|
/Il {/Rn E D [/Rect [Xc Yc GB Xc XS add Yc YS add GB] /Subtype /Link
|
|
/Border [0 0 0] Rn type /nametype eq{/Dest Rn}
|
|
{/Action [/Subtype /URI /URI Rn] Cd}ie /ANN pdfmark} D
|
|
/XP {[{/Z Bz 2 div D Z 0 R Z Z RL Z neg Z RL Z neg Z neg RL Z Z neg RL}
|
|
{Bz 0 RL 0 Bz RL Bz neg 0 RL 0 Bz neg RL}
|
|
{0 -5 R Bz 0 RL 0 21 RL Bz neg 0 RL 0 -21 RL}]} D
|
|
/MS {/Sm E D WB}D
|
|
/O {BN()Sm BX} D
|
|
/BX {/Bt E D Bt 2 lt{CS 0.8 mul}{11 mul}ie W XO sub MR sub 2 copy gt{E}if pop
|
|
/HZ E D WB Bt 2 eq{HZ ST cvs ( ) join}{()}ie
|
|
Bt ST cvs join ( Bx ) join HM{( ) Pd}if
|
|
L1 HZ add XO add MR add W gt{NL}if C1 E join /C1 E D /L1 L1 HZ add D /T f D
|
|
( ) WB Bt 2 lt{YA CS .8 mul lt{/YA CS .8 mul D}if}
|
|
{YB 5 lt{/YB 5 D}if YA 21 lt{/YA 21 D}if}ie /CI 0 D} D
|
|
/Bx {dup 2 eq{E /Bz E D}{/Bz CS .8 mul D}ie
|
|
OU {gsave 0 Sg XP E get exec stroke grestore}{pop}ie Bz 0 R /Ms t D} D
|
|
/SD {FD 4 mul Dy add DZ NF newpath 0 0 M DX t charpath pathbbox
|
|
3 -1 roll sub /DY E D E dup /X1 E D sub WM mul WX DY mul add WM DG mul E div
|
|
/DF E D /DR WX DF mul DY mul WM div 2 div D} d
|
|
/Sd {gsave 0 IL Di mul neg translate IL IW atan Di 0 eq{neg}if rotate
|
|
FD 4 mul Dy add DZ NF DR X1 sub DY 2 div neg M cD VC DX show grestore} d
|
|
/RC {/AI 0 D /LG 0 D /BC 0 D /UI 0 D /PF f D /Cc 0 D /Dc 10 array D
|
|
/NR [0 1 9{pop 0}for] D /La Ds D /AR 10 array D /TR 10 array D /AV 30 array D
|
|
SI /AL -1 D /AT A0 D AT NA /OV 9 array D /Yo 0 D /Co 0 D /Io 0 D /Hy f D
|
|
/Ph f D /CL -1 D Ct Sc}D
|
|
/ZF {/FR [0 1 30{pop 0}for] D /SZ [0 1 30{pop 0}for] D /FO [0 1 30{pop 0}for] D
|
|
/SL 0 D /CF 0 D /FN 0 D 0 Ts SF}D
|
|
/QO [[(\253\240)(\232)(\234)(\233)(\253)(\273)][(\253\240)(\231)(')(`)(\253)(\273)]] D
|
|
/QC [[(\240\273)(\233)(\234)(\234)(\273)(\253)][(\240\273)(`)(')(')(\273)(\253)]] D
|
|
/Hf EF length 2 sub D
|
|
/Hz EZ Hf get D
|
|
/HS Ey Hf get D
|
|
/Fz EZ Hf 1 add get D
|
|
/Fs Ey Hf 1 add get D
|
|
/LE IL D
|
|
/Ps EZ 1 get D
|
|
/Fp EF 1 get D
|
|
/XO 0 D
|
|
/YI 0 D
|
|
/CI 0 D
|
|
/FP 0 D
|
|
/WW Ts 7 mul D
|
|
/Mf 0 D
|
|
/YA 0 D
|
|
/YB 0 D
|
|
/Cs Ts D
|
|
/GS Ts D
|
|
/F0 0 D
|
|
/NS 0 D
|
|
/NB 0 D
|
|
/N 0 D
|
|
/C0 [] D
|
|
/C1 () D
|
|
/Lo 0 D
|
|
/L1 0 D
|
|
/LM 0 D
|
|
/PH 0 D
|
|
/EC 0 D
|
|
/Lh 0 D
|
|
/LT 0 D
|
|
/CH 1 string D
|
|
/ST 16 string D
|
|
/CA 9 array D
|
|
/HC (\255) D
|
|
/HM f D
|
|
/PF f D
|
|
/EN f D
|
|
/TB f D
|
|
/UF f D
|
|
/sF f D
|
|
/AE f D
|
|
/AF f D
|
|
/BP t D
|
|
/CD f D
|
|
/PA t D
|
|
/GL f D
|
|
/T t D
|
|
/HF f D
|
|
/AH f D
|
|
/SA f D
|
|
/PB f D
|
|
/f1 f D
|
|
/mF f D
|
|
/OX 0 D
|
|
/OY 0 D
|
|
/FY 0 D
|
|
/EO 0 D
|
|
/FB 0 D
|
|
/PL 0 D
|
|
/Bw 0 D
|
|
/PD -1 D
|
|
/TP f D
|
|
/TH t D
|
|
/Ty 4 D
|
|
/Tn -1 D
|
|
/Fl t D
|
|
/LB t D
|
|
/PM 1 D
|
|
/Ms f D
|
|
/Ba f D
|
|
/Bb f D
|
|
/Hl 3 D
|
|
/hl 6 D
|
|
/hL 6 D
|
|
/Hs f D
|
|
/HI 0 D
|
|
/hi 0 D
|
|
/PO t D
|
|
/TE f D
|
|
/LF t D
|
|
/BO 0 D
|
|
/Sm 1 D
|
|
/Bf 3 D
|
|
/A1 0 D
|
|
/A2 0 D
|
|
/Ds 3 D
|
|
/QL -1 D
|
|
/Cb Db D
|
|
/Ct Dt D
|
|
/Cl Dl D
|
|
[/Creator (html2ps version 1.0 beta1) /Author () /Keywords () /Subject ()
|
|
/Title (A Python Quick Reference) /DOCINFO pdfmark
|
|
/ND 1 D
|
|
/HN [1 1 96{pop (??)}for] D
|
|
/h1 [(1\240\240)(Python 1.52 Quick Reference)] D
|
|
/h2 [(1.1\240\240)(Contents)] D
|
|
/h3 [(1.2\240\240)(Invocation Options)] D
|
|
/h4 [(1.3\240\240)(ENVIRONMENT VARIABLES)] D
|
|
/h5 [(1.4\240\240)(Terms Used In This Document)] D
|
|
/h6 [(1.5\240\240)(Notable lexical entities)] D
|
|
/h7 [(1.5.1\240\240)(Keywords)] D
|
|
/h8 [(1.5.2\240\240)(Identifiers)] D
|
|
/h9 [(1.5.3\240\240)(Operators)] D
|
|
/h10 [(1.5.4\240\240)(Strings)] D
|
|
/h11 [(1.5.4.1\240\240)(String Literal Escapes)] D
|
|
/h12 [(1.5.5\240\240)(Numbers)] D
|
|
/h13 [(1.5.6\240\240)(Sequences)] D
|
|
/h14 [(1.5.7\240\240)(Dictionaries \201Mappings\202)] D
|
|
/h15 [(1.6\240\240)(Basic Types and Their Operations)] D
|
|
/h16 [(1.6.1\240\240)(Comparisons \201defined between *any* types\202)] D
|
|
/h17 [(1.6.2\240\240)(Boolean values and operators)] D
|
|
/h18 [(1.6.3\240\240)(None)] D
|
|
/h19 [(1.6.4\240\240)(Numeric types)] D
|
|
/h20 [(1.6.4.1\240\240)(Floats, integers and long integers.)] D
|
|
/h21 [(1.6.4.2\240\240)(Operators on all numeric types)] D
|
|
/h22 [(1.6.4.3\240\240)(Bit operators on integers and long integers)] D
|
|
/h23 [(1.6.4.4\240\240)(Complex Numbers)] D
|
|
/h24 [(1.6.4.5\240\240)(Numeric exceptions)] D
|
|
/h25 [(1.6.5\240\240)(Operations on all sequence types \201lists, tuples, strings\202)] D
|
|
/h26 [(1.6.6\240\240)(Operations on mutable \201=modifiable\202 sequences \201lists\202)] D
|
|
/h27 [(1.6.7\240\240)(Operations on mappings \201dictionaries\202)] D
|
|
/h28 [(1.6.8\240\240)(Format operator for strings \201%\202)] D
|
|
/h29 [(1.6.8.1\240\240)(Uses C printf format codes :)] D
|
|
/h30 [(1.6.9\240\240)(File Objects)] D
|
|
/h31 [(1.6.9.1\240\240)(Operators on file objects)] D
|
|
/h32 [(1.6.9.2\240\240)(File Exceptions)] D
|
|
/h33 [(1.7\240\240)(Advanced Types)] D
|
|
/h34 [(1.8\240\240)(Statements)] D
|
|
/h35 [(1.8.1\240\240)(Control Flow)] D
|
|
/h36 [(1.8.2\240\240)(Exception Statements)] D
|
|
/h37 [(1.8.3\240\240)(Name Space Statements)] D
|
|
/h38 [(1.8.4\240\240)(Function Definition)] D
|
|
/h39 [(1.8.5\240\240)(Class Definition)] D
|
|
/h40 [(1.8.5.1\240\240)(Documentation Strings)] D
|
|
/h41 [(1.8.6\240\240)(Others)] D
|
|
/h42 [(1.9\240\240)(Built-In Functions)] D
|
|
/h43 [(1.10\240\240)(Built-In Exceptions)] D
|
|
/h44 [(1.11\240\240)(Standard methods & operators redefinition in classes)] D
|
|
/h45 [(1.11.1\240\240)(Special methods for any class)] D
|
|
/h46 [(1.11.2\240\240)(Operators)] D
|
|
/h47 [(1.12\240\240)(Special informative state attributes for some types:)] D
|
|
/h48 [(1.13\240\240)(Important Modules)] D
|
|
/h49 [(1.14\240\240)(List of modules in base distribution)] D
|
|
/h50 [(1.14.1\240\240)(Contents of Lib directory \201Python 1.52 NT distribution, may be slightly different in other distributions\202)] D
|
|
/h51 [(1.14.2\240\240)()] D
|
|
/h52 [(1.14.3\240\240)(\201following list not revised\202 * Built-ins *)] D
|
|
/h53 [(1.14.4\240\240)(* Standard *)] D
|
|
/h54 [(1.14.5\240\240)(* Unix/Posix *)] D
|
|
/h55 [(1.14.6\240\240)(* Tk User-interface Toolkit *)] D
|
|
/h56 [(1.14.7\240\240)(* Multimedia *)] D
|
|
/h57 [(1.14.8\240\240)(* Cryptographic Extensions *)] D
|
|
/h58 [(1.14.9\240\240)(* Stdwin * Standard Window System)] D
|
|
/h59 [(1.14.10\240\240)(* SGI IRIX * \2014 & 5\202)] D
|
|
/h60 [(1.14.11\240\240)(* Suns *)] D
|
|
/h61 [(1.15\240\240)(Workspace exploration and idiom hints)] D
|
|
/h62 [(1.16\240\240)(Python Mode for Emacs)] D
|
|
/h63 [(1.17\240\240)(The Python Debugger)] D
|
|
/h64 [(1.17.1\240\240)(Accessing)] D
|
|
/h65 [(1.17.2\240\240)(Commands)] D
|
|
/h66 [(1.17.3\240\240)(Example)] D
|
|
/h67 [(1.17.4\240\240)(Quirks)] D
|
|
/Hr [29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
|
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
|
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95]D
|
|
/HV [1 2 2 2 2 2 3 3 3 3 4 3 3 3 2 3 3 3 3 4 4 4 4 4 3 3 3 3 4 3 4 4 2
|
|
2 3 3 3 3 3 4 3 2 2 2 3 3 2 2 2 3 3 3 3 3 3 3 3 3 3 3 2 2 2 3 3 3 3]D
|
|
/Cn [17 0 0 0 0 7 0 0 0 1 0 0 0 0 9 0 0 0 5 0 0 0 0 0 0 0 0 1 0 2 0 0 0
|
|
6 0 0 0 0 1 0 0 0 0 2 0 0 0 0 11 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0]D
|
|
Hr length 0 gt{[/PageMode /UseOutlines /DOCVIEW pdfmark}if
|
|
/Hn 1 D
|
|
0 1 Hr length 1 sub{
|
|
/Bn E D [Cn Bn get dup 0 gt{/Count E HV Bn get Bl ge{neg}if}{pop}ie
|
|
/Dest Hr Bn get dup abs ST cvs cvn E 0 ge{(h)Hn ST cvs join cvx exec dup 1 get
|
|
E Nf{0 get E join}{pop}ie /Hn Hn 1 add D}{()}ie /Title E /OUT pdfmark}for
|
|
ZF /FN Fp D Ps 0 FS /WC Wf{( )}{<A1A1>}ie SW pop D
|
|
ET RC ZF
|
|
/Df f D
|
|
/R1 (http://www.python.org/) D
|
|
/TS {
|
|
tables E get /table E D
|
|
table aload pop /rdesc E D /cdesc E D /tdesc E D
|
|
tdesc aload pop /capalg E D /caption E D /rules E D /frame E D /nfoot E D
|
|
/nhead E D /ncol E D /nrow E D /border E D /twid E D /units E D /talign E D
|
|
/flow E D /clear E D /tclass E D pop pop
|
|
/w W D /eps 0.1 D /OU f D /PL 1 D
|
|
/FN EF 21 get D EZ 21 get Ey 21 get FS
|
|
0 1 1{
|
|
/pass E D
|
|
0 1 nrow{
|
|
/irow E D
|
|
/cells rdesc irow get 6 get D
|
|
0 1 ncol{
|
|
/icol E D
|
|
/cell cells icol get D
|
|
cell 0 ne{
|
|
cell aload pop /CB E D pop pop pop
|
|
/DV E D /bot E D /top E D /right E D /left E D /nowrap E D /valign E D
|
|
/dp E D /align E D /rspan E D /cspan E D /cclass E D /ctype E D /cmax E D
|
|
/cmin E D /proc E D
|
|
rspan 0 eq{/rspan nrow irow sub 1 add D}if
|
|
cspan 0 eq{/cspan ncol icol sub 1 add D}if
|
|
pass 0 eq cspan 1 eq and pass 1 eq cspan 1 gt and or{
|
|
/W 1e5 D /LL W D /PH 1 D
|
|
ctype 1 eq{() BD}if
|
|
RC align NA
|
|
AT 4 eq{/CD t D /DC dp D /LN 0 D /M1 0 D /M2 0 D}{/CD f D}ie
|
|
0 0 M /LM 0 D proc exec BN
|
|
AT 4 eq{
|
|
LN array astore cell 15 3 -1 roll put
|
|
cdesc icol get dup dup 5 get M1 lt{5 M1 put}{5 get /M1 E D}ie
|
|
dup 6 get M2 lt{6 M2 put}{6 get /M2 E D}ie
|
|
/LM M1 M2 add D
|
|
}if
|
|
/CD f D
|
|
/thiswid LM left add right add eps add D
|
|
/oldmin 0 D /oldmax 0 D
|
|
0 1 cspan 1 sub{
|
|
icol add cdesc E get dup 2 get /oldmax E oldmax add D
|
|
1 get /oldmin E oldmin add D
|
|
}for
|
|
thiswid oldmax ge{
|
|
0 1 cspan 1 sub{
|
|
icol add cdesc E get dup 2 E 2 get oldmax 0 eq
|
|
{pop thiswid cspan div}{thiswid mul oldmax div}ie
|
|
put
|
|
}for
|
|
}if
|
|
nowrap 1 eq{
|
|
thiswid oldmin ge{
|
|
0 1 cspan 1 sub{
|
|
icol add cdesc E get dup 1 E 1 get oldmin 0 eq
|
|
{pop thiswid cspan div}{thiswid mul oldmin div}ie
|
|
put
|
|
}for
|
|
}if
|
|
}{
|
|
/W 0 D /LL W D /PH 2 D
|
|
ctype 1 eq{() ES () BD}if
|
|
0 0 M /LM 0 D RC proc exec BN
|
|
/thiswid LM left add right add eps add D
|
|
thiswid oldmin ge{
|
|
0 1 cspan 1 sub{
|
|
icol add cdesc E get dup 1 E 1 get oldmin 0 eq
|
|
{pop thiswid cspan div}{thiswid mul oldmin div}ie
|
|
put
|
|
}for
|
|
}if
|
|
}ie
|
|
ctype 1 eq{() ES}if
|
|
}if
|
|
}if
|
|
}for
|
|
}for
|
|
}for
|
|
/tmin 0 D /tmax 0 D
|
|
0 1 ncol{
|
|
cdesc E get dup 1 get E 2 get 2 copy gt{pop dup}if
|
|
tmax add /tmax E D tmin add /tmin E D
|
|
}for
|
|
twid 0 lt{twid neg IW gt{IW neg}{twid}ie /twid E D}if
|
|
tdesc 0 twid neg tmin 2 copy lt{E}if pop put
|
|
tdesc 1 twid neg tmax 2 copy lt{E}if pop put
|
|
/W w D /LL W D /OU t D /PH 0 D /PL 0 D
|
|
} D
|
|
/PT {
|
|
/PL PL 1 add D
|
|
tables E get /table E D Tm 21 get Ts mul BE
|
|
PL 2 ge{save}if
|
|
/SL SL 1 add D /FN EF 21 get D EZ 21 get Ey 21 get FS
|
|
table aload pop /rdesc E D /cdesc E D /tdesc E D
|
|
tdesc aload pop /capalg E D /caption E D /rules E D /frame E D /nfoot E D
|
|
/nhead E D /ncol E D /nrow E D /border E D /twid E D /units E D /talign E D
|
|
/flow E D /clear E D /tclass E D /tmax E D /tmin E D
|
|
/w W D /xo XO D /mr MR D /ll LL D /lg LG D /ai AI D /bc BC D /nr NR D /ar AR D
|
|
/tr TR D /ui UI D /ph PH D /a0 A0 D /pf PF D /at AT D /av AV D /al AL D
|
|
/Le LE D /la La D
|
|
talign 0 lt{/talign AL 0 gt{AV AL get}{A0 2 le{A0}{0}ie}ie D}if
|
|
ph 1 eq ph 2 eq or{
|
|
NL ph 1 eq{tmax}{tmin}ie dup XO add LM gt{/LM E XO add D}{pop}ie LM E
|
|
}{
|
|
/PH 3 D /LE 1e5 D RC %ZF
|
|
border 0 gt{/border 1 D}if
|
|
/twidth 0 D /avail W xo sub D
|
|
twid 0 eq{0 1 ncol{cdesc E get dup 2 get E 3 get dup 0 gt{div neg dup twid lt
|
|
{/twid E D}{pop}ie}{pop pop}ie}for}if
|
|
/twid twid dup 0 lt{neg avail 2 copy gt{E}if pop}{avail mul}ie D
|
|
/OK t D 0 1 ncol{cdesc E get dup 1 get E 3 get twid mul gt{/OK f D}if}for
|
|
0 1 ncol{
|
|
cdesc E get dup 1 get /colmin E D dup 3 get /cwid E twid mul D dup
|
|
tmax avail le{2 get}if
|
|
tmin avail le tmax avail gt and{
|
|
dup 2 get E 1 get dup 3 1 roll sub avail tmin sub mul tmax tmin sub div add
|
|
}if
|
|
tmin avail gt{1 get}if
|
|
0 E colmin cwid lt OK and{pop cwid}if dup /twidth E twidth add D put
|
|
}for
|
|
/OU f D CP
|
|
tmin twid le{
|
|
0 1 ncol{cdesc E get dup 0 get twidth div twid mul 0 E put}for
|
|
/twidth twid D
|
|
}if
|
|
CP printcap CP E pop sub /caphig E D pop
|
|
0 1 1{
|
|
/pass E D
|
|
0 1 nrow{
|
|
/irow E D
|
|
/cells rdesc irow get 6 get D
|
|
0 1 ncol{
|
|
/icol E D
|
|
/cell cells icol get D
|
|
cell 0 ne{
|
|
cell aload pop /CB E D pop pop pop
|
|
/DV E D /bot E D /top E D /right E D /left E D /nowrap E D /valign E D
|
|
/dp E D /align E D /rspan E D /cspan E D /cclass E D /ctype E D /cmax E D
|
|
/cmin E D /proc E D
|
|
rspan 0 eq{/rspan nrow irow sub 1 add D}if
|
|
cspan 0 eq{/cspan ncol icol sub 1 add D}if
|
|
/W 0 D
|
|
0 1 cspan 1 sub{icol add cdesc E get 0 get /W E W add D}for
|
|
pass 0 eq rspan 1 eq and pass 1 eq rspan 1 gt and or{
|
|
ctype 1 eq{() BD}if
|
|
/W W left sub right sub D /XO 0 D /EO 0 D SI
|
|
/A0 align D RC align NA
|
|
AT 4 eq{
|
|
/DC dp D /DO 0 D /ID 1 D
|
|
0 1 DV length 1 sub{DV E get dup DO gt{/DO E D}{pop}ie}for
|
|
/Lo DO DV 0 get sub D /L1 Lo D
|
|
}if
|
|
0 0 M /BP t D /Fl t D /MF 0 D /FB 0 D
|
|
proc exec T not{/CI 0 D}if BN 0 FB neg R MF 0 eq{/MF CS D}if
|
|
CP /thishig E neg bot add top add CI add D pop
|
|
cell 16 MF put cell 17 Ya put cell 18 thishig put
|
|
valign 4 eq{
|
|
/below thishig Ya sub D
|
|
rdesc irow get dup dup 4 get Ya lt
|
|
{4 Ya put}{4 get /Ya E D}ie
|
|
dup 5 get below lt{5 below put}{5 get /below E D}ie
|
|
/thishig Ya below add D
|
|
}if
|
|
ctype 1 eq{()ES}if
|
|
/oldhig 0 D
|
|
0 1 rspan 1 sub{
|
|
irow add rdesc E get 0 get /oldhig E oldhig add D
|
|
}for
|
|
thishig oldhig ge{
|
|
0 1 rspan 1 sub{
|
|
irow add rdesc E get dup 0 E 0 get oldhig 0 eq
|
|
{pop thishig rspan div}{thishig mul oldhig div}ie
|
|
put
|
|
}for
|
|
}if
|
|
}if
|
|
}if
|
|
}for
|
|
}for
|
|
}for M RC %ZF
|
|
/thight 0 D /racc 0 D /maxh 0 D /brk 0 D /rbeg nhead nfoot add D
|
|
rbeg 1 nrow{
|
|
rdesc E get dup 0 get dup /thight E thight add D
|
|
brk 0 eq{/racc E D}{/racc E racc add D}ie
|
|
racc maxh gt{/maxh racc D}if 2 get /brk E D
|
|
}for
|
|
ph 3 ge{thight caphig add E}if
|
|
ph 0 eq ph 4 eq or{
|
|
/PH 4 D /LE Le D /OU Ou D /yoff 0 D /headsz 0 D
|
|
0 1 nhead 1 sub{rdesc E get 0 get headsz add /headsz E D}for
|
|
/footsz 0 D
|
|
0 1 nfoot 1 sub{rdesc E nhead add get 0 get footsz add /footsz E D}for
|
|
/ahig LE BO add MI add D /maxh maxh headsz add footsz add D
|
|
/thight thight headsz add footsz add D
|
|
tmin avail gt maxh ahig gt or
|
|
{/Sf avail tmin div dup ahig maxh div gt{pop ahig maxh div}if D /SA t D}
|
|
{/Sf 1 D}ie
|
|
tclass 1 eq thight LE 15 sub gt and
|
|
{/SA t D LE 15 sub thight div dup Sf lt{/Sf E D}{pop}ie}if
|
|
SA{Sf Sf scale /ll ll Sf div D /xo xo Sf div D /LE LE Sf div D
|
|
/mr mr Sf div D /BO BO Sf div D /ahig ahig Sf div D}if
|
|
nhead nfoot add getwid
|
|
LE CP E pop add capalg 0 eq{caphig sub}if dup headsz sub footsz sub rwid lt
|
|
E thight lt thight ahig lt and or{NP}if
|
|
capalg 0 eq{printcap -8 SP}if
|
|
CP /ycur E D pop
|
|
printhead
|
|
rbeg 1 nrow{/row E D row
|
|
getwid
|
|
ycur yoff add rwid sub footsz sub LE add 0 lt
|
|
{nfoot 0 gt{printfoot}if Tf NP /rbeg irow1 D
|
|
Ba{MI /MI MI SA{Sf div}if D MI SP /MI E D}if
|
|
CP /ycur E D pop /yoff 0 D printhead}if
|
|
irow1 printrow
|
|
}for
|
|
printfoot /row row 1 add D Tf
|
|
0 ycur yoff add M
|
|
capalg 1 eq{/EO 0 D SI -3 SP printcap}if
|
|
Sf 1 lt{1 Sf div dup scale /ll ll Sf mul D /xo xo Sf mul D /LE LE Sf mul D
|
|
/mr mr Sf mul D /BO BO Sf mul D /SA f D}if
|
|
/EO 0 D
|
|
}if
|
|
}ie
|
|
/W w D /XO xo D /MR mr D /LL ll D /LG lg D /AI ai D /BC bc D /NR nr D /AR ar D
|
|
/TR tr D /UI ui D /PH ph D /A0 a0 D /PF pf D /AT at D /AV av D /AL al D
|
|
/La la D
|
|
/SL SL 1 sub NN D /CF 0 D /FN 0 D SZ SL get FR SL get FS Wf not{()F2}if
|
|
PL 2 ge{Ms E restore Ms or /Ms E D PH 1 eq PH 2 eq or
|
|
{/LM E D}if PH 3 ge{/CI 0 D NL 0 E neg R}if
|
|
}if
|
|
/PL PL 1 sub D /CI 0 D /BP f D /PO f D () Bm 21 get Ts mul BE BL %CF CS SF
|
|
} D
|
|
/printcap{
|
|
capalg 0 ge{
|
|
SA{/W w Sf div D}
|
|
{talign 1 eq{/XO xo ll twidth sub 2 div add D}if
|
|
talign 2 eq{/XO xo ll twidth sub add D}if
|
|
/W XO twidth add D
|
|
}ie /XO xo D /LL W XO sub MR sub D
|
|
/PA f D /Fl capalg 0 eq D
|
|
1 NA BL caption exec BN OA /PA t D
|
|
}if
|
|
} D
|
|
/getwid{
|
|
/irow1 E D
|
|
/irow2 irow1 D
|
|
/rwid 0 D
|
|
{rdesc irow2 get dup 0 get rwid add /rwid E D 2 get 0 eq
|
|
{exit}{/irow2 irow2 1 add D}ie
|
|
}loop
|
|
} D
|
|
/printrow{
|
|
/xoff ll twidth PL 2 ge{Sf div}if sub talign mul 2 div D
|
|
/xleft xoff xo add D
|
|
/irow E D
|
|
/cells rdesc irow get 6 get D
|
|
0 1 ncol{
|
|
/icol E D
|
|
/cell cells icol get D
|
|
cell 0 ne{
|
|
cell aload pop /CB E D /cvsize E D /above E D /fontsz E D
|
|
/DV E D /bot E D /top E D /right E D /left E D /nowrap E D /valign E D
|
|
/dp E D /align E D /rspan E D /cspan E D /cclass E D /ctype E D /cmax E D
|
|
/cmin E D /proc E D
|
|
rspan 0 eq{/rspan nrow irow sub 1 add D}if
|
|
cspan 0 eq{/cspan ncol icol sub 1 add D}if
|
|
/width 0 D
|
|
0 1 cspan 1 sub{icol add cdesc E get 0 get /width E width add D}for
|
|
/rhight rdesc irow get 0 get D
|
|
/hight rhight D
|
|
1 1 rspan 1 sub{irow add rdesc E get 0 get /hight E hight add D}for
|
|
/W xo xoff add width add right sub D
|
|
/EO xo xoff add left add D SI
|
|
Cf{
|
|
gsave CB VC xo xoff add ycur yoff add M
|
|
0 hight neg RL width 0 RL 0 hight RL width neg 0 RL fill
|
|
grestore
|
|
}if
|
|
ctype 1 eq{() BD}if
|
|
/A0 align D RC
|
|
AT 4 eq{
|
|
/DC dp D /ID 1 D /DO cdesc icol get 5 get D /Lo DO DV 0 get sub D /L1 Lo D
|
|
}if
|
|
valign 3 le{0 ycur yoff add top sub
|
|
hight cvsize sub valign 1 sub mul 2 div sub M}
|
|
{0 ycur yoff add top sub above add rdesc irow get 4 get sub M}ie
|
|
/PA f D /BP t D /Fl t D
|
|
BL proc exec BN
|
|
/PA t D
|
|
ctype 1 eq{() ES}if
|
|
}if
|
|
/xoff xoff cdesc icol get 0 get add D
|
|
}for
|
|
/yoff yoff rhight sub D
|
|
} D
|
|
/printhead {0 1 nhead 1 sub{printrow}for} D
|
|
/printfoot {nhead 1 nhead nfoot add 1 sub{printrow}for} D
|
|
/Tf {
|
|
OU{rules 2 ge{/yoff 0 D
|
|
gsave 0 Sg
|
|
[0 1 nhead 1 sub{}for rbeg 1 row 1 sub{}for nhead 1 nhead nfoot add 1 sub{}for]{
|
|
/irow E D
|
|
/xoff ll twidth PL 2 ge{Sf div}if sub talign mul 2 div D
|
|
/cells rdesc irow get 6 get D
|
|
0 1 ncol{
|
|
/icol E D
|
|
/cell cells icol get D
|
|
cell 0 ne{
|
|
/rspan cell 6 get D
|
|
/cspan cell 5 get D
|
|
rspan 0 eq{/rspan nrow irow sub 1 add D}if
|
|
cspan 0 eq{/cspan ncol icol sub 1 add D}if
|
|
/width 0 D
|
|
0 1 cspan 1 sub{icol add cdesc E get 0 get /width E width add D}for
|
|
/rhight rdesc irow get 0 get D
|
|
/hight rhight D
|
|
1 1 rspan 1 sub{irow add rdesc E get 0 get /hight E hight add D}for
|
|
xo xoff add width add ycur yoff add M
|
|
0 hight neg icol cspan add 1 sub ncol lt
|
|
{cdesc icol 1 add get 4 get dup rules 3 le{1 eq}{pop t}ie
|
|
{1 eq{0.8}{0.3}ie
|
|
LW RL CP stroke M}{pop R}ie}{R}ie
|
|
irow nhead nfoot add 1 sub ne nfoot 0 eq or
|
|
{irow rspan add 1 sub nrow lt
|
|
{rdesc irow rspan add get 3 get}{nfoot 0 eq{0}{1}ie}ie
|
|
dup rules 2 mod 0 eq{1 eq}{pop t}ie
|
|
{1 eq irow rspan add nhead eq or irow rspan add row eq nfoot 0 gt and or
|
|
{0.8}{0.3}ie LW width neg 0 RL CP stroke M}{pop}ie}if
|
|
}if
|
|
/xoff xoff cdesc icol get 0 get add D
|
|
}for
|
|
/yoff yoff rhight sub D
|
|
}forall
|
|
grestore
|
|
/Ms t D
|
|
}if
|
|
frame 1 gt{
|
|
gsave
|
|
1 LW 0 Sg
|
|
xleft ycur M CP BB
|
|
0 yoff frame 5 eq frame 7 ge or{RL}{R}ie
|
|
twidth 0 frame 3 eq frame 4 eq or frame 8 ge or{RL}{R}ie CP BB
|
|
0 yoff neg frame 6 ge{RL}{R}ie
|
|
twidth neg 0 frame 2 eq frame 4 eq or frame 8 ge or{RL}{R}ie
|
|
closepath stroke
|
|
grestore
|
|
/Ms t D
|
|
}if
|
|
}if
|
|
} D
|
|
/tables [[[0 0 0 0 0 -1 0 0.6 1 9 2 0 0 9 5 {()} -1]
|
|
[[0 0 0 0 0 0 0][0 0 0 0 0 0 0][0 0 0 0 0 0 0]]
|
|
[[0 0 0 0 0 0 [[{()3 Sl()WB()BD(Operation)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#CC 16#99] ]
|
|
[{()3 Sl()WB()2 Al()BD(Result)ES()Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#CC 16#99] ]
|
|
[{()3 Sl()WB()BD(Notes)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#CC 16#99] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(x)ES( )BD(in)ES( )I(s)ES()Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(1 if an item of )I(s)ES( is equal to )I(x)ES(, else 0)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(x)ES( )BD(not in)ES( )I(s)ES()Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(0 if an item of )I(s)ES( is equal to )I(x)ES(, else 1)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\240)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(s)ES( )BD(+)ES( )I(t)ES()Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(the concatenation of )I(s)ES( and )I(t)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(s )ES()BD(*)ES( )I(n)ES(, )I(n)ES()BD(*)ES()I(s)ES()Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()I(n)ES( copies of )I(s)ES( concatenated)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\240)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(s)ES()BD([)ES()I(i)ES()BD(])ES()Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()I(i)ES('th item of )I(s)ES(, origin 0)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\2011\202)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(s)ES()BD([)ES()I(i)ES()BD(:)ES()I(j)ES()BD(])ES()Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(slice of )I(s)ES( from )I(i)ES( \201included\202 to )I(j)ES( \201excluded\202)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\2011\202, \2012\202)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()BD(len)ES(\201)I(s)ES(\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(length of )I(s)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()BD(min)ES(\201)I(s)ES(\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(smallest item of )I(s)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\240)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()BD(max)ES(\201)I(s)ES(\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(largest item of )I(\201s)ES(\202)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\240)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
]]
|
|
[[0 0 0 0 0 -1 0 0.7 1 12 2 0 0 9 5 {()} -1]
|
|
[[0 0 0 0 0 0 0][0 0 0 0 0 0 0][0 0 0 0 0 0 0]]
|
|
[[0 0 0 0 0 0 [[{()3 Sl()WB()BD(Operation)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#CC 16#99] ]
|
|
[{()3 Sl()WB()2 Al()BD(Result)ES()Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#CC 16#99] ]
|
|
[{()3 Sl()WB()BD(Notes)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#CC 16#99] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(s)ES()BD([)ES()I(i)ES()BD(])ES( )BD(=)ES()I(x)ES()Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(item )I(i)ES( of )I(s)ES( is replaced by )I(x)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()I(s)ES([)I(i)ES(:)I(j)ES(] )BD(=)ES( )I(t)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(slice of )I(s)ES( from )I(i)ES( to )I(j)ES( is replaced by )I(t)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\240)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()BD(del)ES( )I(s)ES([)I(i)ES(:)I(j)ES(])Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(same as )3 FZ()I(s)ES([)I(i)ES(:)I(j)ES(]
|
|
= [])Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(s)ES(.)BD(append)ES(\201)I(x)ES(\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(same as )3 FZ()I(s)ES([len\201)I(s)ES(\202 : len\201)I(s)ES(\202]
|
|
= [)I(x)ES(])Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\240)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(s)ES(.)BD(extend)ES(\201)I(x)ES(\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(same as )3 FZ()I(s)ES([len\201)I(s)ES(\202:len\201)I(s)ES(\202]=
|
|
)I(x)ES()Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(\240\240 \2015\202)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(s)ES(.)BD(count)ES(\201)I(x)ES(\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(return number of )I(i)ES('s for which )3 FZ()I(s)ES([)I(i)ES(]
|
|
== )I(x)ES()Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(s)ES(.)BD(index)ES(\201)I(x)ES(\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(return smallest )I(i)ES( such that )3 FZ()I(s)ES([)I(i)ES(]
|
|
== )I(x)ES()Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\2011\202)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(s)ES(.)BD(insert)ES(\201)I(i)ES(, )I(x)ES(\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(same as )3 FZ()I(s)ES([)I(i)ES(:)I(i)ES(]
|
|
= [)I(x)ES(])Ef( if )I(i)ES( >= 0)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(s)ES(.)BD(remove)ES(\201)I(x)ES(\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(same as )3 FZ(del )I(s)ES([)I(s)ES(.index\201)I(x)ES(\202])Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\2011\202)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(s)ES(.)BD(pop)ES(\201)BD([)ES()I(i)ES()BD(])ES(\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(same as x = s[i]; del s[i]; return x)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(\240\240 \2014\202)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(s)ES(.)BD(reverse)ES(\201\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(reverse the items of )I(s)ES( in place)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\2013\202)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(s)ES(.)BD(sort)ES(\201)BD([)ES()I(cmpFct)ES()BD(])ES(\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(sort the items of )I(s)ES( in place)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\2012\202, \2013\202)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
]]
|
|
[[0 0 0 0 0 -1 0 0.7 1 12 2 0 0 9 5 {()} -1]
|
|
[[0 0 0 0 0 0 0][0 0 0 0 0 0 0][0 0 0 0 0 0 0]]
|
|
[[0 0 0 0 0 0 [[{()3 Sl()WB()BD(Operation)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#CC 16#99] ]
|
|
[{()3 Sl()WB()2 Al()BD(Result)ES()Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#CC 16#99] ]
|
|
[{()3 Sl()WB()BD(Notes)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#CC 16#99] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()BD(len)ES(\201)I(d)ES(\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(the number of items in )I(d)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(d)ES()BD([)ES()I(k)ES()BD(])ES()Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(the item of )I(d)ES( with key )I(k)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\2011\202)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(d)ES([)I(k)ES(] )BD(=)ES( x)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(set )I(d)ES([)I(k)ES(] to )I(x)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()BD(del)ES( )I(d)ES([)I(k)ES(])Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(remove )I(d)ES([)I(k)ES(] from )I(d)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\2011\202)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(d)ES(.)BD(clear)ES(\201\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(remove all items from )I(d)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(d)ES(.)BD(copy)ES(\201\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(a shallow copy of )I(d)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(d)ES(.)BD(has_key)ES(\201)I(k)ES(\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(1 if )I(d)ES( has key )I(k)ES(, else 0)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(d)ES(.)BD(items)ES(\201\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(a copy of )I(d)ES('s list of \201key, item\202 pairs)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\2012\202)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(d)ES(.)BD(keys)ES(\201\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(a copy of )I(d)ES('s list of keys)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\2012\202)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(d1)ES(.)BD(update)ES(\201)I(d2)ES(\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()3 FZ(for k, v in d2.items\201\202: d1[k] = v)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\2013\202)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(d)ES(.)BD(values)ES(\201\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(a copy of )I(d)ES('s list of values)} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\2012\202)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
[0 0 0 0 0 0 [[{()3 Sl()WB()3 FZ()I(d)ES(.)BD(get)ES(\201)I(k)ES(,)I(defaultval)ES(\202)Ef()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB(the item of )I(d)ES( with key )I(k)ES()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
[{()3 Sl()WB()2 Al(\2014\202)Ea()} 0 0 0 0 1 1 0 (.) 2 0 3 3 3 3 0 0 0 0 [16#FF 16#FF 16#CC] ]
|
|
]]
|
|
]]
|
|
] D
|
|
0 1 2{TS}for RC ZF
|
|
|
|
/Cb Db D /Ct [16#00 16#00 16#00] D /Cl [16#00 16#00 16#00] D /CL -1 D Ct Sc
|
|
|
|
/Ba f D /BO 0 D Bs
|
|
/UR (quick-ref1_52.html) D
|
|
/Ti (A Python Quick Reference) D
|
|
/Au () D
|
|
/Df f D
|
|
|
|
|
|
NP RC ZF
|
|
()3 Sl()WB 0 Sn(
|
|
|
|
)2 Al(
|
|
)0 1 0 H(Python)WB 29 Sn( 1.52 Quick Reference)EH()Ea(
|
|
|
|
)2 1 1 HR()BR()-1 Bf add FZ(\240)I(1999/06/04, upgraded by Richard Gruet, )0 2 A(rgruet@ina.fr)EA(
|
|
from V1.3 ref: 1995/10/30, by Chris Hoffmann, )0 2 A(choffman@vicorp.com)EA()ES()Ef(
|
|
)0 P()-1 Bf add FZ(Based on:)Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240 Python Bestiary, Author: Ken Manheimer,
|
|
ken.manheimer@nist.gov)Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240 Python manuals, Author: Guido van
|
|
Rossum, )0 2 A(guido@CNRI.Reston.Va.US)EA(,
|
|
)0 2 A(guido@python.org)EA()Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240 python-mode.el, Author: Tim Peters,
|
|
)0 2 A(tim_one@email.msn.com)EA()Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240 and the readers of )0 2 A(comp.lang.python)EA()Ef(
|
|
)0 P()-1 Bf add FZ(Python site: )R1 2 A(http://www.python.org)EA()Ef(
|
|
)BR()2 1 1 HR()0 2 1 H(Contents)WB 30 Sn()EH(
|
|
|
|
)UL()-1 LI()0 1 1 A(Invocation Options)1 0 TN TL()Ec /AF f D(
|
|
|
|
)-1 LI()0 2 1 A(Environment Variables)2 0 TN TL()Ec /AF f D(
|
|
|
|
)-1 LI()0 3 1 A(Terms Used In This Document)3 0 TN TL()Ec /AF f D(
|
|
|
|
)-1 LI()0 4 1 A(Lexical Entities)4 0 TN TL()Ec /AF f D(
|
|
|
|
)-1 LI()0 5 1 A(Basic Types And Their Operations)5 0 TN TL()Ec /AF f D(
|
|
|
|
)-1 LI()0 6 1 A(Advanced Types)6 0 TN TL()Ec /AF f D(
|
|
|
|
)-1 LI()0 7 1 A(Statements)7 0 TN TL()Ec /AF f D(
|
|
|
|
)-1 LI()0 8 1 A(Built In Functions)8 0 TN TL()Ec /AF f D(
|
|
|
|
)-1 LI()0 9 1 A(Built In Exceptions)9 0 TN TL()Ec /AF f D(
|
|
|
|
)-1 LI()0 10 1 A(Standard methods & operators redefinition
|
|
in user-created Classes)10 0 TN TL()Ec /AF f D(
|
|
|
|
)-1 LI()0 11 1 A(Special informative state attributes for some
|
|
types)11 0 TN TL()Ec /AF f D(
|
|
|
|
)-1 LI()0 12 1 A(Important Modules)12 0 TN TL()Ec /AF f D( : )0 13 1 A(sys)13 0 TN TL()Ec /AF f D(,
|
|
)0 14 1 A(os)14 0 TN TL()Ec /AF f D(,
|
|
)0 15 1 A(posix)15 0 TN TL()Ec /AF f D(,
|
|
)0 16 1 A(posixpath)16 0 TN TL()Ec /AF f D(,
|
|
)0 18 1 A(string)18 0 TN TL()Ec /AF f D(,
|
|
)0 19 1 A(re)19 0 TN TL()Ec /AF f D(,
|
|
)0 23 1 A(math)23 0 TN TL()Ec /AF f D(,
|
|
)0 24 1 A(getopt)24 0 TN TL()Ec /AF f D(
|
|
|
|
)-1 LI()0 25 1 A(List of modules In base distribution)25 0 TN TL()Ec /AF f D(
|
|
|
|
)-1 LI()0 26 1 A(Workspace Exploration And Idiom Hints)26 0 TN TL()Ec /AF f D(
|
|
|
|
)-1 LI()0 27 1 A(Python Mode for Emacs)27 0 TN TL()Ec /AF f D(
|
|
|
|
)-1 LI()0 28 1 A(The Python Debugger)28 0 TN TL()Ec /AF f D()LU(
|
|
|
|
)2 1 1 HR()0 2 2 H()WB 31 Sn()WB 1 Sn()EA(Invocation Options)EH(
|
|
|
|
) 27 80 PR()BD(python)ES( [-diOStuvxX?] [-c )I(command)ES( | )I(script)ES( | - ] [)I(args)ES(]
|
|
|
|
\240\240\240\240 -d\240\240 debug output from parser \201also PYTHONDEBUG=x\202
|
|
\240\240\240\240 -i\240\240 inspect interactively after running script \201also PYTHONINSPECT=x,.
|
|
\240\240\240\240\240\240\240\240\240 and force prompts, even if stdin appears not to be a terminal
|
|
\240\240\240\240 -O\240\240 optimize generated bytecode \201set __debug__ = 0 =>s suppresses )I(assert)ES(s\202
|
|
\240\240\240\240 -S\240\240 don't imply 'import site' on initialization
|
|
\240\240\240\240 -t\240\240 issue warnings about inconsistent tab usage \201-tt: issue errors\202
|
|
\240\240\240\240 -u\240\240 unbuffered binary stdout and stderr \201also PYTHONUNBUFFERED=x\202.
|
|
\240\240\240\240 -v\240\240 verbose \201trace import statements\202 \201also PYTHONVERBOSE=x\202
|
|
\240\240\240\240 -x\240\240 skip first line of source, allowing use of non-unix
|
|
\240\240\240\240\240\240\240\240\240 forms of #!cmd
|
|
\240\240\240\240 -X\240\240 disable class based built-in exceptions \201for backward
|
|
\240\240\240\240\240\240\240\240\240 compatibility management of exceptions\202
|
|
\240\240\240\240 -?\240\240 Help!
|
|
|
|
\240\240\240\240\240\240\240\240 -c )I(command
|
|
\240\240\240\240\240\240\240\240\240\240\240 )ES(Specify the command\240 to\240 execute\240 \201see\240 next\240 section\202.
|
|
\240\240\240\240\240\240\240\240\240\240\240 This\240 terminates the option list \201following options are
|
|
\240\240\240\240\240\240\240\240\240\240\240 passed as arguments to the command\202.
|
|
\240\240\240\240\240\240\240\240 )I(script)ES( is the name of a python file \201.py\202 to execute
|
|
\240\240\240\240\240\240\240\240 -\240 read from stdin.
|
|
\240\240\240\240\240
|
|
\240\240\240\240 anything afterward is passed as options to python script or
|
|
\240\240\240\240\240\240\240 command, not interpreted as an option to interpreter itself.
|
|
|
|
\240\240\240\240 )I(args)ES( are passed to script or command \201in sys.argv[1:]\202)RP(
|
|
If no script or command, Python enters interactive mode.\240
|
|
)2 1 1 HR()0 2 3 H()WB 32 Sn()WB 2 Sn()EA(ENVIRONMENT VARIABLES)EH(
|
|
|
|
)0 DL()DT(PYTHONHOME
|
|
|
|
)BR(\240\240\240\240\240\240\240\240\240 Alternate )I(prefix)ES(
|
|
directory \201or )I(prefix)ES(;)I(exec_prefix)ES(\202. The default module search
|
|
path uses )I(prefix)ES(/lib
|
|
)BR(PYTHONPATH
|
|
)DD(\240Augments the default search path for module files. The format is
|
|
the same as the shell's $PATH: one or more directory pathnames separated
|
|
by ':' or ';' without spaces around \201semi-\202colons!
|
|
|
|
)DD(On Windows first search for Registry key HKEY_LOCAL_MACHINE\200Software\200Python\200PythonCore\200v.x.y\200PythonPath
|
|
|
|
)BR(\201default value\202. You may also define a key named after your application
|
|
with a default string value giving
|
|
)BR(the root directory path of your app.
|
|
)DT(PYTHONSTARTUP
|
|
|
|
)DD(\240If this is the name of a readable file, the Python commands in that
|
|
file are executed before the first prompt is displayed in interactive mode
|
|
\201no default\202.
|
|
|
|
)DT(PYTHONDEBUG
|
|
|
|
)DD(\240If non-empty, same as -d option
|
|
|
|
)DT(PYTHONINSPECT
|
|
|
|
)DD(\240If non-empty, same as -i option
|
|
|
|
)DT(PYTHONSUPPRESS
|
|
|
|
)DD(\240If non-empty, same as -s option
|
|
|
|
)DT(PYTHONUNBUFFERED
|
|
|
|
)DD(\240If non-empty, same as -u option
|
|
|
|
)DT(PYTHONVERBOSE
|
|
|
|
)DD(\240If non-empty, same as -v option
|
|
|
|
)DT(PYTHONCASEOK --to be verified--
|
|
|
|
)DD(\240If non-empty, ignore case in file/module names \201imports\202)LD(
|
|
|
|
)2 1 1 HR()0 2 4 H()WB 33 Sn()WB 3 Sn()EA(Terms Used In This Document)EH(
|
|
|
|
)1 DL()DT()I(sequence)ES(
|
|
|
|
)DD(a string, list or tuple
|
|
|
|
)DT()I(suite)ES(
|
|
|
|
)DD(a series of statements, possibly separated by newlines. Must all be at
|
|
same indentation level, except for suites inside compound statements
|
|
|
|
)DT(<x>
|
|
|
|
)DD(in a syntax diagram means a token referred to as "x"
|
|
|
|
)DT([xxx]
|
|
|
|
)DD(in a syntax diagram means "xxx" is optional
|
|
|
|
)DT(x ==> y
|
|
|
|
)DD(means the value of <x> is <y>
|
|
|
|
)DT(x <=> y
|
|
|
|
)DD(means "x is equivalent to y")LD(
|
|
|
|
)2 1 1 HR()0 2 5 H()WB 34 Sn()WB 4 Sn()EA(Notable lexical entities)EH(
|
|
|
|
)0 3 6 H(Keywords)WB 35 Sn()EH(
|
|
|
|
)BQ() 6 49 PR(and\240\240\240\240\240\240 del\240\240\240\240\240\240 for\240\240\240\240\240\240 is\240\240\240\240\240\240\240 raise\240\240\240\240
|
|
assert\240\240\240 elif\240\240\240\240\240 from\240\240\240\240\240 lambda\240\240\240 return\240\240\240
|
|
break\240\240\240\240 else\240\240\240\240\240 global\240\240\240 not\240\240\240\240\240\240 try\240\240\240\240\240\240
|
|
class\240\240\240\240 except\240\240\240 if\240\240\240\240\240\240\240 or\240\240\240\240\240\240\240 while\240\240\240\240
|
|
continue\240 exec\240\240\240\240\240 import\240\240\240 pass\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240
|
|
def\240\240\240\240\240\240 finally\240\240 in\240\240\240\240\240\240\240 print)RP()QB(
|
|
|
|
)UL()-1 LI(\201list of keywords in std module: keyword.py\202
|
|
|
|
)-1 LI(Illegitimate Tokens \201only valid in strings\202: @ $ ?
|
|
|
|
)-1 LI(A statement must all be on a single line. To break a statement over multiple
|
|
lines use "\200", as with the C preprocessor. Exception: can always break
|
|
when inside any \201\202, [], or {} pair, or in triple-quoted strings.
|
|
|
|
)-1 LI(More than one statement can appear on a line if they are separated with
|
|
semicolons \201";"\202.
|
|
|
|
)-1 LI(Comments start with "#" and continue to end of line.)LU(
|
|
|
|
)0 3 7 H(Identifiers)WB 36 Sn()EH(
|
|
\240\240\240\240\240\240\240 \201letter | "_"\202\240 \201letter
|
|
| digit | "_"\202*
|
|
)UL()-1 LI(Python identifiers keywords, attributes, etc. are )BD(case-sensitive)ES(.
|
|
|
|
)-1 LI(Special forms: )BD(_)ES()I(ident)ES( \201not imported by 'from module import
|
|
*'\202; )BD(__)ES()I(ident)ES()BD(__)ES( \201system defined name\202;
|
|
|
|
)BR(\240\240\240\240\240\240\240\240\240\240 )BD(__)ES()I(ident)ES(
|
|
\201class-private name mangling\202)LU(
|
|
|
|
)0 3 8 H(Operators)WB 37 Sn()EH(
|
|
|
|
)BQ(\240+\240\240\240\240\240\240 -\240\240\240\240\240\240
|
|
*\240\240\240\240\240\240 **\240\240\240\240\240
|
|
/\240\240\240\240\240\240 %
|
|
)BR(<<\240\240\240\240\240 >>\240\240\240\240\240
|
|
&\240\240\240\240\240\240 |\240\240\240\240\240\240
|
|
^\240\240\240\240\240\240 ~
|
|
)BR(<\240\240\240\240\240\240 >\240\240\240\240\240\240
|
|
<=\240\240\240\240\240 >=\240\240\240\240\240 ==\240\240\240\240\240
|
|
!=\240\240\240\240\240 <>)QB(
|
|
|
|
)0 3 9 H(Strings)WB 38 Sn()EH(
|
|
)BD(")ES(a string enclosed by double quotes)BD(")ES(
|
|
)BR()BD(')ES(another string delimited by single quotes and with a " inside)BD(')ES(
|
|
)BR()BD(''')ES(a string containing embedded newlines and quote \201'\202 marks,
|
|
can be
|
|
)BR(delimited with triple quotes.)BD(''')ES(
|
|
)BR(""" may also use 3- double quotes as delimiters """
|
|
)BR()BD(r')ES(a raw string where \200 are kept \201literalized\202: handy for regular
|
|
expressions and windows paths!)BD(')ES(
|
|
)BR()BD(R")ES(another raw string)BD("\240\240\240 --)ES( raw strings
|
|
cannot end with a \200
|
|
)UL()-1 LI(Use )BD(\200)ES( at end of line to continue a string on next line.
|
|
|
|
)-1 LI(adjacent strings are concatened, e.g. 'Monty' ' Python' is the same as
|
|
'Monty Python'.)LU(
|
|
|
|
)0 4 10 H(String)WB 39 Sn( Literal Escapes)EH(
|
|
|
|
) 7 79 PR(\240\240\240\240 )BD(\200)I(newline)ES()ES(\240 Ignored \201escape newline\202
|
|
\240\240\240\240 )BD(\200\200)ES( Backslash \201\200\202\240\240\240\240\240\240\240 )BD(\200e)ES( Escape \201ESC\202\240\240\240\240\240\240\240\240\240\240\240 )BD(\200v)ES( Vertical Tab \201VT\202
|
|
\240\240\240\240 )BD(\200')ES( Single quote \201'\202\240\240\240\240 )BD(\200f)ES( Formfeed \201FF\202\240\240\240\240\240\240\240\240\240\240 )BD(\2000OO)ES(\240 \201zero\202 char with\240
|
|
\240\240\240\240 )BD(\200")ES( Double quote \201"\202\240\240\240\240 )BD(\200n)ES( Linefeed \201LF\202\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 octal value OO
|
|
\240\240\240\240 )BD(\200a)ES( Bell \201BEL\202\240\240\240\240\240\240\240\240\240\240 )BD(\200r)ES( Carriage Return \201CR\202\240\240\240 )BD(\200xXX)ES(\240 char with\240
|
|
\240\240\240\240 )BD(\200b)ES( Backspace \201BS\202\240\240\240\240\240\240 )BD(\200t)ES( Horizontal Tab \201TAB\202\240\240\240\240\240\240\240\240\240 hex value XX
|
|
\240\240\240\240 )BD(\200)I(AnyOtherChar)ES()ES( is left as-is)RP(
|
|
|
|
)UL()-1 LI(NULL byte \201\200000\202 is NOT an end-of-string marker; NULL's may be embedded
|
|
in strings.
|
|
|
|
)-1 LI(Strings \201and tuples\202 are )UN(immutable)NU(: they cannot be modified.)LU(
|
|
|
|
)0 3 11 H(Numbers)WB 40 Sn()EH(
|
|
Decimal integer: 1234, 1234567890546378940)BD(L)ES(\240\240\240\240\240\240\240
|
|
\201or )BD(l\202)ES(
|
|
)BR(Octal integer: )BD(0)ES(177, )BD(0)ES(177777777777777777L \201begin with
|
|
a )BD(0)ES(\202
|
|
)BR(Hex integer: )BD(0x)ES(FF, )BD(0X)ES(FFFFffffFFFFFFFFFFL \201begin with
|
|
)BD(0x)ES(
|
|
or )BD(0X)ES(\202
|
|
)BR(Long integer \201unlimited precision\202: 1234567890123456)BD(L)ES( \201ends
|
|
with )BD(L)ES( or)BD( l)ES(\202
|
|
)BR(Float \201double precision\202: 3)BD(.)ES(14)BD(e-10)ES(, .001, 10., 1E3
|
|
)BR(Complex: 1)BD(J)ES(, 2)BD(+)ES(3)BD(J)ES(, 4)BD(+)ES(5)BD(j )ES(\201ends with
|
|
)BD(J)ES(
|
|
or )BD(j, +)ES( separates real and imaginary parts which are both floats\202
|
|
)0 3 12 H(Sequences)WB 41 Sn()EH(
|
|
|
|
)UL()-1 LI()UN(String)NU( of length 0, 1, 2 \201see above\202
|
|
|
|
)BR('', '1', "12"
|
|
)-1 LI()UN(Tuple)NU( of length 0, 1, 2, etc:
|
|
|
|
)BR()BD(\201\202)ES( \2011,\202 \2011,2\202\240\240\240\240 # parentheses are optional
|
|
if len > 0
|
|
)-1 LI()UN(List)NU( of length 0, 1, 2, etc:
|
|
|
|
)BR()BD([])ES( [1] [1,2])LU(
|
|
Indexing is 0-based. Negative indices \201usually\202 mean count backwards from
|
|
end of sequence.
|
|
)0 P(Sequence )UN(slicing)NU()BD( [)ES()I(starting-at-index)ES( )BD(: )ES()I(but-less-than-index)ES()BD(].)ES(Start
|
|
defaults to '0'; End defaults to 'sequence-length'.
|
|
)UL(a = \2010,1,2,3,4,5,6,7\202
|
|
)BR(a[3] ==> 3
|
|
)BR(a[-1] ==> 7
|
|
)BR(a[2:4] ==> \2012, 3\202
|
|
)BR(a[1:] ==> \2011, 2, 3, 4, 5, 6, 7\202
|
|
)BR(a[:3] ==> \2010, 1, 2\202
|
|
)BR(a[:] ==> \2010,1,2,3,4,5,6,7\202\240 # makes a )BD(copy)ES( of the sequence.)LU(
|
|
|
|
)0 3 13 H(Dictionaries)WB 42 Sn( \201Mappings\202)EH(
|
|
)UN(Dictionary)NU( of length 0, 1, 2, etc:
|
|
)BR()BD({})ES( {1 : 'first'} {1 : 'first',\240 'next': 'second'}
|
|
)0 P()2 1 1 HR()0 2 14 H()WB 43 Sn()WB 5 Sn()EA(Basic Types and Their Operations)EH(
|
|
|
|
)0 3 15 H(Comparisons)WB 44 Sn( \201defined between *any* types\202)EH(
|
|
|
|
) 8 67 PR(\240\240\240\240\240\240\240 <\240\240\240\240\240\240 strictly less than\240\240\240\240\240\240
|
|
\240\240\240\240\240\240\240 <=\240\240\240\240\240 less than or equal\240\240\240\240\240\240
|
|
\240\240\240\240\240\240\240 >\240\240\240\240\240\240 strictly greater than\240\240\240
|
|
\240\240\240\240\240\240\240 >=\240\240\240\240\240 greater than or equal\240\240\240
|
|
\240\240\240\240\240\240\240 ==\240\240\240\240\240 equal\240\240\240
|
|
\240\240\240\240\240\240\240 !=\240\240\240\240\240 not equal\240 \201 "<>" is also allowed\202
|
|
\240\240\240\240\240\240\240 is\240\240\240\240\240 object identity \201are )BD(objects)ES( identical, not values\202
|
|
\240\240\240\240\240\240\240 is not\240 negated object identity)RP(
|
|
X < Y < Z < W has expected meaning, unlike C
|
|
)0 3 16 H(Boolean)WB 45 Sn( values and operators)EH(
|
|
|
|
) 8 78 PR(\240\240\240\240\240 )BD(False)ES( values:\240\240\240\240 None, numeric zeros, empty sequences and mappings
|
|
\240\240\240\240\240 )BD(True)ES( values:\240\240\240\240\240 all other values
|
|
|
|
\240\240\240\240\240 )BD(not)ES( X: if X is false then 1, else 0
|
|
\240\240\240\240\240 X )BD(or)ES( Y: if X is false then Y, else X
|
|
\240\240\240\240\240 X )BD(and)ES( Y: if X is false then X, else Y
|
|
|
|
\240\240\240\240\240 \201'or', 'and' evaluate second arg only if necessary to determine outcome\202)RP(
|
|
|
|
)0 3 17 H(None)WB 46 Sn()EH(
|
|
None is used as default return value on functions.
|
|
)BR(Input that evaluates to None does not print when running Python interactively.
|
|
)0 3 18 H(Numeric)WB 47 Sn( types)EH(
|
|
|
|
)0 4 19 H(Floats,)WB 48 Sn( integers and long integers.)EH(
|
|
Floats are implemented with C doubles.
|
|
)BR(Integers are implemented with C longs.
|
|
)BR(Long integers have unlimited size \201only limit is system resources\202
|
|
)0 4 20 H(Operators)WB 49 Sn( on all numeric types)EH(
|
|
|
|
) 13 52 PR(\240\240\240\240\240\240\240 )BD(abs)ES(\201x\202\240 absolute value of x\240\240\240\240\240
|
|
\240\240\240\240\240\240\240 )BD(int)ES(\201x\202\240 x converted to integer\240\240
|
|
\240\240\240\240\240\240\240 )BD(long)ES(\201x\202 x converted to long integer\240\240\240\240\240
|
|
\240\240\240\240\240\240\240 )BD(float)ES(\201x\202 x converted to floating point\240\240\240
|
|
\240\240\240\240\240\240\240 )BD(-)ES(x\240\240\240\240\240 x negated\240\240\240\240\240\240\240
|
|
\240\240\240\240\240\240\240 )BD(+)ES(x\240\240\240\240\240 x unchanged\240\240\240\240\240
|
|
\240\240\240\240\240\240\240 x )BD(+)ES( y\240\240 sum of x and y\240\240
|
|
\240\240\240\240\240\240\240 x )BD(-)ES( y\240\240 difference of x and y\240\240\240
|
|
\240\240\240\240\240\240\240 x )BD(*)ES( y\240\240 product of x and y\240\240\240\240\240\240
|
|
\240\240\240\240\240\240\240 x )BD(/)ES( y\240\240 quotient of x and y\240\240\240\240\240
|
|
\240\240\240\240\240\240\240 x )BD(%)ES( y\240\240 remainder of x / y
|
|
\240\240\240\240\240\240\240 )BD(divmod)ES(\201x, y\202 the tuple \201x/y, x%y\202
|
|
\240\240\240\240\240\240\240 x )BD(**)ES( y\240 x to the power y [same as: )BD(pow)ES(\201x,y\202])RP(
|
|
|
|
)0 4 21 H(Bit)WB 50 Sn( operators on integers and long integers)EH(
|
|
|
|
) 6 48 PR(\240\240\240\240\240\240\240 )BD(~)ES(x\240\240\240\240\240 the bits of x inverted\240\240
|
|
\240\240\240\240\240\240\240 x )BD(^)ES( y\240\240 bitwise exclusive or of x and y\240
|
|
\240\240\240\240\240\240\240 x )BD(&)ES( y\240\240 bitwise and of x and y\240\240
|
|
\240\240\240\240\240\240\240 x )BD(|)ES( y\240\240 bitwise or of x and y\240\240\240
|
|
\240\240\240\240\240\240\240 x )BD(<<)ES( n\240 x shifted left by n bits\240\240\240\240\240\240\240\240
|
|
\240\240\240\240\240\240\240 x )BD(>>)ES( n\240 x shifted right by n bits)RP(
|
|
|
|
)0 4 22 H(Complex)WB 51 Sn( Numbers)EH(
|
|
represented as a pair of machine-level double precision floating point
|
|
numbers.
|
|
)BR(The real and imaginary value of a complex number z can be retrieved
|
|
through the
|
|
)BR(attributes )UN(z.real)NU( and )UN(z.imag)NU(.
|
|
)0 4 23 H(Numeric)WB 52 Sn( exceptions)EH(
|
|
|
|
)1 DL()DT(TypeError
|
|
|
|
)DD(raised on application of arithmetic operation to non-number
|
|
|
|
)DT(OverflowError
|
|
|
|
)DD(\240numeric bounds exceeded
|
|
|
|
)DT(ZeroDivisionError
|
|
|
|
)DD(\240raised when zero second argument of div or modulo op)LD(
|
|
|
|
)0 3 24 H(Operations)WB 53 Sn( on all sequence types \201lists, tuples, strings\202)EH(
|
|
|
|
)2 Al()0 PT()Ea(
|
|
|
|
) 1 7 PR()UN(Notes)NU( :)RP(
|
|
\240\240)-1 Bf add FZ(\240 \2011\202 if )I(i)ES( or )I(j)ES( is negative,
|
|
the index is relative to the end of the string, ie )3 FZ(len\201)I(s)ES(\202+
|
|
)I(i)ES()Ef(
|
|
or )3 FZ(len\201)I(s)ES(\202+)I(j)ES()Ef( is)Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240\240\240\240\240\240 substituted.
|
|
But note that -0 is still 0.)Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240 \2012\202 The slice of )I(s)ES( from )I(i)ES(
|
|
to )I(j)ES( is defined as the sequence of items with index )I(k)ES( such
|
|
that )I(i <= k < j)ES(.)Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240\240\240\240\240\240\240
|
|
If )I(i)ES( or )I(j)ES( is greater than)3 FZ(len\201)I(s)ES(\202)Ef(, use)3 FZ( len\201)I(s)ES(\202)Ef(.
|
|
If )I(i)ES( is omitted, use len\201)I(s)ES(\202. If )I(i)ES( is greater than
|
|
or)Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240\240\240\240\240\240\240
|
|
equal to )I(j)ES(, the slice is empty.)Ef(
|
|
)0 3 25 H(Operations)WB 54 Sn( on mutable \201=modifiable\202 sequences \201lists\202)EH(
|
|
|
|
)2 Al()1 PT()Ea(
|
|
|
|
)0 P()UN(Notes)NU( :
|
|
)BR(\240\240)-1 Bf add FZ(\240 \2011\202 raise a ValueError exception when
|
|
)I(x)ES(
|
|
is not found in )I(s)ES( \201i.e. out of range\202.)Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240\240 \2012\202 The sort\201\202 method takes
|
|
an optional argument specifying a comparison fct of 2 arguments \201list items\202
|
|
which should)Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240\240\240\240\240\240\240
|
|
return -1, 0, or 1 depending on whether the 1st argument is considered
|
|
smaller than, equal to, or larger than the 2nd)Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240\240\240\240\240\240\240
|
|
argument. Note that this slows the sorting process down considerably.)Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240\240 \2013\202 The sort\201\202 and reverse\201\202
|
|
methods )BD(modify)ES( the list )BD(in place)ES( for economy of space when
|
|
sorting or reversing a large list.)Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240\240\240\240\240\240\240\240
|
|
They don't return the sorted or reversed list to remind you of this side
|
|
effect.)Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240\240 \2014\202 [)I(New 1.5.2)ES(] The pop\201\202
|
|
method is experimental and not supported by other mutable sequence types
|
|
than lists.)Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240\240\240\240\240\240\240
|
|
The optional\240 argument i defaults to -1, so that by default the last
|
|
item is removed and returned.)Ef(
|
|
)BR()-1 Bf add FZ(\240\240\240\240 \2015\202 [)I(New 1.5.2)ES(] Experimental
|
|
! Raises an exception when x is not a list object.)Ef(
|
|
)BR(\240
|
|
)BR(\240
|
|
)0 3 26 H(Operations)WB 55 Sn( on mappings \201dictionaries\202)EH(
|
|
|
|
)2 Al()2 PT()Ea(
|
|
|
|
)BQ()BQ()BQ()UN(Notes)NU( :
|
|
)BR()-1 Bf add FZ(\240 TypeError is raised if key is not acceptable)Ef(
|
|
)BR()-1 Bf add FZ(\240 \2011\202 KeyError is raised if key k is not in the
|
|
map)Ef(
|
|
)BR()-1 Bf add FZ(\240 \2012\202 Keys and values are listed in random order)Ef(
|
|
)BR()-1 Bf add FZ(\240 \2013\202 )I(d2)ES( must be of the same type as )I(d1)ES()Ef(
|
|
)BR()-1 Bf add FZ()I(\240 \201)ES(4\202 Never raises an exception if )I(k)ES(
|
|
is not in the map, instead it returns )I(defaultVal)ES(.)Ef(
|
|
)BR()-1 Bf add FZ()I(\240\240\240\240\240 defaultVal)ES( is optional,
|
|
when not provided and )I(k)ES( is not in the map, None is returned.)Ef()QB()QB()QB(
|
|
|
|
)0 3 27 H(Format)WB 56 Sn( operator for strings \201%\202)EH(
|
|
|
|
)0 4 28 H()WB 57 Sn()3 FZ(Uses C )Ef(printf format codes :)EH(
|
|
Supports: %, c, s, i, d, u, o, x, X, e, E, f, g, G.
|
|
)0 P(Width and precision may be a * to specify that an integer argument specifies
|
|
the actual width or precision.
|
|
)0 P(The flag characters -, +, blank, # and 0 are understood.
|
|
)0 P(%s will convert any type argument to string \201uses )I(str\201\202)ES( function\202
|
|
) 2 54 PR(\240\240\240\240\240\240\240 a = '%s has %03d quote types.' )BD(%)ES( \201'Python', 2\202
|
|
\240\240\240\240\240\240\240 a ==> 'Python has 002 quote types.')RP(
|
|
Right-hand-side can be a )I(mapping)ES(:
|
|
) 1 73 PR(\240\240\240\240\240\240\240 a = '%)BD(\201lang\202)ES(s has %)BD(\201c\202)ES(03d quote types.' % {'c':2, 'lang':'Python})RP(
|
|
\201)I(vars\201\202)ES( function very handy to use on right-hand-side.\202
|
|
)0 3 29 H()WB 58 Sn()WB [16#00 16#00 16#00] Sc()3 FZ(File Objects)Ef()Ec()EH(
|
|
Created with built-in function )I(open\201\202)ES(; may be created by other modules's
|
|
functions as well.
|
|
)0 4 30 H(Operators)WB 59 Sn( on file objects)EH(
|
|
|
|
) 20 89 PR(\240\240\240\240\240\240\240 f.)BD(close)ES(\201\202\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 close file f.
|
|
\240\240\240\240\240\240\240 f.)BD(fileno)ES(\201\202\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 get fileno \201fd\202 for f.
|
|
\240\240\240\240\240\240\240 f.)BD(flush)ES(\201\202\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 flush file's internal buffer.
|
|
\240\240\240\240\240\240\240 f.)BD(isatty)ES(\201\202\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 1 if file is connected to a tty-like dev, else 0
|
|
\240\240\240\240\240\240\240 f.)BD(read)ES(\201[size]\202\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 read at most )I(size)ES( bytes from file and return
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 as a string object. If )I(size)ES( omitted, read to EOF.
|
|
|
|
\240\240\240\240\240\240\240 f.)BD(readline)ES(\201\202\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 read one entire line from file
|
|
\240\240\240\240\240\240\240 f.)BD(readlines)ES(\201\202\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 read until EOF with readline\201\202 and return list
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 of lines read.
|
|
|
|
\240\240\240\240\240\240\240 f.)BD(seek)ES(\201offset, whence=0\202\240\240\240\240\240\240\240 set file's position, like\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "stdio's fseek\201\202".\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 whence == 0 then use absolute indexing
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 whence == 1 then offset relative to current pos
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 whence == 2 then offset relative to file end
|
|
|
|
\240\240\240\240\240\240\240 f.)BD(tell)ES(\201\202\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 return file's current position
|
|
\240\240\240\240\240\240\240 f.)BD(write)ES(\201str\202\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Write string to file.
|
|
\240\240\240\240\240\240\240 f.)BD(writelines)ES(\201list\202\240\240\240\240\240\240\240\240\240\240\240\240\240 Write list of strings to file.)RP(
|
|
|
|
)0 4 31 H(File)WB 60 Sn( Exceptions)EH(
|
|
|
|
)0 DL()DT(EOFError
|
|
|
|
)DD(\240End-of-file hit when reading \201may be raised many times, e.g. if )I(f)ES(
|
|
is a tty\202.
|
|
|
|
)DT(IOError
|
|
|
|
)DD(\240Other I/O-related I/O operation failure)LD(
|
|
|
|
)2 1 1 HR()0 2 32 H()WB 61 Sn()WB 6 Sn()EA(Advanced Types)EH(
|
|
)I(-See manuals for more details)ES( -
|
|
)UL()-1 LI()I(Module)ES( objects
|
|
|
|
)-1 LI()I(Class)ES( objects
|
|
|
|
)-1 LI()I(Class instance)ES( objects
|
|
|
|
)-1 LI()I(Type)ES( objects \201see module: types\202
|
|
|
|
)-1 LI()I(File)ES( objects \201see above\202
|
|
|
|
)-1 LI()I(Slice)ES( objects
|
|
|
|
)-1 LI()I(XRange)ES( objects
|
|
|
|
)-1 LI(Callable types:
|
|
|
|
)UL()-1 LI(User-defined \201written in Python\202:
|
|
|
|
)UL()-1 LI(User-defined )I(Function)ES( objects
|
|
|
|
)-1 LI(User-defined )I(Method)ES( objects)LU(
|
|
|
|
)-1 LI(Built-in \201written in C\202:
|
|
|
|
)UL()-1 LI(Built-in )I(Function)ES( objects
|
|
|
|
)-1 LI(Built-in )I(Method)ES( objects)LU()LU(
|
|
|
|
)-1 LI(Internal Types:
|
|
|
|
)UL()-1 LI()I(Code)ES( objects \201byte-compile executable Python code: )I(bytecode)ES(\202
|
|
|
|
)-1 LI()I(Frame)ES( objects \201execution frames\202
|
|
|
|
)-1 LI()I(Traceback)ES( objects \201stack trace of an exception\202)LU()LU(
|
|
|
|
)2 1 1 HR()0 2 33 H()WB 62 Sn()WB 7 Sn()EA(Statements)EH(
|
|
|
|
) 25 77 PR()BD(pass)ES(\240\240\240\240\240\240\240\240\240\240\240 -- Null statement
|
|
)BD(=)ES(\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Assignment operator. Can unpack tuples, lists, strings
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 first, second = a[0:2]; [f, s] = range\2012\202; c1,c2,c3='abc'
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Tip: x,y = y,x swaps x and y.
|
|
)BD(del)ES( <name>[,<name>]* -- Unbind name\201s\202 from object. Object will be indirectly
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 \201and automatically\202 deleted only if no longer referenced.
|
|
)BD(print)ES( [<c1> [, <c2> ]* [,]
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Writes to sys.stdout.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Puts spaces between arguments. Puts newline at end
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 unless statement ends with comma.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Print is not required when running interactively,
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 simply typing an expression will print its value,
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 unless the value is None.
|
|
)BD(exec)ES( <x> [in <globals> [,<locals>]]
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Executes <x> in namespaces provided. Defaults
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 to current namespaces. <x> can be a string, file
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 object or a function object.
|
|
)BD(f)ES(\201<value>,... [<id>=<value>]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Call function 'f' with parameters. Parameters can
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 be passed by name or be omitted if function\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 defines default values. E.g. for 'f' is defined as
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "def f\201p1=1, p2=2\202"
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "f\201\202"\240\240\240\240\240\240 <=>\240 "f\2011, 2\202"
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "f\20110\202"\240\240\240\240 <=>\240 "f\20110, 2\202"
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "f\201p2=99\202"\240 <=>\240 "f\2011, 99\202")RP(
|
|
|
|
)0 3 34 H(Control)WB 63 Sn( Flow)EH(
|
|
|
|
) 24 132 PR()BD(if)ES( <condition)I(>)ES()BD(:)ES( <suite)I(>)ES([)BD(elif)ES( <condition)I(>)ES()BD(:)ES( <suite)I(>)ES(]*
|
|
[)BD(else:)ES( <suite)I(>)ES(]
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- usual if/else_if/else statement
|
|
|
|
)BD(while)ES( <condition>)BD(:)ES( <suite>
|
|
[)BD(else:)ES( <suite>]
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- usual while statement. "else" suite is executed
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 after loop exits, unless the loop is exited with
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "break"
|
|
|
|
)BD(for)ES( <target> )BD(in)ES( <condition-list>)BD(:)ES( <suite>
|
|
[)BD(else:)ES( <suite>]
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- iterates over sequence "<condition-list>",
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 assigning each element to "<target>". Use built-in )I(range)ES(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 function to iterate a number of times.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "else" suite executed at end unless loop exited
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 with "break"
|
|
|
|
)BD(break)ES(\240\240\240\240\240\240\240\240\240\240 -- immediately exit "for" or "while" loop
|
|
|
|
)BD(continue)ES(\240\240\240\240\240\240\240 -- immediately do next iteration of "for" or "while" loop
|
|
|
|
)BD(return)ES( [<result>]
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- return from function \201or method\202 and return
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "<result>". If no result given, then returns )I(None)ES(.)RP(
|
|
|
|
)0 3 35 H(Exception)WB 64 Sn( Statements)EH(
|
|
|
|
) 3 78 PR()BD(assert)ES( expr[, message]
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- expr is evaluated. if false, raise exception AssertionError
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 with message. Inhibited if __debug__ is 0.)RP(
|
|
|
|
) 37 72 PR()BD(try:)ES( <suite1>
|
|
[)BD(except)ES( [<exception> [, <value>])BD(:)ES( <suite2>]+
|
|
[)BD(else:)ES( <suite3>]
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- statements in <suite1> are executed. If an
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 exception occurs, look in "except" clauses for
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 matching <exception>. If matches or bare "except"
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 execute suite of that clause. If no exception happens
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 suite in "else" clause is executed after <suite1>.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 If <exception> has a value, it is put in <value>.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <exception> can also be tuple of exceptions, e.g.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "except \201KeyError, NameError\202, val: print val"
|
|
|
|
)BD(try:)ES( <suite1>
|
|
)BD(finally:)ES( <suite2>
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- statements in <suite1> are executed. If no
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 exception, execute <suite2> \201even if <suite1> is
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 exited with a "return", "break" or "continue"
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 statement\202. If exception did occur, executes\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <suite2> and them immediately reraises exception.
|
|
|
|
)BD(raise)ES( <exception> [,<value> [,<traceback>]]
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- raises <exception> with optional value
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <value>. Parameter <traceback>
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 specifies a traceback object to use when printing
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 the exception's backtrace.
|
|
)BD(raise)ES(\240\240\240\240\240\240\240\240\240\240\240 -- a raise statement without arguments re-raises
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 the last exception raised in the current function
|
|
|
|
An exception is either a )I(string)ES( \201object\202 or a )I(class instance)ES(.
|
|
Can create a new one simply by creating a new string:
|
|
)WR(
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 my_exception = 'You did something wrong'
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 )BD(try)ES(:\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 if bad:\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 )BD(raise)ES( my_exception, bad
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 )BD(except)ES( my_exception, value:\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 print 'Oops', value)RP(
|
|
|
|
) 1 75 PR(Exception classes must be derived from the predefined class: Exception, eg:)RP(
|
|
|
|
) 15 70 PR(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 class text_exception\201Exception\202:
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 )BD(try)ES(:
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 if bad:
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 )BD(raise)ES( text_exception\201\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 # This is a shorthand for the form
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 # "raise <class>, <instance>"
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 )BD(except)ES( Exception:
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 print 'Oops'
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 # This will be printed because
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 # text_exception is a subclass of Exception
|
|
|
|
When an error message is printed for an unhandled exception which is a
|
|
class, the class name is printed, then a colon and a space, and
|
|
finally the instance converted to a string using the built-in function
|
|
str\201\202.)RP(
|
|
|
|
) 2 65 PR(All built-in exception classes derives from StandardError, itself
|
|
derived from Exception.)RP(
|
|
|
|
)0 3 36 H(Name)WB 65 Sn( Space Statements)EH(
|
|
[1.51: On Mac & Windows, the case of module file names must now match
|
|
the case as used
|
|
)BR(\240 in the )I(import)ES( statement]
|
|
) 4 78 PR()I(Packages)ES( \201>1.5\202: a package is a name space which maps to a directory including
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 module\201s\202 and the special initialization module '__init__.py'
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 \201possibly empty\202. Packages/dirs can be nested. You address a
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 module's symbol via '[package.[package...]module.symbol's.)RP(
|
|
|
|
) 32 91 PR()BD(import)ES( <module_id1> [, <module_id2>]*
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- imports modules. Members of module must be\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 referred to by qualifying with [package.]module name:
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "import sys; print sys.argv:"
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "import package1.subpackage.module; package1.subpackage.module.foo\201\202"
|
|
|
|
)BD(from)ES( <module_id> )BD(import)ES( <id1> [, <id2>]*
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- imports names from module <module_id>. Names
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 are not qualified:
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "from sys import argv; print argv"
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "from package1 import module; module.foo\201\202"
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "from package1.module import foo; foo\201\202"
|
|
|
|
)BD(from)ES( <module_id> )BD(import *)ES(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- imports all names in module <module_id>, except
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 those starting with "_"; *to be used sparsely* :
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "from sys import *; print argv"
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "from package.module import *; print x'
|
|
|
|
)BD(global)ES( <id1> [,<id2>]*
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- ids are from global scope \201usually meaning from module\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 rather than local \201usually meaning only in function\202.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- E.g. in fct without "global" statements, assuming
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "a" is name that hasn't been used in fct or module
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 so far:
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -Try to read from "a" -> NameError
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -Try to write to "a" -> creates "a" local to fcn
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -If "a" not defined in fct, but is in module, then
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -Try to read from "a", gets value from module
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -Try to write to "a", creates "a" local to fct
|
|
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 But note "a[0]=3" starts with search for "a",)WR(
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 will use to global "a" if no local "a".)RP(
|
|
|
|
)0 3 37 H(Function)WB 66 Sn( Definition)EH(
|
|
|
|
) 13 71 PR()BD(def)ES( <func_id> \201[<param_list>]\202)BD(:)ES( <suite>
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- creates a function object and assigns it name\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <func_id>.
|
|
|
|
<param_list> ==> [<id> [, <id>]*] [<id> =
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <v> [,
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <id> =
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <v>]*]
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 [*<id>]\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 [**<id>]
|
|
[Args are passed by )BD(value)ES(.Thus only args representing a )I(mutable)ES( object
|
|
can be modified \201are )I(inout)ES( parameters\202. Use a )BD(tuple)ES( to return more than
|
|
one value])RP(
|
|
|
|
) 9 68 PR(E.g.
|
|
\240\240\240\240\240\240\240 )BD(def)ES( test \201p1, p2 = 1+1, *rest, **keywords\202:
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Parameters with "=" have default value \201<v> is
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 evaluated when function defined\202.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 If list has "*<id>" then <id> is assigned
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 a tuple of all remaining args passed to function.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 \201allows vararg functions\202.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 If list has "**<id>" then <id> is assigned
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 a dictionary of all arguments passed as keywords.)RP(
|
|
|
|
)0 3 38 H(Class)WB 67 Sn( Definition)EH(
|
|
|
|
) 38 85 PR()BD(class)ES( <class_id> [\201<super_class1> [,<super_class2>]*\202]: <suite>
|
|
\240\240\240\240\240\240\240 -- Creates a class object and assigns it name <class_id>
|
|
\240\240\240\240\240\240\240\240\240\240 <suite> may contain local "defs" of class methods and
|
|
\240\240\240\240\240\240\240\240\240\240 assignments to class attributes.
|
|
E.g.
|
|
\240\240\240\240\240\240 )BD(class)ES( my_class \201class1, class_list[3]\202: ...
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Creates a class object inheriting from both "class1" and whatever\240\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 class object "class_list[3]" evaluates to. Assigns new
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 class object to name "my_class".
|
|
|
|
\240\240\240\240\240\240\240 -First arg to class methods is always instance object, called ')BD(self)ES('
|
|
\240\240\240\240\240\240\240\240 by convention.
|
|
\240\240\240\240\240\240\240 -Special method )BD(__init__)ES(\201\202 is called when instance is created.
|
|
\240\240\240\240\240\240\240 -Special method )BD(__del__)ES(\201\202 called when no more reference to object.
|
|
\240\240\240\240\240\240\240 -Create instance by ")I(calling)ES(" class object, possibly with arg
|
|
\240\240\240\240\240\240\240\240 \201thus instance=apply\201aClassObject, args...\202 creates an instance!\202
|
|
\240\240\240\240\240\240\240 -In current implementation, can't subclass off built-in
|
|
\240\240\240\240\240\240\240\240 classes. But can "wrap" them, see __getattr__\201\202 below.
|
|
|
|
|
|
E.g.
|
|
\240\240\240\240\240\240\240 class c \201c_parent\202:\240
|
|
\240\240\240\240\240\240\240\240\240\240 def __init__\201self, name\202: self.name = name
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 def print_name\201self\202: print "I'm", self.name
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 def call_parent\201self\202: c_parent.print_name\201self\202
|
|
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240 instance = c\201'tom'\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240 print instance.name\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 'tom'
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240 instance.print_name\201\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "I'm tom")WR(
|
|
|
|
\240\240\240\240\240\240\240 Call parent's super class by accessing parent's method
|
|
\240\240\240\240\240\240\240 directly and passing "self" explicitly \201see "call_parent"
|
|
\240\240\240\240\240\240\240 in example above\202.
|
|
|
|
\240\240\240\240\240\240\240 Many other special methods available for implementing
|
|
\240\240\240\240\240\240\240 arithmetic operators, sequence, mapping indexing, etc.)RP(
|
|
|
|
)0 4 39 H(Documentation)WB 68 Sn( Strings)EH(
|
|
Modules, classes and functions may be documented by placing a string literal
|
|
by itself as the first statement in the suite. The documentation can be
|
|
retrieved by getting the ')BD(__doc__)ES(' attribute from the module, class
|
|
or function.
|
|
) 8 63 PR(Example:
|
|
\240\240\240\240\240\240\240 class c:
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "A description of 'c'"
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 def __init__\201self\202:
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "A description of the constructor"
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 # etc.
|
|
Then c.__doc__ <=> "A description of 'c'".
|
|
Then c.__init__.__doc__ <=> "A description of the constructor".)RP(
|
|
|
|
)0 3 40 H(Others)WB 69 Sn()EH(
|
|
|
|
) 5 74 PR()BD(lambda)ES( [<param_list>]: <returnedExpr>
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Create an anonymous function. <returnedExpr> must be
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 an expression, not a statement \201e.g., not "if xx:...",\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 "print xxx", etc.\202 and thus can't contain newlines.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Used mostly for filter\201\202, map\201\202, reduce\201\202 functions.)RP(
|
|
|
|
)2 1 1 HR()0 2 41 H()WB 70 Sn()WB 8 Sn()EA(Built-In Functions)EH(
|
|
|
|
) 30 85 PR()BD(__import__)ES(\201name[, globals[, locals[, fromlist]]]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Import module within the given context \201see lib ref for more details\202
|
|
|
|
)BD(abs)ES(\201x\202\240\240\240\240\240\240\240\240\240 Return the absolute value of a number
|
|
|
|
)BD(apply)ES(\201f, args[, keywords]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Call func/method <f> with args <args> and optional keywords
|
|
|
|
)BD(callable)ES(\201x\202\240\240\240\240 Returns 1 if x callable, else 0.
|
|
|
|
)BD(chr)ES(\201i\202\240\240\240\240\240\240\240\240\240 Return one-character string whose ASCII code is
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 integer i
|
|
|
|
)BD(cmp)ES(\201x,y\202\240\240\240\240\240\240\240 Return neg, zero, pos if x <, ==, > to y
|
|
|
|
)BD(coerce)ES(\201x,y\202\240\240\240\240 Return a tuple of the two )I(numeric)ES( arguments converted to
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 a common type.
|
|
|
|
)BD(compile)ES(\201string, filename, kind\202\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Compile <string> into a code object.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <filename> is used in error message, can be any string. It is
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 usually the file from which the code was read, or eg. '<string>'
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 if not read from file.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <kind> can be 'eval' if <string> is a single stmt, or 'single'
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 which prints the output of expression statements that
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 evaluate to something else than "None" or be 'exec'.
|
|
|
|
)BD(complex)ES(\201real[, image]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Build a complex object \201can also be done using J or j suffix,
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 e.g. 1+3J\202)RP(
|
|
|
|
) 2 79 PR()BD(delattr)ES(\201obj, name\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 deletes attribute named <name> of object <obj> <=> del obj.name)RP(
|
|
|
|
) 15 76 PR()BD(dir)ES(\201[object]\202\240\240 If no args, return the list of names in current local
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 symbol table. With a module, class or class instance
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 object as arg, return list of names in its attr dict.
|
|
|
|
)BD(divmod)ES(\201a,b\202\240\240\240\240 Returns tuple of \201a/b, a%b\202
|
|
|
|
)BD(eval)ES(\201s, globals, locals\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Eval string <s> in \201optional\202 <globals>, <locals>.\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <s> must have no NULL's or newlines. <s> can also be a
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 code object.
|
|
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 E.g.: x = 1; incr_x = eval\201'x + 1'\202
|
|
|
|
)BD(execfile)ES(\201file[, globals[, locals]]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Execute a file without creating a new module, unlike import.)RP(
|
|
|
|
) 21 151 PR()BD(filter)ES(\201function, sequence\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Construct a list from those elements of <sequence> for which
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <function> returns true. <function> takes one parameter.
|
|
|
|
)BD(float)ES(\201x\202\240\240\240\240\240\240\240 Convert a number or a string to floating point.\240
|
|
|
|
)BD(getattr)ES(\201object, name[, default]\202\202\240\240\240 )-1 Bf add FZ([<default> arg added in 1.5.2])Ef(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Get attr called <name> from <object>, e.g. getattr\201x, 'f'\202 <=> x.f\202.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 If not found, raise AttributeError or return <default> if specified.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240
|
|
)BD(globals)ES(\201\202\240\240\240\240\240\240 Returns a dictionary containing current global variables.
|
|
|
|
)BD(hasattr)ES(\201object, name\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Returns true if <object> has attr called <name>.
|
|
|
|
)BD(hash)ES(\201object\202\240\240\240 Return the hash value of the object \201if it has one\202
|
|
|
|
)BD(hex)ES(\201x\202\240\240\240\240\240\240\240\240\240 Convert a number to a hexadecimal string.
|
|
|
|
)BD(id)ES(\201object\202\240\240\240\240\240 Return a unique 'identity' integer for an object.
|
|
|
|
)BD(input)ES(\201[prompt]\202 Prints prompt, if given. Reads input and evaluates it.)RP(
|
|
|
|
) 7 69 PR()BD(int)ES(\201x\202\240\240\240\240\240\240\240\240\240 Convert a number or a string to a plain integer.
|
|
|
|
)BD(intern)ES(\201aString\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Enter <String> in the table of "interned strings" and
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 return the string. Interned strings are 'immortals'.
|
|
)BD(isinstance)ES(\201obj, class\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 return true if <obj> is an instance of <class>)RP(
|
|
|
|
) 2 64 PR()BD(issubclass)ES(\201class1, class2\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 return true if <class1> is derived from <class2>)RP(
|
|
|
|
) 6 68 PR()BD(len)ES(\201s\202\240\240\240\240\240\240\240\240\240 Return the length \201the number of items\202 of an object
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 \201sequence or dictionary\202.
|
|
|
|
)BD(list)ES(\201sequence\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Convert <sequence> into a list. If already a list,
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 return a copy of it.)RP(
|
|
|
|
) 62 74 PR()BD(locals)ES(\201\202\240\240\240\240\240\240\240 Return a dictionary containing current local variables.
|
|
|
|
)BD(long)ES(\201x\202\240\240\240\240\240\240\240\240 Convert a number or a string to a long integer.
|
|
|
|
)BD(map)ES(\201function, list, ...\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Apply <function> to every item of <list> and return a list
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 of the results.\240 If additional arguments are passed,\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <function> must take that many arguments and it is given
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 to <function> on each call.
|
|
|
|
)BD(max)ES(\201s\202\240\240\240\240\240\240\240\240\240 Return the largest item of a non-empty sequence.
|
|
|
|
)BD(min)ES(\201s\202\240\240\240\240\240\240\240\240\240 Return the smallest item of a non-empty sequence.
|
|
|
|
)BD(oct)ES(\201x\202\240\240\240\240\240\240\240\240\240 Convert a number to an octal string.
|
|
|
|
)BD(open)ES(\201filename [, mode='r', [bufsize=<implementation dependent>]]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Return a new file object. First two args are same as\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 those for C's "stdio open" function. <bufsize> is 0
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 for unbuffered, 1 for line-buffered, negative for
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 sys-default, all else, of \201about\202 given size.
|
|
|
|
)BD(ord)ES(\201c\202\240\240\240\240\240\240\240\240\240 Return integer ASCII value of <c> \201str of len 1\202.
|
|
|
|
)BD(pow)ES(\201x, y [, z]\202 Return x to power y [modulo z]. See also ** operator.
|
|
|
|
)BD(range)ES(\201start [,end [, step]]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 return list of ints from >= start and < end.\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 With 1 arg, list from 0..<arg>-1
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 With 2 args, list from <start>..<end>-1
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 With 3 args, list from <start> up to <end> by <step>)WR(
|
|
|
|
)BD(raw_input)ES(\201[prompt]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Print prompt if given, then read string from std
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 input \201no trailing \200n\202.
|
|
|
|
)BD(reduce)ES(\201f, list [, init]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Apply the binary function <f> to the items of
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <list> so as to reduce the list to a single value.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 If <init> given, it is "prepended" to <list>.
|
|
|
|
)BD(reload)ES(\201module\202\240 Re-parse and re-initialize an already imported module.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Useful in interactive mode, if you want to reload a
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 module after fixing it. If module was synactically
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 correct but had an error in initialization, must
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 import it one more time before calling reload\201\202.
|
|
|
|
)BD(repr)ES(\201object\202\240\240\240 Return a string containing a printable representation
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 of an object. Equivalent to `object` \201using
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 backquotes\202.
|
|
|
|
)BD(round)ES(\201x,n=0\202\240\240\240 Return the floating point value x rounded to n digits
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 after the decimal point.
|
|
|
|
)BD(setattr)ES(\201object, name, value\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 This is the counterpart of getattr\201\202.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 setattr\201o, 'foobar', 3\202 <=> o.foobar = 3
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 )UN(Create)NU( attribute if it doesn't exist!
|
|
|
|
)BD(slice)ES(\201[start,] stop[, step]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Return a )I(slice object)ES( representing a range, with R/O)WR(
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 attributes: start, stop, step.)RP(
|
|
|
|
) 20 71 PR()BD(str)ES(\201object\202\240\240\240\240 Return a string containing a nicely printable
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 representation of an object.
|
|
|
|
)BD(tuple)ES(\201sequence\202 Creates a tuple with same elements as <sequence>. If
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 already a tuple, return itself \201not a copy\202.
|
|
|
|
)BD(type)ES(\201obj\202\240\240\240\240\240\240 Return a type object [see module )I(types)ES(]representing the
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 type of <obj>. E.g., import types
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 if type\201x\202 == types.StringType: print 'It is a string'
|
|
|
|
)BD(vars)ES(\201[object]\202\240 Without arguments, return a dictionary corresponding
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 to the current local symbol table.\240 With a module,
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 class or class instance object as argument\240\240\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 returns a dictionary corresponding to the object's
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 symbol table. Useful with "%" formatting operator.
|
|
|
|
)BD(xrange)ES(\201start [, end [, step]]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Like range\201\202, but doesn't actually store entire list
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 all at once. Good to use in "for" loops when there is a
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 big range and little memory.)RP(
|
|
|
|
)2 1 1 HR()0 2 42 H()WB 71 Sn()WB 9 Sn()EA(Built-In Exceptions)EH(
|
|
|
|
)0 DL()DT()I(Exception)ES(
|
|
|
|
)DT(\240\240\240\240\240\240\240\240 Root class for all exceptions
|
|
|
|
)DT()I(\240\240\240 SystemExit)ES(
|
|
|
|
)DT(\240\240\240\240\240\240\240\240 On 'sys.exit\201\202'
|
|
|
|
)DT()I(\240\240\240 StandardError)ES(
|
|
|
|
)DT(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240
|
|
Base class for all built-in exceptions; derived from Exception root class.
|
|
|
|
)DT()I(\240\240\240\240\240\240\240 ArithmeticError)ES(
|
|
|
|
)DT(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240
|
|
Base class for OverflowError, ZeroDivisionError, FloatingPointError
|
|
|
|
)DT()I(\240\240\240\240\240\240\240\240\240\240\240 OverflowError)ES(
|
|
|
|
)BR(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240
|
|
On excessively large arithmetic operation
|
|
)DT()I(\240\240\240\240\240\240\240\240\240\240\240 ZeroDivisionError)ES(
|
|
|
|
)DD(\240\240\240\240\240\240\240\240\240 On division or modulo
|
|
operation with 0 as 2nd arg
|
|
|
|
)DT()I(\240\240\240\240\240\240\240\240\240\240\240 FloatingPointError)ES(
|
|
|
|
)DT(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240
|
|
when a floating point operation fails.
|
|
|
|
)DT()I(\240)ES(
|
|
|
|
)BR()I(\240\240\240\240\240\240\240 AssertionError)ES(
|
|
)DT(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240
|
|
When an )I(assert)ES( statement fails.
|
|
|
|
)DT()I(\240\240\240\240\240\240\240 AttributeError)ES(
|
|
|
|
)BR(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240
|
|
On attribute reference or assignment failure
|
|
)DT()I(\240\240\240\240\240\240\240 EOFError)ES(
|
|
|
|
)BR(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240
|
|
Immediate end-of-file hit by input\201\202 or raw_input\201\202
|
|
)DT()I(\240\240\240\240\240\240\240 EnvironmentError)ES()-1 Bf add FZ(\240\240\240
|
|
[)BD(new)ES( in 1.5.2])Ef(
|
|
|
|
)DT(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240
|
|
On error outside Python; error arg tuple is \201errno, errMsg...\202
|
|
|
|
)DT()I(\240\240\240\240\240\240\240\240\240\240\240 IOError)ES()-1 Bf add FZ(\240\240\240
|
|
[)BD(changed)ES( in 1.5.2])Ef(
|
|
|
|
)DD(\240\240\240\240 I/O-related operation failure
|
|
|
|
)DT()I(\240\240\240\240\240\240\240\240\240\240\240 OSError)ES()-1 Bf add FZ(\240\240\240
|
|
[)BD(new)ES( in 1.5.2])Ef(
|
|
|
|
)DD(\240\240\240\240 used by the )I(os)ES( module's )I(os.error)ES(
|
|
exception.
|
|
|
|
)DT()I(\240\240\240\240\240\240\240 ImportError)ES(
|
|
|
|
)DD(\240\240\240\240 On failure of `import' to find module or name
|
|
|
|
)DT()I(\240\240\240\240\240\240\240 KeyboardInterrupt)ES(
|
|
|
|
)DD(\240\240\240\240 On user entry of the interrupt key \201often `Control-C'\202
|
|
|
|
)DT()I(\240\240\240\240\240\240\240 LookupError)ES(
|
|
|
|
)DT(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240
|
|
base class for IndexError, KeyError
|
|
|
|
)DT()I(\240\240\240\240\240\240\240\240\240\240\240 IndexError)ES(
|
|
|
|
)DD(\240\240\240\240\240\240\240\240 On out-of-range sequence
|
|
subscript
|
|
|
|
)DT()I(\240\240\240\240\240\240\240\240\240\240\240 KeyError)ES(
|
|
|
|
)DD(\240\240\240\240\240\240\240\240 On reference to a non-existent
|
|
mapping \201dict\202 key
|
|
|
|
)DT()I(\240\240\240\240\240\240 MemoryError)ES(
|
|
|
|
)DD(\240\240\240\240 On recoverable memory exhaustion
|
|
|
|
)DT()I(\240\240\240\240\240\240\240 NameError)ES(
|
|
|
|
)DD(\240\240\240\240 On failure to find a local or global \201unqualified\202
|
|
name
|
|
|
|
)DT()I(\240\240\240\240\240\240\240 RuntimeError)ES(
|
|
|
|
)DD(\240\240\240\240 Obsolete catch-all; define a suitable error instead
|
|
|
|
)BR(\240\240\240 )I(NotImplementedError)ES()-1 Bf add FZ(\240\240
|
|
[)BD(new)ES( in 1.5.2])Ef(
|
|
)DD(\240\240\240\240\240\240\240 On method not implemented
|
|
|
|
)DT()I(\240\240\240\240\240\240\240 SyntaxError)ES(
|
|
|
|
)DD(\240\240\240\240 On parser encountering a syntax error
|
|
|
|
)DT()I(\240\240\240\240\240\240\240 SystemError)ES(
|
|
|
|
)DD(\240\240\240\240 On non-fatal interpreter error - bug - report
|
|
it
|
|
|
|
)DT()I(\240\240\240\240\240\240\240 TypeError)ES(
|
|
|
|
)DD(\240\240\240\240 On passing inappropriate type to built-in op or
|
|
func
|
|
|
|
)DT()I(\240\240\240\240\240\240\240 ValueError)ES(
|
|
|
|
)DD(\240\240\240\240 On arg error not covered by TypeError or more
|
|
precise)LD(
|
|
|
|
)2 1 1 HR()0 2 43 H()WB 72 Sn()WB 10 Sn()EA(Standard methods & operators redefinition
|
|
in classes)EH(
|
|
|
|
) 6 99 PR(Standard methods & operators map to methods in user-defined classes and thus may be redefined, e.g.
|
|
\240\240\240 class x:\240
|
|
\240\240\240\240\240\240\240\240 def __init__\201self, v\202: self.value = v
|
|
\240\240\240\240\240\240\240\240 def __add__\201self, r\202: return self.value + r
|
|
\240\240\240 a = x\2013\202 # sort of like calling x.__init__\201a, 3\202
|
|
\240\240\240 a + 4\240\240\240 # is equivalent to a.__add__\2014\202)RP(
|
|
|
|
)0 3 44 H(Special)WB 73 Sn( methods for any class)EH(
|
|
\201s: self, o: other\202
|
|
) 14 76 PR(\240\240\240\240\240\240\240 __init__\201s, args\202 object instantiation\240
|
|
|
|
\240\240\240\240\240\240\240 __del__\201s\202\240\240\240\240\240\240\240 called on object demise \201refcount becomes 0\202
|
|
\240\240\240\240\240\240\240 __repr__\201s\202\240\240\240\240\240\240 repr\201\202 and `...` conversions
|
|
\240\240\240\240\240\240\240 __str__\201s\202\240\240\240\240\240\240\240 str\201\202 and 'print' statement
|
|
\240\240\240\240\240\240\240 __cmp__\201s, o\202\240\240\240\240 implements <, ==, >, <=, <>, !=, >=, is [not]
|
|
\240\240\240\240\240\240\240 __hash__\201s\202\240\240\240\240\240\240 hash\201\202 and dictionary operations
|
|
\240\240\240\240\240\240\240 __getattr__\201s, name\202\240 called when attr lookup doesn't find <name>
|
|
\240\240\240\240\240\240\240 __setattr__\201s, name, val\202 called when setting an attr
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 \201inside, don't use "self.name = value"
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 use "self.__dict__[name] = val"\202
|
|
\240\240\240\240\240\240\240 __delattr__\201s, name\202\240 called to delete attr <name>
|
|
|
|
\240\240\240\240\240\240\240 __call__\201self, *args\202 called when an instance is called as function.)RP(
|
|
|
|
)0 3 45 H(Operators)WB 74 Sn()EH(
|
|
|
|
)BQ(See list in the )I(operator)ES( module. Operator function names
|
|
are provided with 2 variants, with or without
|
|
)BR(ading & trailing '__' \201eg. __add__ or add\202.
|
|
)0 P()BD(Numeric operations special methods)ES(
|
|
)BR(\201s: self, o: other\202)QB(
|
|
|
|
) 19 80 PR(\240\240\240\240\240\240\240 s+o\240\240\240\240\240\240 =\240 __add__\201s,o\202\240\240\240\240\240\240\240\240 s-o\240\240\240\240\240\240\240 =\240 __sub__\201s,o\202
|
|
\240\240\240\240\240\240\240 s*o\240\240\240\240\240\240 =\240 __mul__\201s,o\202\240\240\240\240\240\240\240\240 s/o\240\240\240\240\240\240\240 =\240 __div__\201s,o\202
|
|
\240\240\240\240\240\240\240 s%o\240\240\240\240\240\240 =\240 __mod__\201s,o\202\240\240\240\240\240\240\240\240 divmod\201s,o\202 = __divmod__\201s,o\202
|
|
\240\240\240\240\240\240\240 pow\201s,o\202\240 =\240 __pow__\201s,o\202
|
|
\240\240\240\240\240\240\240 s&o\240\240\240\240\240\240 =\240 __and__\201s,o\202\240\240\240\240\240\240\240\240\240
|
|
\240\240\240\240\240\240\240 s^o\240\240\240\240\240\240 =\240 __xor__\201s,o\202\240\240\240\240\240\240\240\240 s|o\240\240\240\240\240\240\240 =\240 __or__\201s,o\202
|
|
\240\240\240\240\240\240\240 s<<o\240\240\240\240\240 =\240 __lshift__\201s,o\202\240\240\240\240\240 s>>o\240\240\240\240\240\240 =\240 __rshift__\201s,o\202
|
|
\240\240\240\240\240\240\240 nonzero\201s\202 = __nonzero__\201s\202 \201used in boolean testing\202
|
|
\240\240\240\240\240\240\240 -s\240\240\240\240\240\240\240 =\240 __neg__\201s\202\240\240\240\240\240\240\240\240\240\240 +s\240\240\240\240\240\240\240\240 =\240 __pos__\201s\202\240\240
|
|
\240\240\240\240\240\240\240 abs\201s\202\240\240\240 =\240 __abs__\201s\202\240\240\240\240\240\240\240\240\240\240 ~s\240\240\240\240\240\240\240\240 =\240 __invert__\201s\202\240 \201bitwise\202
|
|
\240\240\240\240\240\240\240 int\201s\202\240\240\240 =\240 __int__\201s\202\240\240\240\240\240\240\240\240\240\240 long\201s\202\240\240\240 =\240 __long__\201s\202
|
|
\240\240\240\240\240\240\240 float\201s\202\240 =\240 __float__\201s\202
|
|
\240\240\240\240\240\240\240 oct\201s\202\240\240\240 =\240 __oct__\201s\202\240\240\240\240\240\240\240\240\240\240 hex\201s\202\240\240\240\240 =\240 __hex__\201s\202
|
|
\240\240\240\240\240\240\240 coerce\201s,o\202 = __coerce__\201s,o\202
|
|
|
|
\240\240\240\240\240\240\240 Right-hand-side equivalents for all binary operators exist;
|
|
\240\240\240\240\240\240\240 are called when class instance is on r-h-s of operator:
|
|
\240\240\240\240\240\240\240 a + 3\240 calls __add__\201a, 3\202
|
|
\240\240\240\240\240\240\240 3 + a\240 calls __radd__\201a, 3\202)RP(
|
|
|
|
)BQ()BD(All seqs and maps, general operations plus:)ES(
|
|
)BR(\201s: self, i: index or key\202)QB(
|
|
|
|
) 2 80 PR(\240\240\240\240\240\240\240 len\201s\202\240\240\240 = __len__\201s\202\240\240\240\240\240\240\240 length of object, >= 0.\240 Length 0 == false
|
|
\240\240\240\240\240\240\240 s[i]\240\240\240\240\240 = __getitem__\201s,i\202\240 Element at index/key i, origin 0)RP(
|
|
|
|
)BQ()BD(Sequences, general methods, plus:)ES(
|
|
) 7 63 PR(\240\240\240\240\240\240\240 s[i]=v\240\240\240\240\240\240\240\240\240\240 = __setitem__\201s,i,v\202
|
|
\240\240\240\240\240\240\240 del s[i]\240\240\240\240\240\240\240\240 = __delitem__\201s,i\202
|
|
\240\240\240\240\240\240\240 s[i:j]\240\240\240\240\240\240\240\240\240\240 = __getslice__\201s,i,j\202
|
|
\240\240\240\240\240\240\240 s[i:j]=seq\240\240\240\240\240\240 = __setslice__\201s,i,j,seq\202
|
|
\240\240\240\240\240\240\240 del s[i:j]\240\240\240\240\240\240 = __delslice__\201s,i,j\202\240\240 == s[i:j] = []
|
|
\240\240\240\240\240\240\240 seq * n\240\240\240\240\240\240\240\240\240 = __repeat__\201seq, n\202
|
|
\240\240\240\240\240\240\240 s1 + s2\240\240\240\240\240\240\240\240\240 = __concat__\201s1, s2\202)RP(
|
|
)BD(Mappings, general methods, plus)ES(
|
|
) 3 77 PR(\240\240\240\240\240\240\240 hash\201s\202\240\240\240\240\240\240\240\240\240 = __hash__\201s\202 - hash value for dictionary references
|
|
\240\240\240\240\240\240\240 s[k]=v\240\240\240\240\240\240\240\240\240\240 = __setitem__\201s,k,v\202
|
|
\240\240\240\240\240\240\240 del s[k]\240\240\240\240\240\240\240\240 = __delitem__\201s,k\202)RP()QB(
|
|
|
|
)0 2 46 H()WB 75 Sn()WB 11 Sn()EA(Special informative state attributes for some
|
|
types:)EH(
|
|
|
|
) 85 85 PR(\240\240\240 )BD(Lists & Dictionaries)ES(:
|
|
\240\240\240\240\240\240\240 __methods__ \201list, R/O\202: list of method names of the object
|
|
\240
|
|
\240\240\240 )BD(Modules)ES(:
|
|
\240\240\240\240\240\240\240 __dict__ \201dict, R/O\202: module's name space
|
|
\240\240\240\240\240\240\240 __doc__ \201string/None, R/O\202: doc string \201<=> __dict__['__doc__']\202
|
|
\240\240\240\240\240\240\240 __name__\201string, R/O\202: module name \201also in __dict__['__name__']\202
|
|
\240\240\240\240\240\240\240 __file__\201string/undefined, R/O\202: pathname of .pyc, .pyo or .pyd \201undef for
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 modules statically linked to the interpreter\202
|
|
\240\240\240 )BD(Classes)ES(:\240\240\240 [bold: writable since 1.5.2]
|
|
\240\240\240\240\240\240\240 __bases__ \201tuple, R/)BD(W\202)ES(: parent classes
|
|
\240\240\240\240\240\240\240 __dict__ \201dict, R/)BD(W)ES(\202: attributes \201class name space\202
|
|
\240\240\240\240\240\240\240 __name__\201string, R/)BD(W)ES(\202: class name \201also in __dict__['__name__']\202
|
|
\240\240\240\240\240\240\240 __doc__ \201string/None, R/W\202: doc string \201<=> __dict__['__doc__']\202
|
|
\240
|
|
\240\240\240 )BD(Instances:)ES(\240\240\240\240\240\240\240 __class__ \201class, R/W\202: instance's class
|
|
\240\240\240\240\240\240\240 __dict__ \201dict, R/W\202: attributes
|
|
|
|
|
|
\240\240\240 )BD(User-defined functions)ES(: [bold: writable since 1.5.2]
|
|
\240\240\240\240\240\240\240 __doc__ \201string/None, R/)BD(W)ES(\202: doc string
|
|
\240\240\240\240\240\240\240 __name__\201string, R/O\202: function name
|
|
\240\240\240\240\240\240\240 func_defaults \201tuple/None, R/)BD(W)ES(\202: default args values if any
|
|
\240\240\240\240\240\240\240 func_code \201code, R/)BD(W)ES(\202: code object representing the compiled function body
|
|
\240\240\240\240\240\240\240 func_globals \201dict, R/O\202: ref to dictionary of func global variables
|
|
\240\240\240\240\240\240\240 func_doc \201R/)BD(W)ES(\202: same as __doc__
|
|
\240
|
|
\240\240\240 )BD(User-defined Methods)ES(:
|
|
\240\240\240\240\240\240\240 im_self \201instance/None, R/O\202: target instance object \201None if unbound\202
|
|
\240\240\240\240\240\240\240 im_func \201function, R/O\202: function object
|
|
\240\240\240\240\240\240\240 im_class \201class, R/O\202: class defining the method \201may be a base class\202)WR(
|
|
\240\240\240\240\240\240\240 __doc__ \201string/None, R/O\202: doc string
|
|
\240\240\240\240\240\240\240 __name__\201string, R/O\202: method name \201same as im_func.__name__\202
|
|
|
|
\240\240\240 )BD(Built-in Functions & methods)ES(:
|
|
\240\240\240\240\240\240\240 __doc__ \201string/None, R/O\202: doc string
|
|
\240\240\240\240\240\240\240 __name__ \201string, R/O\202: function name
|
|
\240\240\240\240\240\240\240 __self__ : [methods only] target object
|
|
\240\240\240\240\240\240\240 __members__ = list of attr names: ['__doc__','__name__','__self__']\202
|
|
|
|
\240\240\240 )BD(Codes)ES(:
|
|
\240\240\240\240\240\240\240 co_argcount \201int, R/0\202: number of positional args
|
|
\240\240\240\240\240\240\240 co_nlocals \201int, R/O\202: number of local vars \201including args\202
|
|
\240\240\240\240\240\240\240 co_varnames \201tuple, R/O\202: names of local vars \201starting with args\202
|
|
\240\240\240\240\240\240\240 co_code \201string, R/O\202: sequence of bytecode instructions
|
|
\240\240\240\240\240\240\240 co_consts \201tuple, R/O\202: litterals used by the bytecode, 1st one is
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 fct doc \201or None\202
|
|
\240\240\240\240\240\240\240 co_name \201string, R/O\202: name of function
|
|
\240\240\240\240\240\240\240 co_names \201tuple, R/O\202: names used by the bytecode
|
|
\240\240\240\240\240\240\240 co_filename \201string, R/O\202: filename from which the code was compiled
|
|
\240\240\240\240\240\240\240 co_flags \201int, R/O\202: flags for the interpreter
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 bit 2 set if fct uses "*arg" syntax
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 bit 3 set if fct uses '**keywords' syntax
|
|
\240\240\240\240\240\240\240\240\240\240 HINT: use codehack.getlineno\201\202 to get 1st lineNo of a code object
|
|
|
|
\240\240\240 )BD(Frames)ES(:
|
|
\240\240\240\240\240\240\240 f_back \201frame/None, R/O\202: previous stack frame \201towards the caller\202
|
|
\240\240\240\240\240\240\240 f_code \201code, R/O\202: code object being executed in this frame
|
|
\240\240\240\240\240\240\240 f_locals \201dict, R/O\202: local vars
|
|
\240\240\240\240\240\240\240 f_globals \201dict, R/O\202: global vars
|
|
\240\240\240\240\240\240\240 f_builtins \201dict, R/O\202: built-in \201intrinsic\202 names)WR(
|
|
\240\240\240\240\240\240\240 f_restricted \201int, R/O\202: flag indicating whether fct is executed in
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 restricted mode
|
|
\240\240\240\240\240\240\240 f_lineno \201int, R/O\202: current line number
|
|
\240\240\240\240\240\240\240 f_lasti \201int, R/O\202: precise instruction \201index into bytecode\202
|
|
\240\240\240\240\240\240\240 f_trace \201function/None, R/W\202: debug hook called at start of each source line
|
|
|
|
\240\240\240 )BD(Tracebacks)ES(:
|
|
\240\240\240\240\240\240\240 tb_next \201frame/None, R/O\202: next level in stack trace \201towards the frame where
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 the exception occurred\202
|
|
\240\240\240\240\240\240\240 tb_frame \201frame, R/O\202: execution frame of the current level
|
|
\240\240\240\240\240\240\240 tb_lineno \201int, R/O\202: line number where the exception occured
|
|
\240\240\240\240\240\240\240 tb_lasti \201int, R/O\202: precise instruction \201index into bytecode\202
|
|
\240
|
|
\240\240\240 )BD(Slices)ES(:
|
|
\240\240\240\240\240\240\240 start \201any/None, R/O\202: lowerbound
|
|
\240\240\240\240\240\240\240 stop \201any/None, R/O\202: upperbound
|
|
\240\240\240\240\240\240\240 step \201any/None, R/O\202: step value
|
|
\240
|
|
\240\240\240 )BD(Complex numbers)ES(:
|
|
\240\240\240\240\240\240\240 real \201float, R/O\202: real part
|
|
\240\240\240\240\240\240\240 imag \201float, R/O\202: imaginary part
|
|
|
|
)BD(\240\240\240 XRanges)ES(:
|
|
\240\240\240\240\240\240\240 tolist \201Built-in method, R/O\202: ?)RP(
|
|
|
|
)2 1 1 HR()0 2 47 H()WB 76 Sn()WB 12 Sn()EA(Important Modules)EH(
|
|
|
|
)2 Al()WB 13 Sn()EA()BD()I()+2 Bf add FZ(sys)Ef()ES()ES()Ea(
|
|
)BD(Some variables:)ES(
|
|
) 20 72 PR(argv\240\240\240\240\240\240\240\240\240\240\240 -- The list of command line arguments passed to a\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Python script. sys.argv[0] is the script name.
|
|
builtin_module_names
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- A list of strings giving the names of all modules
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 written in C that are linked into this interpreter.
|
|
|
|
check_interval\240 -- How often to check for thread switches or signals\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 \201measured in number of virtual machine instructions\202
|
|
exc_type
|
|
exc_value
|
|
exc_traceback\240\240 -- )BD(Deprecated)ES( since release 1.5. Use exc_info\201\202 instead.
|
|
\240
|
|
exitfunc\240\240\240\240\240\240\240 -- User can set to a parameterless fcn. It will get
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 called before interpreter exits.
|
|
last_type
|
|
last_value
|
|
last_traceback\240 -- Set only when an exception not handled and
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 interpreter prints an error. Used by debuggers.
|
|
|
|
maxint\240\240\240\240\240\240\240\240\240 -- maximum positive value for integers)RP(
|
|
|
|
) 18 75 PR(modules\240\240\240\240\240\240\240\240 -- Dictionary of modules that have already been loaded.
|
|
|
|
path\240\240\240\240\240\240\240\240\240\240\240 -- Search path for external modules. Can be modified
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 by program.
|
|
platform\240\240\240\240\240\240\240 -- The current platform, e.g. "sunos5", "win32"
|
|
ps1
|
|
ps2\240\240\240\240\240\240\240\240\240\240\240\240 -- prompts to use in interactive mode.
|
|
|
|
stdin
|
|
stdout
|
|
stderr\240\240\240\240\240\240\240\240\240 -- File objects used for I/O. User can redirect by
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 assigning a new file object to them \201or any object:
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 .with a method write\201string\202 for stdout/stderr,
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 .with a method readline\201\202 for stdin\202
|
|
|
|
version\240\240\240\240\240\240\240\240 -- string containing version info about Python interpreter.
|
|
|
|
\201and also: copyright, dllhandle, exec_prefix, prefix\202)RP(
|
|
)BD(Functions:)ES(
|
|
) 17 88 PR(exit\201n\202\240\240\240\240\240\240\240\240 -- Exit with status <n>. Raises SystemExit exception.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 \201Hence can be caught and ignored by program\202
|
|
getrefcount\201object\202\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Return the reference count of the object. Generally 1 higher
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 than you might expect, because of <object> arg temp reference.
|
|
setcheckinterval\201interval\202\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Set the interpreter's thread switching interval \201in number of virtual
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 code instructions, default:10\202.
|
|
settrace\201func\202\240 -- Sets a trace function: called before each line of\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 code is exited.
|
|
setprofile\201func\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Sets a profile function for performance profiling.
|
|
exc_info\201\202\240\240\240\240\240 -- info on exception currently being handled; this is a
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 tuple \201exc_type, exc_value, exc_traceback\202.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 )BD(Warning)ES(: assigning the traceback return value to a local
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 variable in a function handling an exception will cause
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 a circular reference.)RP(
|
|
|
|
)2 1 1 HR()2 Al()WB 14 Sn()EA()BD()I()+2 Bf add FZ(os)Ef()ES()ES()Ea(
|
|
"synonym" for whatever O/S-specific module is proper for current environment.
|
|
Uses "posix" whenever possible.
|
|
)0 P()BD(Variables)ES(
|
|
)BR(name\240\240\240\240\240\240\240\240\240 -- name
|
|
of O/S-specific module \201e.g. "posix", "mac", "nt"\202
|
|
)BR(path\240\240\240\240\240\240\240\240\240\240\240
|
|
-- O/S-specific module for path manipulations.
|
|
)BR(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240
|
|
on Unix, os.path.split\201\202 <=> posixpath.split\201\202
|
|
)BR(curdir\240\240\240\240\240\240\240\240 -- string used
|
|
to represent current directory \201'.'\202
|
|
)BR(pardir\240\240\240\240\240\240\240\240 -- string used
|
|
to represent parent directory \201'..'\202
|
|
)BR(sep\240\240\240\240\240\240\240\240\240\240\240\240
|
|
-- string used to separate directories \201'/' or '\200'\202
|
|
)BR(pathsep\240\240\240\240\240 -- character used to separate
|
|
search path components \201as in $PATH\202, eg. ';' for windows.
|
|
)BR(linesep\240\240\240\240\240\240\240 -- [1.5.2] line separator
|
|
as used in )BD(binary)ES( files, ie '\200n' on Unix, '\200r\200n' on Dos/Win, '\200r'
|
|
on Mac
|
|
)0 P()BD(Functions)ES(
|
|
)BR(makedirs\201path[, mode=0777]\202)-1 Bf add FZ(\240\240\240\240\240\240\240
|
|
[)BD(new)ES( in 1.5.2])Ef(
|
|
)BR(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240
|
|
-- Recursive directory creation \201create required intermediary dirs\202; os.error
|
|
if fails.
|
|
)BR(removedirs\201path\202)-1 Bf add FZ(\240\240\240\240\240\240\240
|
|
[)BD(new)ES( in 1.5.2])Ef(
|
|
)BR(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240
|
|
-- Recursive directory creation \201create required intermediary dirs\202; os.error
|
|
if fails.
|
|
)BR(renames\201old, new\202)-1 Bf add FZ(\240\240\240\240\240\240\240
|
|
[)BD(new)ES( in 1.5.2])Ef(
|
|
)BR(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240
|
|
-- Recursive directory or file renaming; os.error if fails.
|
|
)0 P()2 1 1 HR()2 Al()WB 15 Sn()EA()BD()I()+2 Bf add FZ(posix)Ef()ES()ES()Ea(
|
|
don't import this module directly, import )I(os)ES( instead !
|
|
)0 P()BD(Variables:)ES(
|
|
) 7 103 PR(environ\240\240\240\240\240\240\240\240 -- dictionary of environment variables, e.g.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 posix.environ['HOME']. [Windows: before release 1.52 case is significant; from 1.52,
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 os.environ is all uppercase but accesses are case insensitive]
|
|
|
|
error\240\240\240\240\240\240\240\240\240\240 -- exception raised on POSIX-related error.\240
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Corresponding value is tuple of errno code and
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 perror\201\202 string.)RP(
|
|
)BD(Some Functions \201see doc for more\202:)ES(
|
|
) 50 91 PR(chdir\201path\202\240\240\240\240 -- change current directory to <path>.
|
|
chmod\201path, mode\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- change the mode of <path> to the numeric <mode>
|
|
close\201fd\202\240\240\240\240\240\240 -- Close file descriptor <fd> opened with posix.open.
|
|
_exit\201n\202\240\240\240\240\240\240\240 -- Immediate exit, with no cleanups, no SystemExit,
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 etc. Should use this to exit a child process.
|
|
execv\201p, args\202\240 -- "Become" executable <p> with args <args>
|
|
getcwd\201\202\240\240\240\240\240\240\240 -- return a string representing the current working directory
|
|
getpid\201\202\240\240\240\240\240\240\240 -- return the current process id
|
|
fork\201\202\240\240\240\240\240\240\240\240\240 -- Like C's fork\201\202. Returns 0 to child, child pid to parent.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 [Not on Windows]
|
|
kill\201pid, signal\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Like C's kill [Not on Windows]
|
|
listdir\201path\202\240\240 -- List names of entries in directory <path>.
|
|
lseek\201fd, pos, how\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- set current position in file <fd> to position <pos>, expressed
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 as an offset relative to beginning of file \201how=0\202, to
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 current position \201how=1\202, or to end of file \201how=2\202
|
|
mkdir\201path[, mode]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Creates a directory named <path> with numeric <mode>
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 \201default 0777\202
|
|
open\201file, flags, mode\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Like C's open\201\202. Returns file descriptor. Use file object fcts
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 rather than this low level ones.
|
|
pipe\201\202\240\240\240\240\240\240\240\240\240 -- Creates pipe. Returns pair of file descriptors \201r, w\202 [Not on Windows].
|
|
popen\201command, mode='r', buffSize=0\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Open a pipe to or from <command>. Result is a file
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 object to read to or write from, as indicated by
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <mode> being 'r' or 'w'.
|
|
remove\201path\202\240\240\240 -- see unlink.
|
|
rename\201src, dst\202-- Rename/move the file or directory <src> to <dst>. [error if)WR(
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 target name already exists]
|
|
rmdir\201path\202\240\240\240\240 -- Remove the directory <path>
|
|
read\201fd, n\202\240\240\240\240 -- Read <n> bytes from <fd> and return as string.
|
|
stat\201path\202\240\240\240\240\240 -- Returns st_mode, st_ino, st_dev, st_nlink, st_uid,
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 st_gid, st_size, st_atime, st_mtime, st_ctime.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 [st_ino, st_uid, st_gid are dummy on Windows]\240
|
|
system\201command\202 -- Execute string <command> in a subshell. Returns exit
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 status of subshell.
|
|
times\201\202\240\240\240\240\240\240\240\240 -- return accumulated CPU times in sec \201user, system, children's user,
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 children's sys, elapsed real time\202. [3 last not on Windows]
|
|
unlink\201path\202\240\240\240 -- Unlink \201"delete"\202 path/file. same as: remove
|
|
utime\201path, \201aTime, mTime\202\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Set the access & modified time of the file to the given tuple of values.
|
|
wait\201\202\240\240\240\240\240\240\240\240\240 -- Wait for child process completion. Returns tuple of
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 pid, exit_status [Not on Windows]
|
|
waitpid\201pid, options\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Wait for process pid to complete. Returns tuple of
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 pid, exit_status [Not on Windows]
|
|
write\201fd, str\202\240 -- Write <str> to <fd>. Returns num bytes written.)RP(
|
|
|
|
)2 1 1 HR()2 Al()WB 16 Sn()EA()BD()I()+2 Bf add FZ(posixpath)Ef()ES()ES()Ea(
|
|
Do not import this module directly, import )I(os)ES( instead and refer
|
|
to this module as os.path. \201e.g. os.path.exists\201p\202\202 !
|
|
)0 P()BD(Some Functions \201see doc for more\202:)ES(
|
|
) 29 138 PR(exists\201p\202\240\240\240\240\240\240 -- True if string <p> is an existing path
|
|
expanduser\201p\202\240\240 -- Returns string that is \201a copy of\202 <p> with "~" expansion done.
|
|
expandvars\201p\202\240\240 -- Returns string that is \201a copy of\202 <p> with environment vars expanded.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 [Windows: case significant; Use Unix: )BD($)ES(var notation,not %var%]
|
|
getsize\201filename\202)-1 Bf add FZ(\240\240\240\240\240\240\240 [)BD(new)ES( in 1.5.2])Ef(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- return the size in bytes of <filename>. raise os.error.
|
|
getmtime\201filename\202\240)-1 Bf add FZ(\240\240\240\240\240 [)BD(new)ES( in 1.5.2])Ef(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- return last modification time of <filename> \201integer nb of seconds since epoch\202.
|
|
getatime\201filename\202\240)-1 Bf add FZ(\240\240\240\240\240 [)BD(new)ES( in 1.5.2])Ef(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- return last access time of <filename> \201integer nb of seconds since epoch\202.
|
|
isabs\201p\202\240\240\240\240\240\240\240 -- True if string <p> is an absolute path.
|
|
isdir\201p\202\240\240\240\240\240\240\240 -- True if string <p> is a directory.
|
|
islink\201p\202\240\240\240\240\240\240 -- True if string <p> is a symbolic link.
|
|
ismount\201p\202\240\240\240\240\240 -- True if string <p> is a mount point [true for all dirs on Windows].
|
|
join\201p[,q[,...]]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Joins one or more path components intelligently.
|
|
split\201p\202\240\240\240\240\240\240\240 -- Splits into \201head, tail\202 where <tail> is last
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 pathname component and <head> is everything leading
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 up to that. <=> \201dirname\201p\202, basename\201p\202\202
|
|
splitdrive\201p\202\240\240 -- Splits path in a pair \201'drive:', tail\202 [on Windows]
|
|
splitext\201p\202\240\240\240\240 -- Splits into \201root, ext\202 where last comp of <root>
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 contains no periods and <ext> is empty or starts
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 with a period.
|
|
walk\201p, visit, arg\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Calls the function <visit> with arguments
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 \201<arg>, <dirname>, <names>\202 for each directory recursively in
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 the directory tree rooted at <p> \201including p itself if it's a dir\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 The argument <dirname> specifies the visited directory, the argument
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <names> lists the files in the directory.\240 The <visit> function may
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 modify <names> to influence the set of directories visited below
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <dirname>, e.g., to avoid visiting certain parts of the tree.
|
|
[1.52, NT version: samefile\201\202, sameopenfile\201\202, samestat\201\202 deprecated because not reliable])RP(
|
|
|
|
)2 Al(
|
|
)2 0.6 1 HR()WB 17 Sn()EA()BD()I()+2 Bf add FZ(time)Ef()ES()ES()Ea(
|
|
|
|
)0 P()BD(Variables)ES(
|
|
) 2 87 PR(altzone\240\240\240\240\240\240\240 -- signed\240 offset of local DST timezone in sec west of the 0th meridian.
|
|
daylight\240\240\240\240\240\240 -- nonzero if a DST timezone is specified)RP(
|
|
)BD(Functions)ES(
|
|
) 11 137 PR(time\201\202\240\240\240\240\240\240\240\240 -- return a float representing UTC time in seconds since the epoch.
|
|
gmtime\201secs\202, localtime\201secs\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- return a tuple representing time : \201year aaaa, month\2011-12\202,
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 day\2011-31\202, hour\2010-23\202, minute\2010-59\202, second\2010-59\202, weekday
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 \2010-6, 0 is monday\202, Julian day\2011-366\202, daylight flag\201-1,0 or 1\202\202
|
|
asctime\201timeTuple\202,
|
|
strftime\201format, timeTuple\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- return a formated string representing time.
|
|
mktime\201tuple\202\240 -- inverse of localtime\201\202. Return a float.
|
|
strptime\201string[, format]\202\240\240\240\240\240\240\240)-1 Bf add FZ( [)BD(new)ES( in 1.5.2])Ef(\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- parse a formated string representing time, return tuple as in gmtime\201\202.
|
|
sleep\201secs\202\240\240\240 -- Suspend execution for <secs> seconds. <secs> can be a float.)RP(
|
|
|
|
) 1 23 PR(and also: clock, ctime.)RP(
|
|
|
|
)2 1 1 HR()2 Al()WB 18 Sn()EA()BD()I()+2 Bf add FZ(string)Ef()ES()ES()Ea(
|
|
|
|
)0 P()BD(Some Variables:)ES(
|
|
) 8 75 PR(digits\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- The string '0123456789'
|
|
hexdigits, octdigits\240\240\240 -- legal hexadecimal & octal digits
|
|
letters
|
|
uppercase
|
|
lowercase
|
|
whitespace
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Strings containing the appropriate characters
|
|
index_error\240\240\240\240\240\240\240\240\240\240\240\240 -- Exception raised by index\201\202 if substr not found.)RP(
|
|
|
|
) 22 89 PR()BD(Some Functions:)ES(\240
|
|
expandtabs\201s, tabSize\202\240 -- returns a copy of string <s> with tabs expanded.
|
|
find/rfind\201s, sub[, start=0[, end=0]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Return the lowest/highest index in <s> where the substring
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <sub> is found such that <sub> is wholly contained in
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 s[start:end]. Return -1 if <sub> not found.
|
|
ljust/rjust/center\201s, width\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Return a copy of string <s> left/right justified/centerd in a
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 field of given width, padded with spaces. <s> is never
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 truncated.
|
|
lower/upper\201s\202\240\240\240\240\240\240\240\240\240 -- Return a string that is \201a copy of\202 <s> in lowercase/uppercase
|
|
split\201s[, sep=whitespace[, maxsplit=0]]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Return a list containing the words of the string <s>,
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 using the string <sep> as a separator.
|
|
join\201words[, sep=' ']\202\240 -- Concatenate a list or tuple of words with intervening
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 separators; inverse of split.
|
|
replace\201s, old, new[, maxsplit=0]
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Returns a copy of string <s> with all occurences of substring
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 <old> replaced by <new>. Limits to <maxsplit> first
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 substitutions if specified.
|
|
strip\201s\202\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- Return a string that is \201a copy of\202 <s> without leading
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 and trailing whitespace. see also lstrip, rstrip.)RP(
|
|
|
|
)2 1 1 HR()2 Al()WB 19 Sn()EA()BD()I()+2 Bf add FZ(re)Ef()ES()ES()Ea(
|
|
Patterns are specified as strings. Tip: Use raw strings \201e.g. r'\200w*'\202 to
|
|
litteralize backslashes.
|
|
)0 P()BD(Regular Expression Syntax:)ES(
|
|
) 29 78 PR(.\240\240\240\240\240\240 matches any character \201including newline if DOTALL flag specified\202
|
|
^\240\240\240\240\240\240 matches start of the string \201of every line in MULTILINE mode\202
|
|
$\240\240\240\240\240\240 matches end of the string \201of every line in MULTILINE mode\202
|
|
*\240\240\240\240\240\240 0 or more of preceding regular expression \201as )BD(many)ES( as possible\202
|
|
+\240\240\240\240\240\240 1 or more of preceding regular expression \201as )BD(many)ES( as possible\202
|
|
?\240\240\240\240\240\240 0 or 1 occurence of preceding regular expression
|
|
*?, +?, ?? Same as\240 *, + and ? but matches as )BD(few)ES( characters as possible
|
|
{m,n}\240\240 matches from m to n repetitions of preceding RE
|
|
{m,n}?\240 idem, attempting to match as )BD(few)ES( repetitions as possible
|
|
[ ]\240\240\240\240 defines character set: e.g. '[a-zA-Z]' to match all letters
|
|
\240\240\240\240\240\240\240 \201see also \200w \200S\202
|
|
[^ ]\240\240\240 defines complemented character set: matches if char is NOT in set
|
|
\200\240\240\240\240\240\240 escapes special chars '*?+&$|\201\202' and introduces special sequences
|
|
\240\240\240\240\240\240\240 \201see below\202. Due to Python string rules, write as '\200\200' or
|
|
\240\240\240\240\240\240\240 r'\200' in the pattern string.
|
|
\200\200\240\240\240\240\240 matches a litteral '\200'; due to Python string rules, write as '\200\200\200\200'
|
|
\240\240\240\240\240\240\240 in pattern string, or better using raw string: r'\200\200'.
|
|
|\240\240\240\240\240\240 specifies alternative: 'foo|bar' matches 'foo' or 'bar'
|
|
\201...\202\240\240 matches any RE inside \201\202, and delimits a )I(group)ES(.
|
|
\201?:...\202 idem but does'nt delimit a )I(group)ES(.
|
|
\201?=...\202 matches if ... matches next, but doesn't consume any of the string
|
|
\240\240\240\240\240\240\240 e.g. 'Isaac \201?=Asimov\202' matches 'Isaac' only if followed by 'Asimov'.
|
|
\201?!...\202 matches if ... )BD(doesn't)ES( match next. Negative of \201?=...\202
|
|
\201?P<)I(name)ES(>...\202 matches any RE inside \201\202, and delimits a )BD(named)ES( )I(group)ES(.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240 \201e.g. r'\201?P<id>[a-zA-Z_]\200w*\202' defines a group named )I(id)ES(\202
|
|
\201?P=)I(name)ES(\202 matches whatever text was matched by the earlier group named )I(name)ES(.
|
|
\201?#...\202 A comment; ignored.
|
|
\201?)I(letter)ES(\202 )I(letter)ES( is one of 'i','L', 'm', 's', 'x'. Set the corresponding flags
|
|
\240\240\240\240\240\240\240 \201re.I, re.L, re.M, re.S, re.X\202 for the entire RE.)RP(
|
|
|
|
) 13 77 PR(\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 )UN(SPECIAL SEQUENCES)NU(:
|
|
\200)I(number)ES( matches content of the )I(group)ES( of the same number; groups are numbered
|
|
\240\240\240\240\240\240\240 starting from 1
|
|
\200A\240\240\240\240\240 matches only at the start of the string
|
|
\200b\240\240\240\240\240 empty str at beg or end of )I(word)ES(: '\200bis\200b' matches 'is', but not 'his'
|
|
\200B\240\240\240\240\240 empty str NOT at beginning or end of word
|
|
\200d\240\240\240\240\240 any decimal digit \201<=> [0-9]\202
|
|
\200D\240\240\240\240\240 any non-decimal digit char \201<=> [^O-9]\202
|
|
\200s\240\240\240\240\240 any whitespace char \201<=> [ \200t\200n\200r\200f\200v]\202
|
|
\200S\240\240\240\240\240 any non-whitespace char \201<=> [^ \200t\200n\200r\200f\200v]\202
|
|
\200w\240\240\240\240\240 any alphaNumeric char \201depends on LOCALE flag\202
|
|
\200W\240\240\240\240\240 any non-alphaNumeric char \201depends on LOCALE flag\202
|
|
\200Z\240\240\240\240\240 matches only at the end of the string)RP(
|
|
)BD(Variables:)ES(
|
|
) 1 70 PR(error\240\240\240\240\240\240\240\240\240\240 -- Exception when pattern string isn't a valid regexp.)RP(
|
|
)BD(Functions:)ES(
|
|
) 10 84 PR()WB 20 Sn()EA(compile\201pattern[, flags=0]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240 -- Compile a RE pattern string into a )I()0 21 1 A(regular expression object)21 0 TN TL()Ec /AF f D()ES(.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Flags \201combinable by |\202:
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 I or IGNORECASE or \201?i\202:\240\240 case insensitive matching
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 L or LOCALE or \201?L\202:\240\240\240 make \200w, \200W, \200b, \200B dependent on the
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 current locale
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 M or MULTILINE or \201?m\202: matches every new line and not only
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 start/end of the whole string
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 S or DOTALL or \201?s\202:\240\240\240 '.' matches ALL chars, including newline
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 X or VERBOSE or \201?x\202)RP(
|
|
|
|
) 20 142 PR(escape\201string\202\240\240\240 -- return \201a copy of\202 string with all non-alphanumerics backslashed.
|
|
match\201pattern, string[, flags]\202
|
|
\240\240\240\240\240\240\240\240\240 -- if 0 or more chars at )BD(beginning)ES( of <string> match the RE pattern string,
|
|
\240\240\240\240\240\240\240\240\240\240\240\240 return a corresponding )I()0 22 1 A(MatchObject)22 0 TN TL()Ec /AF f D()ES( instance, or None if no match.
|
|
search\201pattern, string[, flags]\202
|
|
\240\240\240\240\240\240\240\240\240 --scan thru <string> for a location matching <pattern>, return a
|
|
\240\240\240\240\240\240\240\240\240\240\240 corresponding )I()0 22 1 A(MatchObject)22 0 TN TL()Ec /AF f D()ES( instance, or None if no match.
|
|
split\201pattern, string[, maxsplit=0]\202
|
|
\240\240\240\240\240\240\240\240\240 --split <string> by occurrences of <pattern>. If capturing \201\202 are used in
|
|
\240\240\240\240\240\240\240\240\240\240\240 pattern, then occurrences of patterns or subpatterns are also returned.
|
|
findall\201pattern, string\202\240 [)BD(new)ES( in 1.5.2]
|
|
\240\240\240\240\240\240\240\240\240 --return a list of non-overlapping matches in <pattern>, either a list of
|
|
\240\240\240\240\240\240\240\240\240\240\240 groups or a list of tuples if the pattern has more than 1 group.
|
|
sub\201pattern, repl, string[, count=0]\202
|
|
\240\240\240\240\240\240\240\240\240 --return string obtained by replacing the \201<count> first\202 lefmost non-
|
|
\240\240\240\240\240\240\240\240\240\240\240 overlapping occurrences of <pattern> \201a string or a RE object\202 in <string>
|
|
\240\240\240\240\240\240\240\240\240\240\240 by <repl>; <repl> can be a string or a fct called with a single )I()0 22 1 A(MatchObj)22 0 TN TL()Ec /AF f D()ES(\240\240\240\240\240\240\240\240\240\240\240 arg, which must return the replacement string.
|
|
subn\201pattern, repl, string[, count=0]\202
|
|
|
|
\240\240\240\240\240\240\240\240\240 --same as sub\201\202, but returns a tuple \201newString, numberOfSubsMade\202)RP(
|
|
)WB 21 Sn()EA()BD(Regular Expression Objects)ES(
|
|
)BR(\201RE objects are returned by the )0 20 1 A(compile)20 0 TN TL()Ec /AF f D( fct\202
|
|
)0 P()BD(Attributes:)ES(
|
|
) 3 78 PR(flags\240\240\240\240\240\240\240 -- flags arg used when RE obj was compiled, or 0 if none provided
|
|
groupindex\240\240 -- dictionary of {group name: group number} in pattern
|
|
pattern\240\240\240\240\240 -- pattern string from which RE obj was compiled)RP(
|
|
)BD(Methods:)ES(
|
|
) 6 58 PR(match\201string[, pos][, endpos]\202
|
|
search\201string[, pos][, endpos]\202
|
|
split\201string[, maxsplit=0]\202
|
|
findall\201string\202\240\240\240 [)BD(new)ES( in 1.5.2]
|
|
sub\201repl, string[, count=0]\202
|
|
subn\201repl, string[, count=0]\202 -- see equivalent functions.)RP(
|
|
)WB 22 Sn()EA()BD(Match Objects)ES(
|
|
)BR(\201Match objects are returned by the match & search functions\202
|
|
)0 P()BD(Attributes:)ES(
|
|
) 6 81 PR(pos\240\240\240\240\240\240\240 -- value of pos passed to search or match functions; index into
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240 string at which RE engine started search.
|
|
endpos\240\240\240\240 -- value of endpos passed to search or match functions; index into
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240 string beyond which RE engine won't go.
|
|
re\240\240\240\240\240\240\240\240 -- RE object whose match or search fct produced this MatchObj instance
|
|
string\240\240\240\240 -- string passed to match\201\202 or search\201\202)RP(
|
|
)BD(Methods:)ES(
|
|
) 14 88 PR(group\201[g1, g2, ...]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240 -- returns one or more groups of the match. If )BD(one)ES( arg, result is a string;
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 if multiple args, result is a tuple with one item per arg. If )I(gi)ES( is 0,
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 return value is entire matching string; if 1 <= )I(gi)ES( <= 99, return
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 string matching group #)I(gi)ES( \201or None if no such group\202; )I(gi)ES( may also be
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 a group )I(name)ES(.
|
|
groups\201\202\240\240\240\240 -- returns a tuple of all groups of the match; groups not participating
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 to the match have a value of None. Returns a string instead of tuple
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 if len\201tuple\202=1
|
|
start\201group\202
|
|
end\201group\202\240\240 -- returns indices of start & end of substring matched by group \201or None
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 if group exists but doesn't contribute to the match\202
|
|
span\201group\202\240 -- returns the 2-tuple \201start\201group\202, end\201group\202\202; can be \201None, None\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 if group didn't contibute to the match.)RP(
|
|
|
|
)2 1 1 HR()2 Al()WB 23 Sn()EA()BD()I()+2 Bf add FZ(math)Ef()ES()ES()Ea(
|
|
|
|
)0 P()BD(Variables:)ES(
|
|
) 2 2 PR(pi
|
|
e)RP(
|
|
)BD(Functions \201see ordinary C man pages for info\202:)ES(
|
|
) 22 57 PR(acos\201x\202
|
|
asin\201x\202
|
|
atan\201x\202
|
|
atan2\201x, y\202
|
|
ceil\201x\202
|
|
cos\201x\202
|
|
cosh\201x\202
|
|
exp\201x\202
|
|
fabs\201x\202
|
|
floor\201x\202
|
|
fmod\201x, y\202
|
|
frexp\201x\202\240\240\240\240\240\240\240 -- Unlike C: \201float, int\202 = frexp\201float\202
|
|
ldexp\201x, y\202
|
|
log\201x\202
|
|
log10\201x\202
|
|
modf\201x\202\240\240\240\240\240\240\240\240 -- Unlike C: \201float, float\202 = modf\201float\202
|
|
pow\201x, y\202
|
|
sin\201x\202
|
|
sinh\201x\202
|
|
sqrt\201x\202
|
|
tan\201x\202
|
|
tanh\201x\202)RP(
|
|
|
|
)2 1 1 HR()2 Al()WB 24 Sn()EA()BD()I()+2 Bf add FZ(getopt)Ef()ES()ES()Ea(
|
|
|
|
)0 P()BD(Functions:)ES(
|
|
) 9 68 PR(getopt\201list, optstr\202\240\240\240 -- Similar to C. <optstr> is option
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 letters to look for. Put ':' after letter
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 if option takes arg. E.g.
|
|
\240\240\240 # invocation was "python test.py -c hi -a arg1 arg2"
|
|
\240\240\240\240\240\240 opts, args =\240 getopt.getopt\201sys.argv[1:], 'ab:c:'\202\240\240\240
|
|
\240\240\240 # opts would be
|
|
\240\240\240\240\240\240 [\201'-c', 'hi'\202, \201'-a', ''\202]
|
|
\240\240\240 # args would be
|
|
\240\240\240\240\240\240 ['arg1', 'arg2'])RP(
|
|
|
|
) 0 0 PR()2 1 1 HR()RP(
|
|
|
|
)0 2 48 H()WB 77 Sn()WB 25 Sn()EA(List of modules in base distribution)EH(
|
|
|
|
)0 3 49 H(Contents)WB 78 Sn( of Lib directory)BR()-1 Bf add FZ(\201Python 1.52 NT distribution, may be slightly different in
|
|
other distributions\202)Ef()EH(
|
|
|
|
) 145 89 PR(aifc\240\240\240\240\240\240\240\240\240\240\240 --\240 Stuff to parse AIFF-C and AIFF files.
|
|
anydbm\240\240\240\240\240\240\240\240\240 --\240 Generic interface to all dbm clones. \201dbhash, gdbm, dbm,dumbdbm\202
|
|
asynchat\240\240\240\240\240\240\240 --\240 Support for 'chat' style protocols
|
|
asyncore\240\240\240\240\240\240\240 --\240 Asynchronous File I/O \201in )I(select)ES( style\202
|
|
audiodev\240\240\240\240\240\240\240 --\240 Audio support for a few platforms.
|
|
base64\240\240\240\240\240\240\240\240\240 --\240 Conversions to/from base64 RFC-MIME transport encoding .
|
|
BaseHTTPServer\240 --\240 Base class forhttp services.
|
|
Bastion\240\240\240\240\240\240\240\240 --\240 "Bastionification" utility \201control access to instance vars\202
|
|
bdb\240\240\240\240\240\240\240\240\240\240\240\240 --\240 A generic Python debugger base class.
|
|
binhex\240\240\240\240\240\240\240\240\240 --\240 Macintosh binhex compression/decompression.
|
|
bisect\240\240\240\240\240\240\240\240\240 --\240 List bisection algorithms.
|
|
calendar\240\240\240\240\240\240\240 --\240 Calendar printing functions.
|
|
cgi\240\240\240\240\240\240\240\240\240\240\240\240 --\240 Wraps the WWW Forms Common Gateway Interface \201CGI\202.
|
|
CGIHTTPServer\240\240 --\240 CGI http services.
|
|
cmd\240\240\240\240\240\240\240\240\240\240\240\240 --\240 A generic class to build line-oriented command interpreters.
|
|
cmp\240\240\240\240\240\240\240\240\240\240\240\240 --\240 Efficiently compare files, boolean outcome only.
|
|
cmpcache\240\240\240\240\240\240\240 --\240 Same, but caches 'stat' results for speed.
|
|
code\240\240\240\240\240\240\240\240\240\240\240 --\240 Utilities needed to emulate Python's interactive interpreter
|
|
colorsys\240\240\240\240\240\240\240 --\240 Conversion functions between RGB and other color systems.
|
|
commands\240\240\240\240\240\240\240 --\240 Tools for executing UNIX commands .
|
|
compileall\240\240\240\240\240 --\240 Force "compilation" of all .py files in a directory.
|
|
ConfigParser\240\240\240 --\240 Configuration file parser \201much like windows .ini files\202
|
|
copy\240\240\240\240\240\240\240\240\240\240\240 --\240 Generic shallow and deep copying operations.
|
|
copy_reg\240\240\240\240\240\240\240 --\240 Helper to provide extensibility for pickle/cPickle.
|
|
dbhash\240\240\240\240\240\240\240\240\240 --\240 \201g\202dbm-compatible interface to bsdhash.hashopen.
|
|
dircache\240\240\240\240\240\240\240 --\240 Sorted list of files in a dir, using a cache.
|
|
dircmp\240\240\240\240\240\240\240\240\240 --\240 Defines a class to build directory diff tools on.
|
|
dis\240\240\240\240\240\240\240\240\240\240\240\240 --\240 Bytecode disassembler.
|
|
dospath\240\240\240\240\240\240\240\240 --\240 Common operations on DOS pathnames.
|
|
dumbdbm\240\240\240\240\240\240\240\240 --\240 A dumb and slow but simple dbm clone.
|
|
dump\240\240\240\240\240\240\240\240\240\240\240 --\240 Print python code that reconstructs a variable.)WR(
|
|
exceptions\240\240\240\240\240 --\240 Class based built-in exception hierarchy.
|
|
fileinput\240\240\240\240\240\240 --\240 Helper class to quickly write a loop over all standard input files.
|
|
find\240\240\240\240\240\240\240\240\240\240\240 --\240 Find files directory hierarchy matching a pattern.
|
|
fnmatch\240\240\240\240\240\240\240\240 --\240 Filename matching with shell patterns.
|
|
formatter\240\240\240\240\240\240 --\240 A test formatter.
|
|
fpformat\240\240\240\240\240\240\240 --\240 General floating point formatting functions.
|
|
ftplib\240\240\240\240\240\240\240\240\240 --\240 An FTP client class.\240 Based on RFC 959.
|
|
getopt\240\240\240\240\240\240\240\240\240 --\240 Standard command line processing.
|
|
getpass\240\240\240\240\240\240\240\240 --\240 Utilities to get a password and/or the current user name.
|
|
glob\240\240\240\240\240\240\240\240\240\240\240 --\240 filename globbing.
|
|
gopherlib\240\240\240\240\240\240 --\240 Gopher protocol client interface.
|
|
grep\240\240\240\240\240\240\240\240\240\240\240 --\240 'grep' utilities.
|
|
gzip\240\240\240\240\240\240\240\240\240\240\240 --\240 Read & write gzipped files.
|
|
htmlentitydefs\240 --\240 Proposed entity definitions for HTML.
|
|
htmllib\240\240\240\240\240\240\240\240 --\240 HTML parsing utilities.
|
|
httplib\240\240\240\240\240\240\240\240 --\240 HTTP client class.
|
|
ihooks\240\240\240\240\240\240\240\240\240 --\240 Hooks into the "import" mechanism.
|
|
imaplib\240\240\240\240\240\240\240\240 --\240 IMAP4 client.Based on RFC 2060.
|
|
imghdr\240\240\240\240\240\240\240\240\240 --\240 Recognizing image files based on their first few bytes.
|
|
keyword\240\240\240\240\240\240\240\240 --\240 List of Python keywords.
|
|
knee\240\240\240\240\240\240\240\240\240\240\240 --\240 A Python re-implementation of hierarchical module import.
|
|
linecache\240\240\240\240\240\240 --\240 Cache lines from files.
|
|
locale\240\240\240\240\240\240\240\240\240 --\240 Support for number formatting using the current locale settings.
|
|
macpath\240\240\240\240\240\240\240\240 --\240 Pathname \201or related\202 operations for the Macintosh.
|
|
macurl2path\240\240\240\240 --\240 Mac specific module for conversion between pathnames and URLs.
|
|
mailbox\240\240\240\240\240\240\240\240 --\240 A class to handle a unix-style or mmdf-style mailbox.
|
|
mailcap\240\240\240\240\240\240\240\240 --\240 Mailcap file handling \201RFC 1524\202.
|
|
mhlib\240\240\240\240\240\240\240\240\240\240 --\240 MH \201mailbox\202 interface.
|
|
mimetools\240\240\240\240\240\240 --\240 Various tools used by MIME-reading or MIME-writing programs.
|
|
mimetypes\240\240\240\240\240\240 --\240 Guess the MIME type of a file.)WR(
|
|
MimeWriter\240\240\240\240\240 --\240 Generic MIME writer.
|
|
mimify\240\240\240\240\240\240\240\240\240 --\240 Mimification and unmimification of mail messages.
|
|
multifile\240\240\240\240\240\240 --\240 Class to make multi-file messages easier to handle.
|
|
mutex\240\240\240\240\240\240\240\240\240\240 --\240 Mutual exclusion -- for use with module sched.
|
|
netrc\240\240\240\240\240\240\240\240\240\240 --\240\240
|
|
nntplib\240\240\240\240\240\240\240\240 --\240 An NNTP client class.\240 Based on RFC 977.
|
|
ntpath\240\240\240\240\240\240\240\240\240 --\240 Common operations on DOS pathnames.
|
|
nturl2path\240\240\240\240\240 --\240 Mac specific module for conversion between pathnames and URLs.
|
|
os\240\240\240\240\240\240\240\240\240\240\240\240\240 --\240 Either mac, dos or posix depending system.
|
|
packmail\240\240\240\240\240\240\240 --\240 Create a self-unpacking shell archive.
|
|
pdb\240\240\240\240\240\240\240\240\240\240\240\240 --\240 A Python debugger.
|
|
pickle\240\240\240\240\240\240\240\240\240 --\240 Pickling \201save and restore\202 of Python objects \201a faster C
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 implementation exists in built-in module: cPickle\202.
|
|
pipes\240\240\240\240\240\240\240\240\240\240 --\240 Conversion pipeline templates.
|
|
poly\240\240\240\240\240\240\240\240\240\240\240 --\240 Polynomials.
|
|
popen2\240\240\240\240\240\240\240\240\240 --\240 variations on pipe open.
|
|
poplib\240\240\240\240\240\240\240\240\240 --\240 A POP3 client class. Based on the J. Myers POP3 draft.
|
|
posixfile\240\240\240\240\240\240 --\240 Extended \201posix\202 file operations.
|
|
posixpath\240\240\240\240\240\240 --\240 Common operations on POSIX pathnames.
|
|
pprint\240\240\240\240\240\240\240\240\240 --\240 Support to pretty-print lists, tuples, & dictionaries recursively.
|
|
profile\240\240\240\240\240\240\240\240 --\240 Class for profiling python code.
|
|
pstats\240\240\240\240\240\240\240\240\240 --\240 Class for printing reports on profiled python code.
|
|
pty\240\240\240\240\240\240\240\240\240\240\240\240 --\240 Pseudo terminal utilities.
|
|
py_compile\240\240\240\240\240 --\240 Routine to "compile" a .py file to a .pyc file.
|
|
pyclbr\240\240\240\240\240\240\240\240\240 --\240 Parse a Python file and retrieve classes and methods.
|
|
Queue\240\240\240\240\240\240\240\240\240\240 --\240 A multi-producer, multi-consumer queue.
|
|
quopri\240\240\240\240\240\240\240\240\240 --\240 Conversions to/from quoted-printable transport encoding.
|
|
rand\240\240\240\240\240\240\240\240\240\240\240 --\240 Don't use unless you want compatibility with C's rand\201\202.
|
|
random\240\240\240\240\240\240\240\240\240 --\240 Random variable generators \201obsolete, use whrandom\202
|
|
re\240\240\240\240\240\240\240\240\240\240\240\240\240 --\240 Regular Expressions.)WR(
|
|
reconvert\240\240\240\240\240\240 --\240 Convert old \201"regex"\202 regular expressions to new syntax \201"re"\202.
|
|
regex_syntax\240\240\240 --\240 Flags for regex.set_syntax\201\202.
|
|
regexp\240\240\240\240\240\240\240\240\240 --\240 Backward compatibility for module "regexp" using "regex".
|
|
regsub\240\240\240\240\240\240\240\240\240 --\240 Regular expression subroutines.
|
|
repr\240\240\240\240\240\240\240\240\240\240\240 --\240 Redo repr\201\202 but with limits on most sizes.
|
|
rexec\240\240\240\240\240\240\240\240\240\240 --\240 Restricted execution facilities \201"safe" exec, eval, etc\202.
|
|
rfc822\240\240\240\240\240\240\240\240\240 --\240 RFC-822 message manipulation class.
|
|
rlcompleter\240\240\240\240 --\240 Word completion for GNU readline 2.0.
|
|
sched\240\240\240\240\240\240\240\240\240\240 --\240 A generally useful event scheduler class.
|
|
sgmllib\240\240\240\240\240\240\240\240 --\240 A parser for SGML.
|
|
shelve\240\240\240\240\240\240\240\240\240 --\240 Manage shelves of pickled objects.
|
|
shlex\240\240\240\240\240\240\240\240\240\240 --\240 Lexical analyzer class for simple shell-like syntaxes.
|
|
shutil\240\240\240\240\240\240\240\240\240 --\240 Utility functions usable in a shell-like program.
|
|
SimpleHTTPServer--\240 Simple extension to base http class
|
|
site\240\240\240\240\240\240\240\240\240\240\240 --\240 Append module search paths for third-party packages to sys.path.
|
|
smtplib\240\240\240\240\240\240\240\240 --\240 SMTP Client class \201RFC 821\202
|
|
sndhdr\240\240\240\240\240\240\240\240\240 --\240 Several routines that help recognizing sound.
|
|
SocketServer\240\240\240 --\240 Generic socket server classes.
|
|
stat\240\240\240\240\240\240\240\240\240\240\240 --\240 Constants and functions for interpreting stat/lstat struct.
|
|
statcache\240\240\240\240\240\240 --\240 Maintain a cache of file stats.
|
|
statvfs\240\240\240\240\240\240\240\240 --\240 Constants for interpreting statvfs struct as returned by os.statvfs\201\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 and os.fstatvfs\201\202 \201if they exist\202.
|
|
string\240\240\240\240\240\240\240\240\240 --\240 A collection of string operations.
|
|
StringIO\240\240\240\240\240\240\240 --\240 File-like objects that read/write a string buffer \201a faster
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 C implementation exists in built-in module: cStringIO\202.
|
|
sunau\240\240\240\240\240\240\240\240\240\240 --\240 Stuff to parse Sun and NeXT audio files.
|
|
sunaudio\240\240\240\240\240\240\240 --\240 Interpret sun audio headers.
|
|
symbol\240\240\240\240\240\240\240\240\240 --\240 Non-terminal symbols of Python grammar \201from "graminit.h"\202.
|
|
telnetlib\240\240\240\240\240\240 --\240 TELNET client class. Based on RFC 854.
|
|
tempfile\240\240\240\240\240\240\240 --\240 Temporary file name allocation.)WR(
|
|
threading\240\240\240\240\240\240 --\240 Proposed new higher-level threading interfaces\240
|
|
threading_api\240\240 --\240 \201doc of the threading module\202
|
|
toaiff\240\240\240\240\240\240\240\240\240 --\240 Convert "arbitrary" sound files to AIFF files .
|
|
token\240\240\240\240\240\240\240\240\240\240 --\240 Tokens \201from "token.h"\202.
|
|
tokenize\240\240\240\240\240\240\240 --\240 Compiles a regular expression that recognizes Python tokens.
|
|
traceback\240\240\240\240\240\240 --\240 Format and print Python stack traces.
|
|
tty\240\240\240\240\240\240\240\240\240\240\240\240 --\240 Terminal utilities.
|
|
turtle\240\240\240\240\240\240\240\240\240 --\240 LogoMation-like turtle graphics
|
|
types\240\240\240\240\240\240\240\240\240\240 --\240 Define names for all type symbols in the std interpreter.
|
|
tzparse\240\240\240\240\240\240\240\240 --\240 Parse a timezone specification.
|
|
urllib\240\240\240\240\240\240\240\240\240 --\240 Open an arbitrary URL.
|
|
urlparse\240\240\240\240\240\240\240 --\240 Parse URLs according to latest draft of standard.
|
|
user\240\240\240\240\240\240\240\240\240\240\240 --\240 Hook to allow user-specified customization code to run.
|
|
UserDict\240\240\240\240\240\240\240 --\240 A wrapper to allow subclassing of built-in dict class.
|
|
UserList\240\240\240\240\240\240\240 --\240 A wrapper to allow subclassing of built-in list class.
|
|
util\240\240\240\240\240\240\240\240\240\240\240 --\240 some useful functions that don't fit elsewhere !!
|
|
uu\240\240\240\240\240\240\240\240\240\240\240\240\240 --\240 UUencode/UUdecode.
|
|
wave\240\240\240\240\240\240\240\240\240\240\240 --\240 Stuff to parse WAVE files.
|
|
whatsound\240\240\240\240\240\240 --\240 Several routines that help recognizing sound files.
|
|
whichdb\240\240\240\240\240\240\240\240 --\240 Guess which db package to use to open a db file.
|
|
whrandom\240\240\240\240\240\240\240 --\240 Wichmann-Hill random number generator.
|
|
xdrlib\240\240\240\240\240\240\240\240\240 --\240 Implements \201a subset of\202 Sun XDR \201eXternal Data Representation\202
|
|
xmllib\240\240\240\240\240\240\240\240\240 --\240 A parser for XML, using the derived class as static DTD.
|
|
zmod\240\240\240\240\240\240\240\240\240\240\240 --\240 Demonstration of abstruse mathematical concepts.)RP(
|
|
|
|
)0 3 50 H()WB 79 Sn(
|
|
)2 0.6 1 HR()EH(
|
|
|
|
)0 3 51 H()WB 80 Sn()-1 Bf add FZ(\201following list not revised\202)BR()BR()Ef(* Built-ins *)EH(
|
|
|
|
) 9 87 PR(\240\240\240\240\240\240\240\240\240\240\240 sys\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Interpreter state vars and functions
|
|
\240\240\240\240\240\240\240\240\240\240\240 __built-in__\240\240\240\240\240\240\240 Access to all built-in python identifiers
|
|
\240\240\240\240\240\240\240\240\240\240\240 __main__\240\240\240\240\240\240\240\240\240\240\240 Scope of the interpreters main program, script or stdin
|
|
\240\240\240\240\240\240\240\240\240\240\240 array\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Obj efficiently representing arrays of basic values
|
|
\240\240\240\240\240\240\240\240\240\240\240 math\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Math functions of C standard
|
|
\240\240\240\240\240\240\240\240\240\240\240 time\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Time-related functions
|
|
\240\240\240\240\240\240\240\240\240\240\240 regex\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Regular expression matching operations
|
|
\240\240\240\240\240\240\240\240\240\240\240 marshal\240\240\240\240\240\240\240\240\240\240\240\240 Read and write some python values in binary format
|
|
\240\240\240\240\240\240\240\240\240\240\240 struct\240\240\240\240\240\240\240\240\240\240\240\240\240 Convert between python values and C structs)RP(
|
|
|
|
)0 3 52 H(*)WB 81 Sn( Standard *)EH(
|
|
|
|
) 7 87 PR(\240\240\240\240\240\240\240\240\240\240\240 getopt\240\240\240\240\240\240\240\240\240\240\240\240\240 Parse cmd line args in sys.argv.\240 A la UNIX 'getopt'.
|
|
\240\240\240\240\240\240\240\240\240\240\240 os\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 A more portable interface to OS dependent functionality
|
|
\240\240\240\240\240\240\240\240\240\240\240 re\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Functions useful for working with regular expressions
|
|
\240\240\240\240\240\240\240\240\240\240\240 string\240\240\240\240\240\240\240\240\240\240\240\240\240 Useful string and characters functions and exceptions
|
|
\240\240\240\240\240\240\240\240\240\240\240 whrandom\240\240\240\240\240\240\240\240\240\240\240 Wichmann-Hill pseudo-random number generator
|
|
\240\240\240\240\240\240\240\240\240\240\240 thread\240\240\240\240\240\240\240\240\240\240\240\240\240 Low-level primitives for working with process threads
|
|
\240\240\240\240\240\240\240\240\240\240\240 threading\240\240\240\240\240\240\240\240\240\240 idem, new recommanded interface.)RP(
|
|
|
|
)0 3 53 H(*)WB 82 Sn( Unix/Posix *)EH(
|
|
|
|
) 7 86 PR(\240\240\240\240\240\240\240\240\240\240\240 dbm\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Interface to Unix ndbm database library
|
|
\240\240\240\240\240\240\240\240\240\240\240 grp\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Interface to Unix group database
|
|
\240\240\240\240\240\240\240\240\240\240\240 posix\240\240\240\240\240\240\240\240\240\240\240\240\240\240 OS functionality standardized by C and POSIX standards
|
|
\240\240\240\240\240\240\240\240\240\240\240 posixpath\240\240\240\240\240\240\240\240\240\240 POSIX pathname functions
|
|
\240\240\240\240\240\240\240\240\240\240\240 pwd\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Access to the Unix password database
|
|
\240\240\240\240\240\240\240\240\240\240\240 select\240\240\240\240\240\240\240\240\240\240\240\240\240 Access to Unix select multiplex file synchronization
|
|
\240\240\240\240\240\240\240\240\240\240\240 socket\240\240\240\240\240\240\240\240\240\240\240\240\240 Access to BSD socket interface)RP(
|
|
|
|
)0 3 54 H(*)WB 83 Sn( Tk User-interface Toolkit *)EH(
|
|
|
|
) 1 52 PR(\240\240\240\240\240\240\240\240\240\240\240 tkinter\240\240\240\240\240\240\240\240\240\240\240\240 Main interface to Tk)RP(
|
|
|
|
)0 3 55 H(*)WB 84 Sn( Multimedia *)EH(
|
|
|
|
) 4 80 PR(\240\240\240\240\240\240\240\240\240\240\240 audioop\240\240\240\240\240\240\240\240\240\240\240\240 Useful operations on sound fragments
|
|
\240\240\240\240\240\240\240\240\240\240\240 imageop\240\240\240\240\240\240\240\240\240\240\240\240 Useful operations on images
|
|
\240\240\240\240\240\240\240\240\240\240\240 jpeg\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Access to jpeg image compressor and decompressor
|
|
\240\240\240\240\240\240\240\240\240\240\240 rgbimg\240\240\240\240\240\240\240\240\240\240\240\240\240 Access SGI imglib image files)RP(
|
|
|
|
)0 3 56 H(*)WB 85 Sn( Cryptographic Extensions *)EH(
|
|
|
|
) 3 84 PR(\240\240\240\240\240\240\240\240\240\240\240 md5\240\240\240\240\240\240\240\240 Interface to RSA's MD5 message digest algorithm
|
|
\240\240\240\240\240\240\240\240\240\240\240 mpz\240\240\240\240\240\240\240\240 Interface to int part of GNU multiple precision library
|
|
\240\240\240\240\240\240\240\240\240\240\240 rotor\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Implementation of a rotor-based encryption algorithm)RP(
|
|
|
|
)0 3 57 H(*)WB 86 Sn( Stdwin * Standard Window System)EH(
|
|
|
|
) 3 78 PR(\240\240\240\240\240\240\240\240\240\240\240 stdwin\240\240\240\240\240\240\240\240\240\240\240\240\240 Standard Window System interface
|
|
\240\240\240\240\240\240\240\240\240\240\240 stdwinevents\240\240\240\240\240\240\240 Stdwin event, command, and selection constants
|
|
\240\240\240\240\240\240\240\240\240\240\240 rect\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Rectangle manipulation operations)RP(
|
|
|
|
)0 3 58 H(*)WB 87 Sn( SGI IRIX * \2014 & 5\202)EH(
|
|
|
|
) 10 54 PR(\240\240\240\240\240\240\240\240\240\240\240 al\240\240\240\240\240\240\240\240\240 SGI audio facilities
|
|
\240\240\240\240\240\240\240\240\240\240\240 AL\240\240\240\240\240\240\240\240\240 al constants
|
|
\240\240\240\240\240\240\240\240\240\240\240 fl\240\240\240\240\240\240\240\240\240 Interface to FORMS library
|
|
\240\240\240\240\240\240\240\240\240\240\240 FL\240\240\240\240\240\240\240\240\240 fl constants
|
|
\240\240\240\240\240\240\240\240\240\240\240 flp Functions for form designer
|
|
\240\240\240\240\240\240\240\240\240\240\240 fm\240\240\240\240\240\240\240\240\240 Access to font manager library
|
|
\240\240\240\240\240\240\240\240\240\240\240 gl\240\240\240\240\240\240\240\240\240 Access to graphics library
|
|
\240\240\240\240\240\240\240\240\240\240\240 GL\240\240\240\240\240\240\240\240\240 Constants for gl
|
|
\240\240\240\240\240\240\240\240\240\240\240 DEVICE\240\240\240\240\240 More constants for gl
|
|
\240\240\240\240\240\240\240\240\240\240\240 imgfile\240\240\240\240 Imglib image file interface)RP(
|
|
|
|
)0 3 59 H(*)WB 88 Sn( Suns *)EH(
|
|
|
|
) 1 53 PR(\240\240\240\240\240\240\240\240\240\240\240 sunaudiodev Access to sun audio interface)RP(
|
|
|
|
)2 0.6 1 HR()0 2 60 H()WB 89 Sn()WB 26 Sn()EA(Workspace exploration and idiom hints)EH(
|
|
|
|
) 8 85 PR(\240\240\240\240\240\240\240 dir\201<module>\202\240\240 list functions, variables in <module>
|
|
\240\240\240\240\240\240\240 dir\201\202\240\240\240\240\240\240\240\240\240\240 get object keys, defaults to local name space
|
|
\240\240\240\240\240\240\240 X.__methods__\240\240 list of methods supported by X \201if any\202
|
|
\240\240\240\240\240\240\240 X.__members__\240\240 List of X's data attributes
|
|
\240\240\240\240\240\240\240 if __name__ == '__main__': main\201\202\240\240\240\240\240\240\240\240\240\240\240 invoke main if running as script
|
|
\240\240\240\240\240\240\240 map\201None, lst1, lst2, ...\202\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 merge lists
|
|
\240\240\240\240\240\240\240 b = a[:]\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 create copy of seq structure
|
|
\240\240\240\240\240\240\240 _\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 in interactive mode, is last value printed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
)2 1 1 HR()RP(
|
|
|
|
)0 2 61 H()WB 90 Sn()WB 27 Sn()EA(Python Mode for Emacs)EH(
|
|
|
|
) 1 38 PR()BD()-1 Bf add FZ(\201Not revised, possibly not up to date\202)Ef()ES()RP(
|
|
|
|
) 54 75 PR(Type C-c ? when in python-mode for extensive help.
|
|
|
|
INDENTATION
|
|
|
|
Primarily for entering new code:
|
|
\240\240\240\240\240\240\240 TAB\240\240\240\240\240 indent line appropriately
|
|
\240\240\240\240\240\240\240 LFD\240\240\240\240\240 insert newline, then indent
|
|
\240\240\240\240\240\240\240 DEL\240\240\240\240\240 reduce indentation, or delete single character
|
|
|
|
Primarily for reindenting existing code:
|
|
\240\240\240\240\240\240\240 C-c :\240\240\240 guess py-indent-offset from file content; change locally
|
|
\240\240\240\240\240\240\240 C-u C-c :\240\240\240\240\240\240\240 ditto, but change globally
|
|
|
|
\240\240\240\240\240\240\240 C-c TAB\240 reindent region to match its context
|
|
\240\240\240\240\240\240\240 C-c <\240\240\240 shift region left by py-indent-offset
|
|
\240\240\240\240\240\240\240 C-c >\240\240\240 shift region right by py-indent-offset
|
|
|
|
|
|
MARKING & MANIPULATING REGIONS OF CODE
|
|
|
|
C-c C-b\240\240\240\240\240\240\240\240 mark block of lines
|
|
M-C-h\240\240\240\240\240\240\240\240\240\240 mark smallest enclosing def
|
|
C-u M-C-h\240\240\240\240\240\240 mark smallest enclosing class
|
|
C-c #\240\240\240\240\240\240\240\240\240\240 comment out region of code
|
|
C-u C-c #\240\240\240\240\240\240 uncomment region of code
|
|
|
|
MOVING POINT
|
|
|
|
C-c C-p\240\240\240\240\240\240\240\240 move to statement preceding point
|
|
C-c C-n\240\240\240\240\240\240\240\240 move to statement following point
|
|
C-c C-u\240\240\240\240\240\240\240\240 move up to start of current block)WR(
|
|
M-C-a\240\240\240\240\240\240\240\240\240\240 move to start of def
|
|
C-u M-C-a\240\240\240\240\240\240 move to start of class
|
|
M-C-e\240\240\240\240\240\240\240\240\240\240 move to end of def
|
|
C-u M-C-e\240\240\240\240\240\240 move to end of class
|
|
|
|
EXECUTING PYTHON CODE
|
|
|
|
C-c C-c sends the entire buffer to the Python interpreter
|
|
C-c |\240\240 sends the current region
|
|
C-c !\240\240 starts a Python interpreter window; this will be used by
|
|
\240\240\240\240\240\240\240 subsequent C-c C-c or C-c | commands
|
|
|
|
VARIABLES
|
|
|
|
py-indent-offset\240\240\240\240\240\240\240 indentation increment
|
|
py-block-comment-prefix comment string used by py-comment-region
|
|
|
|
py-python-command\240\240\240\240\240\240 shell command to invoke Python interpreter
|
|
py-scroll-process-buffer\240\240\240\240\240\240\240 t means always scroll Python process buffer
|
|
py-temp-directory\240\240\240\240\240\240 directory used for temp files \201if needed\202
|
|
|
|
|
|
py-beep-if-tab-change\240\240 ring the bell if tab-width is changed)RP(
|
|
|
|
)2 1 1 HR()0 2 62 H()WB 91 Sn()WB 28 Sn()EA(The Python Debugger)EH(
|
|
|
|
) 1 129 PR()BD()-1 Bf add FZ(\201Not revised, possibly not up to date, see 1.5.2 Library Ref section 9.1; in 1.5.2, you may also use debugger integrated in IDLE\202)Ef()ES()RP(
|
|
|
|
)0 3 63 H(Accessing)WB 92 Sn()EH(
|
|
|
|
) 19 92 PR(import )BD(pdb)ES(\240\240\240\240\240 \201it's a module written in Python\202
|
|
|
|
\240\240\240\240\240\240\240 -- defines )BD(functions :)ES(\240\240\240\240\240\240\240\240\240\240 run\201statement[,globals[, locals]]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- execute statement string under debugger control, with optional
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 global & local environment.
|
|
\240\240\240\240\240\240\240\240\240\240 runeval\201expression[,globals[, locals]]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- same as run, but evaluate expression and return value.
|
|
\240\240\240\240\240\240\240\240\240\240 runcall\201function[, argument, ...]\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- run function object with given arg\201s\202
|
|
\240\240\240\240\240\240\240\240\240\240 pm\201\202\240\240\240\240\240\240\240\240 -- run postmortem on last exception \201like debugging a core file\202
|
|
\240\240\240\240\240\240\240\240\240\240 post_mortem\201t\202
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240\240 -- run postmortem on traceback object <t>
|
|
\240\240\240\240\240\240\240\240
|
|
\240\240\240\240\240\240\240 -- defines )BD(class Pdb :)ES(\240\240\240\240\240\240\240\240\240\240 use Pdb to create reusable debugger objects. Object
|
|
\240\240\240\240\240\240\240\240\240\240 preserves state \201i.e. break points\202 between calls.
|
|
|
|
\240
|
|
\240\240\240\240\240\240\240 runs until a breakpoint hit, exception, or end of program
|
|
\240\240\240\240\240\240\240 If exception, variable '__exception__' holds \201exception,value\202.)RP(
|
|
|
|
)0 3 64 H(Commands)WB 93 Sn()EH(
|
|
|
|
) 51 78 PR(h, help
|
|
\240\240\240\240\240\240\240 brief reminder of commands
|
|
b, break [<arg>]
|
|
\240\240\240\240\240\240\240 if <arg> numeric, break at line <arg> in current file
|
|
\240\240\240\240\240\240\240 if <arg> is function object, break on entry to fcn <arg>
|
|
\240\240\240\240\240\240\240 if no arg, list breakpoints
|
|
cl, clear [<arg>]
|
|
\240\240\240\240\240\240\240 if <arg> numeric, clear breakpoint at <arg> in current file
|
|
\240\240\240\240\240\240\240 if no arg, clear all breakpoints after confirmation
|
|
w, where
|
|
\240\240\240\240\240\240\240 print current call stack
|
|
u, up
|
|
\240\240\240\240\240\240\240 move up one stack frame \201to top-level caller\202
|
|
d, down
|
|
\240\240\240\240\240\240\240 move down one stack frame\240
|
|
s, step
|
|
\240\240\240\240\240\240\240 advance one line in the program, stepping into calls
|
|
n, next
|
|
\240\240\240\240\240\240\240 advance one line, stepping over calls
|
|
r, return
|
|
\240\240\240\240\240\240\240 continue execution until current function returns
|
|
\240\240\240\240\240\240\240 \201return value is saved in variable "__return__", which
|
|
\240\240\240\240\240\240\240 can be printed or manipulated from debugger\202
|
|
c, continue
|
|
\240\240\240\240\240\240\240 continue until next breakpoint
|
|
a, args
|
|
\240\240\240\240\240\240\240 print args to current function
|
|
rv, retval
|
|
\240\240\240\240\240\240\240 prints return value from last function that returned
|
|
p, print <arg>
|
|
\240\240\240\240\240\240\240 prints value of <arg> in current stack frame)WR(
|
|
l, list [<first> [, <last>]]
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240 List source code for the current file.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240 Without arguments, list 11 lines around the current line
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240 or continue the previous listing.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240 With one argument, list 11 lines starting at that line.
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240 With two arguments, list the given range;
|
|
\240\240\240\240\240\240\240\240\240\240\240\240\240\240 if the second argument is less than the first, it is a count.
|
|
whatis <arg>
|
|
\240\240\240\240\240\240\240 prints type of <arg>
|
|
!\240
|
|
\240\240\240\240\240\240\240 executes rest of line as a Python statement in the current stack frame
|
|
q quit
|
|
\240\240\240\240\240\240\240 immediately stop execution and leave debugger
|
|
|
|
<return>
|
|
\240\240\240\240\240\240\240 executes last command again
|
|
|
|
Any input debugger doesn't recognize as a command is assumed to be a
|
|
Python statement to execute in the current stack frame, the same way
|
|
the exclamation mark \201"!"\202 command does.)RP(
|
|
|
|
)0 3 65 H(Example)WB 94 Sn()EH(
|
|
|
|
) 30 61 PR(\2011394\202 python
|
|
Python 1.0.3 \201Sep 26 1994\202
|
|
Copyright 1991-1994 Stichting Mathematisch Centrum, Amsterdam
|
|
>>> import rm
|
|
>>> rm.run\201\202
|
|
Traceback \201innermost last\202:
|
|
\240\240\240\240\240\240\240\240 File "<stdin>", line 1
|
|
\240\240\240\240\240\240\240\240 File "./rm.py", line 7
|
|
\240\240\240\240\240\240\240\240\240\240 x = div\2013\202
|
|
\240\240\240\240\240\240\240\240 File "./rm.py", line 2
|
|
\240\240\240\240\240\240\240\240\240\240 return a / r
|
|
ZeroDivisionError: integer division or modulo
|
|
>>> import pdb
|
|
>>> pdb.pm\201\202
|
|
> ./rm.py\2012\202div: return a / r
|
|
\201Pdb\202 list
|
|
\240\240\240\240\240\240\240\240 1\240\240\240\240 def div\201a\202:
|
|
\240\240\240\240\240\240\240\240 2\240 ->\240\240\240\240 return a / r
|
|
\240\240\240\240\240\240\240\240 3\240\240
|
|
\240\240\240\240\240\240\240\240 4\240\240\240\240 def run\201\202:
|
|
\240\240\240\240\240\240\240\240 5\240\240\240\240\240\240\240\240 global r
|
|
\240\240\240\240\240\240\240\240 6\240\240\240\240\240\240\240\240 r = 0
|
|
\240\240\240\240\240\240\240\240 7\240\240\240\240\240\240\240\240 x = div\2013\202
|
|
\240\240\240\240\240\240\240\240 8\240\240\240\240\240\240\240\240 print x
|
|
[EOF]
|
|
\201Pdb\202 print r
|
|
0
|
|
\201Pdb\202 q
|
|
>>> pdb.runcall\201rm.run\202
|
|
etc.)RP(
|
|
|
|
)0 3 66 H(Quirks)WB 95 Sn()EH(
|
|
Breakpoints are stored as filename, line number tuples. If a module is
|
|
reloaded after editing, any remembered breakpoints are likely to be wrong.
|
|
)0 P(Always single-steps through top-most stack frame. That is, "c" acts
|
|
like "n".
|
|
)WB NL /BO 0 D TC /Ba f D Bs /AU f D /UR () D RC ZF
|
|
()0 1 -1 H(A Python Quick Reference)EH(
|
|
)0 2 -1 H(Table of Contents)EH()WB
|
|
ND 1 gt{Ts 3 mul Np 0()0 C()BD(A Python Quick Reference)ES()0 1 TN()EA()BN}if
|
|
1 NH le{29(1\240\240)1 C(Python 1.52 Quick Reference)29 1 TN()EA()BN}if
|
|
2 NH le{30(1.1\240\240)2 C(Contents)30 1 TN()EA()BN}if
|
|
2 NH le{31(1.2\240\240)2 C()WB 1 Sn(Invocation Options)31 1 TN()EA()BN}if
|
|
2 NH le{32(1.3\240\240)2 C()WB 2 Sn(ENVIRONMENT VARIABLES)32 1 TN()EA()BN}if
|
|
2 NH le{33(1.4\240\240)2 C()WB 3 Sn(Terms Used In This Document)33 1 TN()EA()BN}if
|
|
2 NH le{34(1.5\240\240)2 C()WB 4 Sn(Notable lexical entities)34 1 TN()EA()BN}if
|
|
3 NH le{35(1.5.1\240\240)3 C(Keywords)35 1 TN()EA()BN}if
|
|
3 NH le{36(1.5.2\240\240)3 C(Identifiers)36 1 TN()EA()BN}if
|
|
3 NH le{37(1.5.3\240\240)3 C(Operators)37 1 TN()EA()BN}if
|
|
3 NH le{38(1.5.4\240\240)3 C(Strings)38 1 TN()EA()BN}if
|
|
4 NH le{39(1.5.4.1\240\240)4 C(String Literal Escapes)39 1 TN()EA()BN}if
|
|
3 NH le{40(1.5.5\240\240)3 C(Numbers)40 1 TN()EA()BN}if
|
|
3 NH le{41(1.5.6\240\240)3 C(Sequences)41 1 TN()EA()BN}if
|
|
3 NH le{42(1.5.7\240\240)3 C(Dictionaries \201Mappings\202)42 1 TN()EA()BN}if
|
|
2 NH le{43(1.6\240\240)2 C()WB 5 Sn(Basic Types and Their Operations)43 1 TN()EA()BN}if
|
|
3 NH le{44(1.6.1\240\240)3 C(Comparisons \201defined between *any* types\202)44 1 TN()EA()BN}if
|
|
3 NH le{45(1.6.2\240\240)3 C(Boolean values and operators)45 1 TN()EA()BN}if
|
|
3 NH le{46(1.6.3\240\240)3 C(None)46 1 TN()EA()BN}if
|
|
3 NH le{47(1.6.4\240\240)3 C(Numeric types)47 1 TN()EA()BN}if
|
|
4 NH le{48(1.6.4.1\240\240)4 C(Floats, integers and long integers.)48 1 TN()EA()BN}if
|
|
4 NH le{49(1.6.4.2\240\240)4 C(Operators on all numeric types)49 1 TN()EA()BN}if
|
|
4 NH le{50(1.6.4.3\240\240)4 C(Bit operators on integers and long integers)50 1 TN()EA()BN}if
|
|
4 NH le{51(1.6.4.4\240\240)4 C(Complex Numbers)51 1 TN()EA()BN}if
|
|
4 NH le{52(1.6.4.5\240\240)4 C(Numeric exceptions)52 1 TN()EA()BN}if
|
|
3 NH le{53(1.6.5\240\240)3 C(Operations on all sequence types \201lists, tuples, strings\202)53 1 TN()EA()BN}if
|
|
3 NH le{54(1.6.6\240\240)3 C(Operations on mutable \201=modifiable\202 sequences \201lists\202)54 1 TN()EA()BN}if
|
|
3 NH le{55(1.6.7\240\240)3 C(Operations on mappings \201dictionaries\202)55 1 TN()EA()BN}if
|
|
3 NH le{56(1.6.8\240\240)3 C(Format operator for strings \201%\202)56 1 TN()EA()BN}if
|
|
4 NH le{57(1.6.8.1\240\240)4 C()3 FZ(Uses C )Ef(printf format codes :)57 1 TN()EA()BN}if
|
|
3 NH le{58(1.6.9\240\240)3 C()WB [16#00 16#00 16#00] Sc()3 FZ(File Objects)Ef()Ec()58 1 TN()EA()BN}if
|
|
4 NH le{59(1.6.9.1\240\240)4 C(Operators on file objects)59 1 TN()EA()BN}if
|
|
4 NH le{60(1.6.9.2\240\240)4 C(File Exceptions)60 1 TN()EA()BN}if
|
|
2 NH le{61(1.7\240\240)2 C()WB 6 Sn(Advanced Types)61 1 TN()EA()BN}if
|
|
2 NH le{62(1.8\240\240)2 C()WB 7 Sn(Statements)62 1 TN()EA()BN}if
|
|
3 NH le{63(1.8.1\240\240)3 C(Control Flow)63 1 TN()EA()BN}if
|
|
3 NH le{64(1.8.2\240\240)3 C(Exception Statements)64 1 TN()EA()BN}if
|
|
3 NH le{65(1.8.3\240\240)3 C(Name Space Statements)65 1 TN()EA()BN}if
|
|
3 NH le{66(1.8.4\240\240)3 C(Function Definition)66 1 TN()EA()BN}if
|
|
3 NH le{67(1.8.5\240\240)3 C(Class Definition)67 1 TN()EA()BN}if
|
|
4 NH le{68(1.8.5.1\240\240)4 C(Documentation Strings)68 1 TN()EA()BN}if
|
|
3 NH le{69(1.8.6\240\240)3 C(Others)69 1 TN()EA()BN}if
|
|
2 NH le{70(1.9\240\240)2 C()WB 8 Sn(Built-In Functions)70 1 TN()EA()BN}if
|
|
2 NH le{71(1.10\240\240)2 C()WB 9 Sn(Built-In Exceptions)71 1 TN()EA()BN}if
|
|
2 NH le{72(1.11\240\240)2 C()WB 10 Sn(Standard methods & operators redefinition
|
|
in classes)72 1 TN()EA()BN}if
|
|
3 NH le{73(1.11.1\240\240)3 C(Special methods for any class)73 1 TN()EA()BN}if
|
|
3 NH le{74(1.11.2\240\240)3 C(Operators)74 1 TN()EA()BN}if
|
|
2 NH le{75(1.12\240\240)2 C()WB 11 Sn(Special informative state attributes for some
|
|
types:)75 1 TN()EA()BN}if
|
|
2 NH le{76(1.13\240\240)2 C()WB 12 Sn(Important Modules)76 1 TN()EA()BN}if
|
|
2 NH le{77(1.14\240\240)2 C()WB 25 Sn(List of modules in base distribution)77 1 TN()EA()BN}if
|
|
3 NH le{78(1.14.1\240\240)3 C(Contents of Lib directory)BR()-1 Bf add FZ(\201Python 1.52 NT distribution, may be slightly different in
|
|
other distributions\202)Ef()78 1 TN()EA()BN}if
|
|
3 NH le{79(1.14.2\240\240)3 C(
|
|
)2 0.6 1 HR()79 1 TN()EA()BN}if
|
|
3 NH le{80(1.14.3\240\240)3 C()-1 Bf add FZ(\201following list not revised\202)BR()BR()Ef(* Built-ins *)80 1 TN()EA()BN}if
|
|
3 NH le{81(1.14.4\240\240)3 C(* Standard *)81 1 TN()EA()BN}if
|
|
3 NH le{82(1.14.5\240\240)3 C(* Unix/Posix *)82 1 TN()EA()BN}if
|
|
3 NH le{83(1.14.6\240\240)3 C(* Tk User-interface Toolkit *)83 1 TN()EA()BN}if
|
|
3 NH le{84(1.14.7\240\240)3 C(* Multimedia *)84 1 TN()EA()BN}if
|
|
3 NH le{85(1.14.8\240\240)3 C(* Cryptographic Extensions *)85 1 TN()EA()BN}if
|
|
3 NH le{86(1.14.9\240\240)3 C(* Stdwin * Standard Window System)86 1 TN()EA()BN}if
|
|
3 NH le{87(1.14.10\240\240)3 C(* SGI IRIX * \2014 & 5\202)87 1 TN()EA()BN}if
|
|
3 NH le{88(1.14.11\240\240)3 C(* Suns *)88 1 TN()EA()BN}if
|
|
2 NH le{89(1.15\240\240)2 C()WB 26 Sn(Workspace exploration and idiom hints)89 1 TN()EA()BN}if
|
|
2 NH le{90(1.16\240\240)2 C()WB 27 Sn(Python Mode for Emacs)90 1 TN()EA()BN}if
|
|
2 NH le{91(1.17\240\240)2 C()WB 28 Sn(The Python Debugger)91 1 TN()EA()BN}if
|
|
3 NH le{92(1.17.1\240\240)3 C(Accessing)92 1 TN()EA()BN}if
|
|
3 NH le{93(1.17.2\240\240)3 C(Commands)93 1 TN()EA()BN}if
|
|
3 NH le{94(1.17.3\240\240)3 C(Example)94 1 TN()EA()BN}if
|
|
3 NH le{95(1.17.4\240\240)3 C(Quirks)95 1 TN()EA()BN}if
|
|
|
|
/TE t D NP TU PM 0 eq and{/Pn () D showpage}if end restore
|