davechild python

До загрузки: 30 сек.



Благодарим, что скачиваете у нас :)

Если, что - то:

  • Поделится ссылкой:
  • Документ найден в свободном доступе.
  • Загрузка документа - бесплатна.
  • Если нарушены ваши права, свяжитесь с нами.
Формат: pdf
Найдено: 28.08.2020
Добавлено: 30.09.2020
Размер: 0.04 Мб

Pyth on C heat S heet
by
Dave C hild ( D ave C hild )
v ia
ch eato gra phy.c o m /1 /c s/1 9/
P yth on s ys V aria b le s
arg v
Com mand lin e a rg s
built i
​n_m
​odu
​le _
​nam es
Lin ke d C m odule s
byte ord er
Nativ e b yte o rd er
ch eck_
​in t
​erv a l
Sig nal c h eck
fr e quency
exe c_ p
​re fix
Root d ir e cto ry
exe cu ta ble
Nam e o f e xe cu ta ble
exit fu nc
Exit fu nctio n n am e
m odule s
Loaded m odule s
path
Searc h p ath
pla tfo rm
Curre nt p la tfo rm
std in , s td out, s td err
File o bje cts fo r I/O
ve rs io
​n_in fo
Pyth on v e rs io n in fo
w in ve r
Vers io n n um ber
P yth on s ys.a rg v
sys.a r
​gv[0 ]
fo o.p y
sys.a r
​gv[1 ]
bar
sys.a r
​gv[2 ]
-c
sys.a r
​gv[3 ]
qux
sys.a r
​gv[4 ]
--h
sys.a rg v fo r th e c o m mand:
$ p yth on fo o.p y b ar - c q ux - -h
P yth on o s V aria b le s
alt s e p
Alt e rn
​ativ e s e p
cu rd ir
Curre nt d ir s tr in g
defp ath
Defa ult s e arc h p ath
devn ull
Path o f n ull d evic e
exts e p
Exte nsio n s e para to r
lin ese p
Lin e s e para to r
nam e
Nam e o f O S
pard ir
Pare nt d ir s tr in g
path se p
Patc h s e para to r
se p
Path s e para to r
R egis te re d O S n am es: "
​pos
​ix ", "
​nt" ,
" ​mac
​", "
​os2
​", "
​ce ", "
​ja v
​a", "
​ris
​co s
​" Pyth on C la ss S pecia l M eth ods
__new _
​_(c ls )
__lt _ _
​(s e lf , o th er)
__in it
​__(
​se lf , a rg s)
__le __
​(s e lf , o th er)
__del_
​_(s e lf )
__gt_ _
​(s e lf , o th er)
__re pr
​__(
​se lf )
__ge__
​(s e lf , o th er)
__str _
​_(s e lf )
__eq__
​(s e lf , o th er)
__cm p_
​_(s e lf , o th er)
__ne__
​(s e lf , o th er)
__in de
​x_ _
​(s e lf )
__nonz
​ero
​__(
​se lf )
__hash
​__(
​se lf )
__geta
​ttr
​__(
​se lf , n am e)
__geta
​ttr
​ib u
​te _
​_(s e lf , n am e)
__se ta
​ttr
​__(
​se lf , n am e, a ttr )
__dela
​ttr
​__(
​se lf , n am e)
__ca ll
​__(
​se lf , a rg s, k w arg s)
Pyth on L is t M eth ods
append
​(it e m )
pop(p o
​sit io n)
co unt(
​it e m )
re m ove
​(it e m )
exte nd
​(lis t)
re ve rs e ()
in dex(
​it e m )
so rt( )
in se rt
​(p o
​sit io n, it e m )
Pyth on S tr in g M eth ods
ca pit a
​liz e () *
ls tr ip ()
ce nte r
​(w id th )
partit
​io n
​(s e p)
co unt( s u b, s ta rt, e nd)
re pla c
​e(o ld , n ew )
deco de()
rfin d(s u b, s ta rt ,e nd)
enco de()
rin dex
​(s u b, s ta rt, e nd)
endsw i
​th (s u b)
rju st(
​wid th )
exp and
​ta bs()
rp arti
​tio
​n(s e p)
fin d(s u b, s ta rt, e nd)
rs p lit
​(s e p)
in dex(s u b, s ta rt, e nd)
rs tr ip ()
is a ln um () *
sp lit ( s e p)
is a lp ha() *
sp lit l
​in es()
is d ig it ( ) *
sta rts
​wit
​h(s u b)
is lo w er() *
str ip ()
is sp ace () *
sw apca se () *
Pyth on S tr in g M eth ods ( c o nt)
is tit le () *
tit le () *
is u pper() *
tr a nsl
​ate
​(ta ble )
jo in ()
upper() *
lju st(
​wid th )
zfill(
​wid th )
lo w er() *
Meth ods m ark e d * a re lo ca le d ependant fo r 8 -
bit s tr in gs.
Pyth on F ile M eth ods
clo se ()
re adli
​nes
​(s iz e )
flu sh ()
se ek(o
​ffs e t)
file no()
te ll( )
is a tty ()
tr u nca
​te (
​siz e )
next( )
writ e (
​str in g)
re ad(s iz e )
writ e l
​in e
​s(lis t)
re adli
​ne(
​siz e )
Pyth on In dexes a n d S lic es
le n(a )
6
a[0 ]
0
a[5 ]
5
a[- 1 ]
5
a[- 2 ]
4
a[1 :]
[1 ,2 ,3
​,4 ,5 ]
a[:5 ]
[0 ,1 ,2
​,3 ,4 ]
a[:- 2 ]
[0 ,1 ,2 ,3 ]
a[1 :3 ]
[1 ,2 ]
a[1 :- 1 ]
[1 ,2 ,3 ,4 ]
b= a[:]
Shallo w c o py o f a
In dexe s a nd S lic e s o f a = [0 ,1
​,2 ,
​3,4 ,5 ]
Pyth on D ate tim e M eth ods
to day()
fr o m or
​din
​al(
​ord
​in al)
now (ti
​mez
​one
​in fo )
co m bin
​e(d ate , tim e)
utc n ow ()
str p ti
​me(
​date , fo rm at)
fr o m ti
​mes
​ta m
​p(t
​im e
​sta m p)
utc fr o
​mti
​mes
​ta m
​p(t
​im e
​sta m p)
By
Dave C hild
( D ave C hild )
ch eato gra phy.c o m /d ave ch ild /
www.g etp ostc o okie .c o m
Publis h ed 1 9th O cto ber, 2 011.
Last u pdate d 1 2th M ay, 2 016.
Page 1 o f 2 .
Sponso re d b y
Apollo P ad .c o m
Eve ry o ne h as a n ove l in th em . F in is h Y ours !
http s://a pollo pad.c o m

