Thursday, November 15, 2012

s2x - [Python 3]

s2x - [Python 3]:
@@ -566,9 +566,9 @@
</code>

===== Python 3 =====

- Converting to **Python 3** can be achieved by ''2to3'' then convert all strings starting '' '\x ''.. to '' b'\x ''.. and '' 'TCSO' '' to '' b'TCSO' '' and change ''foutput=open(argvOutFile,'w')'' to ''foutput=open(argvOutFile,'wb')''. This is required as strings are now unicode by default, but s2x needs to work with bytes. (You shouldn't get conversion errors anymore but I've not tested converted files with flash)
+ Converting to **Python 3** can be achieved by ''2to3'' then convert all strings starting '' '\x ''.. to '' b'\x ''.. and '' 'TCSO' '' to '' b'TCSO' '' and change ''foutput=open(argvOutFile,'w')'' to ''foutput=open(argvOutFile,'wb')''. This is required as strings are now unicode by default, but s2x needs to work with bytes. A final change required is ''nArrLength=float(c.getAttribute('length'))'' to ''nArrLength=int(c.getAttribute('length'))'' as implicit conversions between float and int are not legal anymore either. (You shouldn't get conversion errors anymore but I've not tested converted files with flash)
The resulting code is as follows
<code>
import sys
from struct import *



DIGITAL JUICE

No comments:

Post a Comment

Thank's!