Re: Hexadecimal Conversion in Python

2005-11-02 Thread DaBeef
I have been coding for 5 years. This is a proprietary protocol, so it is difficult converting. I did this in java but was just able to convert a stream. I looked through the Python library, I am more or less getting backa string represented as a "" So now I want to convert it to all the h

Re: Hexadecimal Conversion in Python

2005-11-02 Thread DaBeef
it is returning data such as 0x04. I am new to python so this is a pain for me, learning to do this in a language whose llibrary is somewhat limited. But instead I receieve So I wnat to convert to the original data. Also can you define a constant in Python such as #define value 0x04 Thank-y

Hexadecimal Conversion in Python

2005-11-02 Thread DaBeef
Hello, I am reading in a socket message from a server and am only receiving this ''. Now obviously it is in the wrong format. How would I convert these bys in Python, I have looked everywhere but I do not see much documentation on converting ptyhon types to other data types. Any Help would be

Converting ip addr, port to unsigned Network Byte Order

2005-11-02 Thread DaBeef
I have an IP adress and a port # and I needed them in Network Byte Order. Socket.connect (( ipAddr , portNumber) - how would you do this with python, I am unsure of exactly how python data is stored. I know the bits must be equal to an unsigend int. HOw would you do this in Python?? Thanks for y

Instantiating Classes in python (newbie)

2005-10-31 Thread DaBeef
Hello, I am learning python for work from knowing java,c#,c. I had a couple questions. 1) IntegerClass - to instantiate this class how come I use i = IntegerClass.IntegerClass() and then this works while i = IntegerClass() i.method. I receive an error. 2) Also using self in the method (self, d