hi,
>>> bin(0xff0)
''
>>> bin(0xff1)
'0001'
>>> a=bin(0xff0)+bin(0xff1)
>>> a
'0001'
>>> b=0xff0
>>> c=0xff1
>>> d=b+c
>>> d
8161
>>> bin(d)
'1'
question:
1) why is it that a and d values are different? i'm using Python 2.5.
2) how to conv
On 22/02/11 13:46, tee chwee liong wrote:
hi,
>>> bin(0xff0)
''
>>> bin(0xff1)
'0001'
>>> a=bin(0xff0)+bin(0xff1)
>>> a
'0001'
>>> b=0xff0
>>> c=0xff1
>>> d=b+c
>>> d
8161
>>> bin(d)
'1'
question:
1) why is it that a and d values are different
On 2/22/2011 8:46 AM, tee chwee liong wrote:
hi,
>>> bin(0xff0)
''
>>> bin(0xff1)
'0001'
>>> a=bin(0xff0)+bin(0xff1)
>>> a
'0001'
>>> b=0xff0
>>> c=0xff1
>>> d=b+c
>>> d
8161
>>> bin(d)
'1'
question:
1) why is it that a and d values are differ
On 22/02/2011 14.46, tee chwee liong wrote:
hi,
>>> bin(0xff0)
''
>>> bin(0xff1)
'0001'
>>> a=bin(0xff0)+bin(0xff1)
>>> a
'0001'
>>> b=0xff0
>>> c=0xff1
>>> d=b+c
>>> d
8161
>>> bin(d)
'1'
question:
1) why is it that a and d values ar
hi,
i dont know why when i re-run bin(0xff0) today at IDLE Python 2.5, it gives me
traceback error.
>>> bin(0xff0)
Traceback (most recent call last):
File "", line 1, in
bin(0xff0)
NameError: name 'bin' is not defined
i guess Python 2.5 doesn't support binary conversion of hex. con
hi Francesco,
couldnt get hex of bin working on IDLE Python 2.5 when i type:
>>> hex(0b1001001001001001001)
SyntaxError: invalid syntax
>>> bin(0x49249)
Traceback (most recent call last):
File "", line 1, in
bin(0x49249)
NameError: name 'bin' is not defined
pls advise.
thanks
tcl
On 01/-10/-28163 02:59 PM, tee chwee liong wrote:
hi Francesco,
couldnt get hex of bin working on IDLE Python 2.5 when i type:
hex(0b1001001001001001001)
SyntaxError: invalid syntax
bin(0x49249)
Traceback (most recent call last):
File "", line 1, in
bin(0x49249)
NameError: name 'bi
-- next part --
An HTML attachment was scrubbed...
URL:<http://mail.python.org/pipermail/tutor/attachments/20110222/334e5091/attachment-0001.html>
--
Message: 2
Date: Tue, 22 Feb 2011 14:07:52 +
From: Adam Bark
To: tee chwee liong
Cc
Dear All
I have a large text file with more than 50k lines and about 784 floats in
each line.
How can I read the whole file as a single numpy array?
Also, is it possible to save a session (like in MATLAB) and reload it later?
thanks
___
Tutor maillist