Re: integer to binary 0-padded

2011-06-15 Thread Daniel Rentz

Hi,

Am 15.06.2011 14:29, schrieb Olivier LEMAIRE:

Hi there, I've been looking for 2 days for a way to convert integer
to binary number 0-padded, nothing... I need to get numbers converted
with a defined number of bits. For example on 8 bits 2 = 0010


bin(2)[2:].zfill(8)


Regards
Daniel
--
http://mail.python.org/mailman/listinfo/python-list


Compiling Python 3.2 on Cygwin fails

2011-05-03 Thread Daniel Rentz

Hello,

I've downloaded the 3.2 source tarball from python.org and tried to 
compile Python from scratch in a Cygwin 1.7.7 environment. Configure 
works as expected. Make fails with the following message:


make: *** No rule to make target `libpython3.2m.dll.a', needed by 
`python.exe'.  Stop.


There is a suspicious line in Makefile.pre.in, line 509:

$(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)

Changing that line to

$(DLLLIBRARY) $(LDLIBRARY): $(LIBRARY_OBJS)

lets make finish, but gives a bunch of other errors and warnings, such as:



/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: 
cannot find -lpython3.2

collect2: ld returned 1 exit status

Python build finished, but the necessary bits to build these modules 
were not found:

_tkinter   nisossaudiodev
spwd
To find the necessary bits, look in setup.py in detect_modules() for the 
module's name.


Failed to build these modules:
_bisect_codecs_cn _codecs_hk
_codecs_iso2022_codecs_jp _codecs_kr
_codecs_tw _csv   _ctypes
_ctypes_test   _curses_curses_panel
_datetime  _elementtree   _gdbm
_hashlib   _heapq _json
_lsprof_multibytecodec_multiprocessing
_pickle_posixsubprocess   _random
_socket_sqlite3   _ssl
_struct_testcapi  array
atexit audioopbinascii
bz2cmath  crypt
fcntl  grpmath
mmap   parser pyexpat
readline   resource   select
syslog termiostime
unicodedatazlib



Is there something obvious I am missing here?


Regards
Daniel
--
http://mail.python.org/mailman/listinfo/python-list