|
: , , ? . , , " ". , , , .
.
.
, .
.
?
, . .
?
, . , , . , . txzqJv 2!dasd0a QqdKjvz ( ). "" , .
, , .
?
! , . Mozilla Firefox . Python2 chardet. chardet Python 2 Python 3.
chardet
, ! . chardet , chardet.feedparser.org.
universaldetector.py, UniversalDetector. ( detect chardet/__init__.py, UniversalDetector, , )
|
|
UniversalDetector:
- UTF-N (). UTF-8, - - UTF-16, 4 UTF-32 .
- , 7- ASCII, ASCII . : ISO-2022-JP() HZ-GB-2312()
- , . : BIG5(), SHIFT_JIS(), TIS-620()
- , . : KOI8-R(), WINDOWS-1266(), TIS-620()
- WINDOWS-1252, Microsoft Windows .
UTF-N
, UTF-8, UTF-16, UTF-32. ( ; .) UniversalDetector, - .
, UniversalDetector EscCharSetProber( escprober.py) .
EscCharSetProber , HZ-GB-2312, ISO-2022-CN, ISO-2022-JP, ISO-2022-KR ( escsm.py). EscCharSetProber , . , EscCharSetProber UniversalDetector, , , . , .
, UniversalDetector . , , , windows-1252.
, MBCSGroupProber( mbcsgroupprober.py), , : Big5, GB2312, EUC-TW, EUC-KR, EUC-JP, SHIFT_JIS, UTF-8. MBCSGroupProber . , ( UniversalDetector.feed() ). , MBCSGroupProber UniversalDetector, .
MultiByteCharSetProber( mbcharsetprober.py) MultiByteCharSetProber. MultiByteCharSetProber , . , MultiByteCharSetProber .
|
|
( chardistrubution.py) . MultiByteCharSetProber , , , . , MultiByteCharSetProber MBCSGroupProber, UniversalDetector, .
. EUC-JP SHIFT_JIS, SJISProber( sjisprober.py) . SJISContextAnalysis EUCJPContextAnalysis ( jpcntx.py JapaneseContextAnalysis) . , SJISProber, MBCSGroupProber.
, ?
, SBCSGroupProber( sbcsgroupprober.py), , : windows-1251, KOI8-R, ISO-8859-5, MacCyrillic, IBM855, IBM866 (); ISO-8859-7 windows-1253 (); ISO-8859-5 windows-1251 (); ISO-8859-2 windows-1250 (); TIS-620 (); windows-1255 ISO-8859-8 ().
SBCSGroupProber . , SingleByteCharSetProber ( sbcharsetprober.py), . . SingleByteCharSetProber . , , , .
. , HebrewProber( hebrewprober.py) ( , ) ( ). , , (windows-1255 ISO-8859-8 )
Windows-1252
UniversalDetector , , Latin1Prober( latin1prober.py) windows-1252. , . windows-1252 , , . . Latin1Prober , , .
|
|
Python 3 2to3
. , , , . .
: __init__(). . .
- __init__() . __new__().
- __repr__() .
- __str__() print(x).
- Python3, bytes.
- , format_spec Format Specification Mini-Language decimal.py Python __format__().
, .
__iter__() __next__().
- __iter__() . .
- __next__() .
- __reversed__() . , .
, for . :
for x in seq:
print(x)
Python 3 seq.__iter__() , __next__() .
__next__()
, .
:
- Ariel Ortiz
- Ariel Ortiz
- Python: David Mertz
- Python
:
- The Python propertybuiltin Adam Gomaa
- Getters/Setters/Fuxors Ryan Tomayko
- property() Python
:
- How-To Raymond Hettinger
- Python: Python, 2 David Mertz
- Python Mark Summerfield
- Python
& :
- threading
- threading
- multiprocessing
- multiprocessing
- Python Global Interpreter Lock Jesse Noller
- Python GIL () David Beazley
:
- Python David Mertz and Michele Simionato
- Python, 2 David Mertz and Michele Simionato
- Python, 3 David Mertz and Michele Simionato
Doug Hellman Python , Python.