scons Buffer.cpp

2008-03-13 Thread brnstrmrs
I am trying to install some libs but can not get them build properly.
It seems to be looking for Buffer.cpp but can't find it any where .
Here is the error message:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o AssociationRejection.o -c -I/usr/lib -I/usr/lib/boost
AssociationRejection.cpp
g++ -o Buffer.o -c -I/usr/lib -I/usr/lib/boost Buffer.cpp
In file included from Buffer.cpp:1:
Buffer.hpp:9:27: error: socket/Base.hpp: No such file or directory
Buffer.hpp:10:35: error: socket/SwitchEndian.hpp: No such file or
directory
Buffer.hpp: In member function 'dicom::Buffer&
dicom::Buffer::operator<<(T)':
Buffer.hpp:84: error: 'is_fundamental' is not a member of 'boost'
Buffer.hpp:84: error: '::value' has not been declared
Buffer.hpp:90: error: template argument 1 is invalid
Buffer.hpp:95: error: template argument 1 is invalid
Buffer.hpp:96: error: expected unqualified-id before '}' token
Buffer.hpp: In member function 'dicom::Buffer&
dicom::Buffer::operator>>(T&)':
Buffer.hpp:103: error: 'is_const' is not a member of 'boost'
Buffer.hpp:103: error: '::value' has not been declared
Buffer.hpp:104: error: template argument 1 is invalid
Buffer.hpp:105: error: template argument 1 is invalid
Buffer.hpp:105: error: invalid type in declaration before ';' token
Buffer.hpp:105: error: declaration of 'typedef int& data' shadows a
parameter
Buffer.hpp:109: error: 'pdata' was not declared in this scope
Buffer.hpp:117: error: expected unqualified-id before '=' token
Buffer.cpp: In member function 'dicom::Buffer&
dicom::Buffer::operator>>(std::vector >&)':
Buffer.cpp:38: error: 'SwitchVectorEndian' was not declared in this
scope
Buffer.cpp: In member function 'void dicom::Buffer::AddVector(const
std::vector
>&)':
Buffer.cpp:112: error: 'SwitchVectorEndian' was not declared in this
scope
Buffer.hpp: In member function 'dicom::Buffer&
dicom::Buffer::operator>>(T&) [with T = char]':
Buffer.cpp:51:   instantiated from here
Buffer.hpp:105: error: declaration of 'typedef int& data' shadows a
parameter
Buffer.hpp: In member function 'dicom::Buffer&
dicom::Buffer::operator>>(T&) [with T = UINT16]':
Buffer.cpp:59:   instantiated from here
Buffer.hpp:105: error: declaration of 'typedef int& data' shadows a
parameter
scons: *** [Buffer.o] Error 1
scons: building terminated because of errors.
-- 
http://mail.python.org/mailman/listinfo/python-list


struct unpack

2008-03-17 Thread brnstrmrs
If I run:

testValue = '\x02\x00'
junk = struct.unpack('h', testValue)

Everything works but If I run

testValue = raw_input("Enter Binary Code..:")  inputting at the
console '\x02\x00'
junk = struct.unpack('h', testValue)

It errors out with
Traceback (most recent call last):
  File "/home/nirmal/eDoseCheck/yennes1.py", line 9, in 
junk = struct.unpack('h', testValue)
  File "struct.py", line 87, in unpack
return o.unpack(s)
error: unpack requires a string argument of length 2

any ideas?
-- 
http://mail.python.org/mailman/listinfo/python-list


csv dictreader

2008-03-19 Thread brnstrmrs
I am trying to use the dictionary reader to import the data from a csv
file and create a dictnary from it but just can't seem to figure it
out.

Here is my code:
>>>import csv
>>>reader = csv.DictReader(open('table.csv'))
>>>for row in reader:
>>>print row

my csv files looks like this:

Bytecode,Element
\x00\x00,
\x01\x00,0001

\x09\x00,0009

My output shows:
{'Bytecode': '\\x00\\x00', 'Element': ''}
{'Bytecode': '\\x01\\x00', 'Element': '0001'}
...
{'Bytecode': '\\x09\\x00', 'Element': '0009'}

1. how can I get access to this directory
2. why does the values come with two backslashs infront of the "x"
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: csv dictreader

2008-03-19 Thread brnstrmrs
On Mar 19, 2:32 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote:
> On Mar 19, 1:06 pm, brnstrmrs <[EMAIL PROTECTED]> wrote:
>
>
>
> > I am trying to use the dictionary reader to import the data from a csv
> > file and create a dictnary from it but just can't seem to figure it
> > out.
>
> > Here is my code:
>
> > >>>import csv
> > >>>reader = csv.DictReader(open('table.csv'))
> > >>>for row in reader:
> > >>>print row
>
> > my csv files looks like this:
>
> > Bytecode,Element
> > \x00\x00,
> > \x01\x00,0001
> > 
> > \x09\x00,0009
>
> > My output shows:
> > {'Bytecode': '\\x00\\x00', 'Element': ''}
> > {'Bytecode': '\\x01\\x00', 'Element': '0001'}
> > ...
> > {'Bytecode': '\\x09\\x00', 'Element': '0009'}
>
> > 1. how can I get access to this directory
>
> What do you mean? You can get each element in the dict by doing this:
>
> for row in reader:
> print row['Bytecode']
> print row['Element']
>
> > 2. why does the values come with two backslashs infront of the "x"
>
> The double back slash is for escaping purposes, I think. If you print
> this: '\\x09\\x00'
> you'll get this:  \x09\x00
>
> Mike

Thanks.  It works for the Bytecode but when I do print row['Element']
I get a error messageprint row['Element'] KeyError: 'Element'
-- 
http://mail.python.org/mailman/listinfo/python-list