KermMartian wrote:
That's weird. Swivel, do you happen to know what version of Python you're using? Could you give me hello.bin so I can see what's causing that symptom?
*bump* Swivel, any thoughts on this? Should I poke you on IRC, because chances are you won't notice this topic unaided? Wink
send him a text message Wink
elfprince13 wrote:
send him a text message Wink
Consider it done; waiting on a response from good ol' Swivelgames. Very Happy
Ok, Kerm, I am running Pythin 2.7 and have gotten the same error as swivel.
qazz42 wrote:
Ok, Kerm, I am running Pythin 2.7 and have gotten the same error as swivel.
Swivel and Qazz, the problem seems to be that Python 2.x does not support ByteArray the way that 3.x does. Please upgrade your Python to the latest version (which happens to be 3.1.1 at the momennt).
Kerm, no it is 3.1.2 Razz
qazz42 wrote:
Kerm, no it is 3.1.2 Razz
Ah, then they failed to update some of the text on their website. Either way, 3.x is your ticket to fixing these ByteArray problems.
I didn't want to switch over to Python 3.x just to use this, and so I took a look at why this doesn't work in 2.x.

There are two compatibility issues, it seems: one, 2.x doesn't like having floats as part of a bytearray. This is really easy to fix. Whenever there is a line like the one below that gives that error message, just call the int() function on the two arguments to convert them to integers.


Code:
   bincontents = bytearray([bbsize_lb,bbsize_hb]) + bincontents


Then, 2.x's bytes() function only takes one argument, so you have to get rid of the second argument whenever this code appears:


Code:
      fho.write(bytearray(bytes(oncalcname, encoding='ascii')))


Maybe you should release a special version for people who haven't updated to 3.x?
KermMartian wrote:
elfprince13 wrote:
send him a text message Wink
Consider it done; waiting on a response from good ol' Swivelgames. Very Happy
Got your text message the other night. Sorry I didn't respond. I got on not long after, though, and meant to talk to you about this Smile

And yeah, I believe it was because I was using Python 2.x -- I'll download Python 3.1.2 in a moment and let you know how it fits! Smile
Great, that would be much appreciated. Smile TC01, I'll certainly give your ideas a try, and if they work, rerelease v1.2 with the fixes.
KermMartian wrote:
Great, that would be much appreciated. Smile TC01, I'll certainly give your ideas a try, and if they work, rerelease v1.2 with the fixes.


There might be an issue with the second point. If 3.x syntax demands the second argument to bytes(), then it will cause problems on 3.x installs.

If that's the case, you could check the Python version- it's defined in sys.version- and depending on what version either run the 3.x version of the command or the 2.x version.
This was extremely helpful. Thanks, Kerm. ;D
oktal wrote:
This was extremely helpful. Thanks, Kerm. ;D
I'm glad to hear it; what are you using BinPac8x for? If you're an ASM coder, I hope that you're making use of the Doors CS SDK. Smile Also, you should Introduce Yourself when you get a chance.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement