I stumbled apon a paragraph in python-dev about "reducing the size of
Python" for an embedded device:
"""
In my experience, the biggest gain can be obtained by dropping the
rarely-used
CJK codecs (for Asian languages). That should sum up to almost 800K
(uncompressed), IIRC.
"""
So, my question is: on Windows. where are those CJK codecs? Are they by
any chance included in the 1.867.776 bytes of python24.dll ?
Best wishes,
Harald 3 1190
GHUM wrote:
I stumbled apon a paragraph in python-dev about "reducing the size of
Python" for an embedded device:
"""
In my experience, the biggest gain can be obtained by dropping the
rarely-used
CJK codecs (for Asian languages). That should sum up to almost 800K
(uncompressed), IIRC.
"""
So, my question is: on Windows. where are those CJK codecs? Are they by
any chance included in the 1.867.776 bytes of python24.dll ?
Best wishes,
Harald
If your installation directory is C:\Python25, then look in
C:\Python25\lib \encodings
Paul Watson wrote:
>So, my question is: on Windows. where are those CJK codecs? Are they by any chance included in the 1.867.776 bytes of python24.dll ?
If your installation directory is C:\Python25, then look in
C:\Python25\lib \encodings
that's only the glue code. the actual data sets are provided by a bunch
of built-in modules:
>>import sys sys.builtin_m odule_names
('__builtin__', '__main__', '_ast', '_bisect', '_codecs',
'_codecs_cn', '_codecs_hk', '_codecs_iso202 2', '_codecs_jp',
'_codecs_kr', '_codecs_tw', ...
</F>
Fredrik Lundh schrieb:
If your installation directory is C:\Python25, then look in
C:\Python25\lib \encodings
that's only the glue code. the actual data sets are provided by a bunch
of built-in modules:
>>import sys
>>sys.builtin_m odule_names
('__builtin__', '__main__', '_ast', '_bisect', '_codecs',
'_codecs_cn', '_codecs_hk', '_codecs_iso202 2', '_codecs_jp',
'_codecs_kr', '_codecs_tw', ...
So, it should be possible to do a custom build of python24.dll /
python25.dll without some of those codecs, resulting in a smaller
python24.dll ?
It will be some time untill my apps must support Chinese and
Japanese...
Harald This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Your Name |
last post by:
Hi,
I have been trying to generate codecs for my language in Python using
gencodec.py.
The problem is the codec created does not work.
Here is the process that I followed.
I created a directory inside /tools/scripts and
put in a text file containing the mapping.
Here is a sample from it.
0x63 0x0915 # acsii letter c
0x64 0x0916
|
by: Eric Brunel |
last post by:
Hi all,
I just found a problem in the xreadlines method/module when used with codecs.open: the codec specified in the open does not seem to be taken into account by xreadlines which also returns byte-strings instead of unicode strings.
For example, if a file foo.txt contains some text encoded in latin1:
>>> import codecs
>>> f =...
|
by: Ivan Van Laningham |
last post by:
Hi All--
As far as I can tell, after looking only at the documentation (and not
searching peps etc.), you cannot query the codecs to give you a list of
registered codecs, or a list of possible codecs it could retrieve for
you if you knew enough to ask for them by name.
Why not? It seems to me that if I want to try to read an unknown file...
|
by: Paul Watson |
last post by:
$ python
Python 2.4.1 (#1, May 16 2005, 15:19:29)
on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import codecs
>>> codecs.lookup('ascii')
(<built-in function ascii_encode>, <built-in function ascii_decode>,
<class encodings.ascii.StreamReader at 0xb7f1302c>, <class
encodings.ascii.StreamWriter at...
|
by: Mike Currie |
last post by:
I'm trying to write out files that have utf-8 characters 0x85 and 0x08 in
them. Every configuration I try I get a UnicodeError: ascii codec can't
decode byte 0x85 in position 255: oridinal not in range(128)
I've tried using the codecs.open('foo.txt', 'rU', 'utf-8', errors='strict')
and that doesn't work and I've also try wrapping the file...
| |
by: David Hughes |
last post by:
I used this function successfully with Python 2.4 to alter the encoding
of a set of database records from latin-1 to utf-8, but the same
program raises an exception using Python 2.5. This small example shows
the problem:
import codecs
fo = open('test.dat', 'w')
fo.write('G\xe2teaux')
fo.close()
|
by: smitty1e |
last post by:
The first print statement does what you'd expect.
The second print statement has rather a lot of rat in it.
The goal here is to write a function that will return the man page for
some command (mktemp used as a short example here) as text to client
code, where the groff markup will be chopped to extract all of the
command options. Those...
|
by: yrogirg |
last post by:
Actually, I need utf-8 to utf-8 encoding which would change the text
to another keyboard layout (e.g. from english to russian ghbdtn ->
ÐÒÉ×ÅÔ) and would not affect other symbols.
I`m totally new to python and to more or less advanced programming. I
couldn`t find the answer to the question anywhere.
I`ve tried create simple utf to utf...
|
by: George Sakkis |
last post by:
I'm trying to use codecs.open() and I see two issues when I pass
encoding='utf8':
1) Newlines are hardcoded to LINEFEED (ascii 10) instead of the
platform-specific byte(s).
import codecs
f = codecs.open('tmp.txt', 'w', encoding='utf8')
s = u'\u0391\u03b8\u03ae\u03bd\u03b1'
print >f, s
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |