runeks - What is the long hex string you used from? I was able to get your code working, but it still doesnt apply to the raw tx bitcoin protocol examples from my earlier posts.
The long hex strings are returned by the getmemorypool RPC call to bitcoind. They're basically the raw transactions in little endian byte order.
Looks like the format you've posted is in base64, so you need to call .decode('base64') on that string before you can pass it to the write() function:
from deserialize import *
from BCDataStream import *
test = BCDataStream()
base64 = "AQAAAAGw1WkFCJGRItGLQp7dPArGvrtfDlheEjX3mP27Z6Q78gAAAACLSDBFAiApxKNT7M4U+a/FWYEgBxWUNNZ9Q5FmES/BvJQ/vIS8bQIhAPEMzKmvQKcPo8BwWCLYh7APxgf2jdT3GnYc8zgGuG3RAUEEQk0WIYcg4L8t4IjnajF4EKhimP/O5aYjgPdS2zUAOucxYX2FjQkoDHudfjGUO0UiYVp8l4CLpMwgZdaw2/b4Iv////8Crfq6AAAAAAAZdqkUpDMOE0p53KNyECLVfDFEoH5zHLuIrOAiAgAAAAAAGXapFDvG92mooiCXrws61hW1ln4M/SzBiKwAAAAA"
test.write(base64.decode('base64'))
tx = parse_Transaction(test)
print tx
for txOut in tx['txOut']:
print decode_script(txOut['scriptPubKey'])
Output:
{'lockTime': 0, 'version': 1, 'txIn': [{'sequence': 4294967295, 'prevout_hash': '\xb0\xd5i\x05\x08\x91\x91"\xd1\x8bB\x9e\xdd<\n\xc6\xbe\xbb_\x0eX^\x125\xf7\x98\xfd\xbbg\xa4;\xf2', 'scriptSig': 'H0E\x02 )\xc4\xa3S\xec\xce\x14\xf9\xaf\xc5Y\x81 \x07\x15\x944\xd6}C\x91f\x11/\xc1\xbc\x94?\xbc\x84\xbcm\x02!\x00\xf1\x0c\xcc\xa9\xaf@\xa7\x0f\xa3\xc0pX"\xd8\x87\xb0\x0f\xc6\x07\xf6\x8d\xd4\xf7\x1av\x1c\xf38\x06\xb8m\xd1\x01A\x04BM\x16!\x87 \xe0\xbf-\xe0\x88\xe7j1x\x10\xa8b\x98\xff\xce\xe5\xa6#\x80\xf7R\xdb5\x00:\xe71a}\x85\x8d\t(\x0c{\x9d~1\x94;E"aZ|\x97\x80\x8b\xa4\xcc e\xd6\xb0\xdb\xf6\xf8"', 'prevout_n': 0}], 'txOut': [{'value': 12253869, 'scriptPubKey': 'v\xa9\x14\xa43\x0e\x13Jy\xdc\xa3r\x10"\xd5|1D\xa0~s\x1c\xbb\x88\xac'}, {'value': 140000, 'scriptPubKey': 'v\xa9\x14;\xc6\xf7i\xa8\xa2 \x97\xaf\x0b:\xd6\x15\xb5\x96~\x0c\xfd,\xc1\x88\xac'}]}
DUP HASH160 20:a433...1cbb EQUALVERIFY CHECKSIG
DUP HASH160 20:3bc6...2cc1 EQUALVERIFY CHECKSIG