Pyth on C heat S heet
by
Dave C hild ( D ave C hild )
v ia
ch eato gra phy.c o m /1 /c s/1 9/
P yth on T im e M eth ods
re pla ce ()
utc o ff
​se t( )
is o fo r
​mat( )
dst( )
__str _ _()
tz n am e()
str fti
​me(
​fo rm at)
P yth on D ate F orm attin g
% a
Abbre v
​ia te d w eekd ay ( S un)
% A
Weekd ay ( S unday)
% b
Abbre v
​ia te d m onth n am e ( J a n)
% B
Month n am e ( J a nuary )
% c
Date a nd tim e
% d
Day ( le adin g z e ro s) ( 0 1 to 3 1)
% H
24 h our ( le adin g z e ro s) ( 0 0 to 2 3)
% I
12 h our ( le adin g z e ro s) ( 0 1 to 1 2)
% j
Day o f y e ar ( 0 01 to 3 66)
% m
Month ( 0 1 to 1 2)
% M
Min ute ( 0 0 to 5 9)
% p
AM o r P M
% S
Seco nd ( 0 0 to 6 1
⁴ )
% U
Week n um ber¹ ( 0 0 to 5 3)
% w
Weekd ay² ( 0 to 6 )
% W
Week n um ber³ ( 0 0 to 5 3)
% x
Date
% X
Tim e
% y
Year w it h out c e ntu ry ( 0 0 to 9 9)
% Y
Year ( 2 008)
% Z
Tim e z o ne ( G M T)
% %
A lit e ra l "
​%" c h ara cte r ( % )
¹ S unday a s s ta rt o f w eek. A ll d ays in a n ew y e ar p re ce din g th e
fir s t S unday a re c o nsid ere d to b e in w eek 0 .
² 0 is S unday, 6 is S atu rd ay.
³ M onday a s s ta rt o f w eek. A ll d ays in a n ew y e ar p re ce din g th e
fir s t M onday a re c o nsid ere d to b e in w eek 0 .
⁴ T his is n ot a m is ta ke . R ange ta ke s a cco unt o f le ap a nd d ouble
​-
le ap s e co nds.

By
Dave C hild
( D ave C hild )
ch eato gra phy.c o m /d ave ch ild /
www.g etp ostc o okie .c o m
Publis h ed 1 9th O cto ber, 2 011.
Last u pdate d 1 2th M ay, 2 016.
Page 2 o f 2 .
Sponso re d b y
Apollo P ad .c o m
Eve ry o ne h as a n ove l in th em . F in is h Y ours !
http s://a pollo pad.c o m

Сообщить о нарушении / Abuse

Все документы на сайте взяты из открытых источников, которые размещаются пользователями. Приносим свои глубочайшие извинения, если Ваш документ был опубликован без Вашего на то согласия.