[Tutor] file read and write

2007-09-11 Thread le dahut
I noticed that it is possible to write this : """ file('/tmp/myfile', 'w').write('Hello world\n') contnt = file('/tmp/sourcefile').read() """ instead of : """ fh = file('/tmp/myfile', 'w') fh.write('Hello world\n') fh.close() fh = file('/tmp/sourcefile') contnt = fh.read() fh.close() """ is ther

[Tutor] socket and lost data

2006-01-27 Thread le dahut
Hi, I try to send some data across a network (between 400KB and 10MB) like this : def envoyer(conn, mysize): print mysize,' KB sent' data = '1'*1024 data_end = data[:-5]+'#' data = data*(mysize-1) begining = time.time() conn.send(data) conn.send(data_end)

[Tutor] distutils and record-rpm not recognized

2006-02-08 Thread le dahut
I've Python 2.4.1 installed and 'setup.py' doesn't recognize the '--record-rpm' option : "error: option --record-rpm not recognized" The patch including this feature is available since a long time so what's happening ? K. ___ Tutor maillist - Tutor