A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-February/012720.html below:

[I18n-sig] Re: [Python-Dev] Pre-PEP: Python Character Model

[I18n-sig] Re: [Python-Dev] Pre-PEP: Python Character Model [I18n-sig] Re: [Python-Dev] Pre-PEP: Python Character ModelFredrik Lundh fredrik@pythonware.com
Wed, 7 Feb 2001 11:00:03 +0100
martin wrote:    
> To take a specific example: What would you change about imp and
> py_compile.py? What is the type of imp.get_magic()? If character
> string, what about this fragment?
> 
> import imp
> MAGIC = imp.get_magic()
> 
> def wr_long(f, x):
>     """Internal; write a 32-bit int to a file in little-endian order."""
>     f.write(chr( x        & 0xff))
>     f.write(chr((x >> 8)  & 0xff))
>     f.write(chr((x >> 16) & 0xff))
>     f.write(chr((x >> 24) & 0xff))
> ...
>     fc = open(cfile, 'wb')
>     fc.write('\0\0\0\0')
>     wr_long(fc, timestamp)
>     fc.write(MAGIC)
> 
> Would that continue to write the same file that the current version
> writes?

yes (file opened in binary mode, no encoding, no code points above 255)

Cheers /F




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4