Re: computing with characters

2008-04-30 Thread SL
"Gabriel Genellina" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] En Wed, 30 Apr 2008 04:19:22 -0300, SL <[EMAIL PROTECTED]> escribió: And that's a very reasonable place to search; I think chr and ord are builtin functions (and not str methods) jus

Re: computing with characters

2008-04-30 Thread SL
"Arnaud Delobelle" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] "Gabriel Genellina" <[EMAIL PROTECTED]> writes: En Wed, 30 Apr 2008 04:19:22 -0300, SL <[EMAIL PROTECTED]> escribió: "Lutz Horn" <[EMAIL PROTECTED]> s

Re: computing with characters

2008-04-30 Thread SL
"Lutz Horn" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] Hi, 2008/4/30 Gary Herron <[EMAIL PROTECTED]>: SL wrote: > How can I compute with the integer values of characters in python? > Like 'a' + 1 equals 'b' etc You can ge

computing with characters

2008-04-29 Thread SL
How can I compute with the integer values of characters in python? Like 'a' + 1 equals 'b' etc -- http://mail.python.org/mailman/listinfo/python-list

Re: Python(2.5) reads an input file FASTER than pure C(Mingw)

2008-04-27 Thread SL
Have you tried this now? First try again with pure C code and compile with a C compiler, not with C++ code and C++ compiler. Then, tweak the code to use more buffering, to make it more similar to readline code, like this (not tested): #include #include char vs[1002000][100]; char buffer

Re: Python(2.5) reads an input file FASTER than pure C(Mingw)

2008-04-26 Thread SL
"SL" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] "n00m" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] using namespace std; char vs[1002000][99]; if (!fgets(vs[i],999,fp)) break; BTW why are you declaring the arra

Re: Python(2.5) reads an input file FASTER than pure C(Mingw)

2008-04-26 Thread SL
"n00m" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] import time t=time.time() f=open('D:\\some.txt','r') z=f.readlines() f.close() print len(z) print time.time()-t m=input() print z[m] #include #include #include #include using namespace std; char vs[1002000][99]; FILE *f

Re: file write question

2008-01-28 Thread Robb Lane (SL name)
H - I am not familiar with flush(), will look into it. But an interesting note: I repeatedly and often start long running processes (one running right now: on about it's 14th hour), writing to open files, with few problems (on Mac OS X). Although of course I can't look at the results until the file

file write question

2008-01-26 Thread Robb Lane (SL name)
I have written a script which: - opens a file - does what it needs to do, periodically writing to the file... for a few hours - then closes the file when it's done So my question is: Would it be better to 'open' and 'close' my file on each write cycle? e.g. def writeStuff(content): myFile = op