Message5041
This program writes an array.array to a file.
import array
import sys
a = array.array('c', 'thebishop\n')
f = open('/tmp/out.txt', 'wb')
f.write(a)
f.close()
This works using CPython 2.5.4. Jython 2.5.0 results in
Traceback (most recent call last):
File "writearray.py", line 7, in <module>
f.write(a)
TypeError: write requires a string as its argument |
|
Date |
User |
Action |
Args |
2009-08-16 10:02:03 | pjdm | set | recipients:
+ pjdm |
2009-08-16 10:02:03 | pjdm | set | messageid: <1250416923.21.0.442051584005.issue1439@psf.upfronthosting.co.za> |
2009-08-16 10:02:03 | pjdm | link | issue1439 messages |
2009-08-16 10:02:02 | pjdm | create | |
|