file write IOError Invalid argument

2009-07-16 Thread Robert Robert
Hello All,
I am trying to write a binary string to file on a windows network share. I get 
an IOError. I've read that it is because the file size is too large. I did a 
type( binaryString) and saw that it was type "str". So I loop through it one by 
one element and use f.write to write to file, and it worked without any error. 
However it took a long while to write to file. I was wondering how I could 
split this binary string into N number of chunks efficiently and write them to 
file. 
thanks,

rh 




  -- 
http://mail.python.org/mailman/listinfo/python-list


fil open close very slow

2009-08-01 Thread Robert Robert
hiya all,
I have a "large" script written in python. There is in that big script at a 
certain point a loop in which I create a lots of simple small text files. Each 
text file just contain I think 4 or 5 short lines. When I simply run it in 
IDLE, it runs fast. But when I compile it to binary files, it becomes very 
slow. I turned on the profiler and discorvered it was slow at the open() and 
close() calls. I removed those calls to confirm this, and yes my program runs 
very fast then. Does anyone has an idea or suggestion why this can be possible. 
I only compile them to .pyc files, which as what I see, when I normally run in 
IDLe these files are created as well, so I really got no clue.
rh.


  -- 
http://mail.python.org/mailman/listinfo/python-list