15.04.2013 Views

Core Python Programming (2nd Edition)

Core Python Programming (2nd Edition)

Core Python Programming (2nd Edition)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

file.truncate(size=file.tell()) Truncates file to at most size bytes, the default being the current<br />

file location<br />

file.write(str) Writes string str to file<br />

file.writelines(seq) Writes seq of strings to file; seq should be an iterable producing<br />

strings; prior to 2.2, it was just a list of strings<br />

[a] New in <strong>Python</strong> 2.2.<br />

[b] New in <strong>Python</strong> 1.5.2 but unsupported.<br />

[c] New in <strong>Python</strong> 2.1 but deprecated in <strong>Python</strong> 2.3.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!