Re: file processing question

2011-10-12 Thread Yaşar Arabacı
And also, I higly recommend against using lists named list. That means overwriting builtin list object. 2011/10/12 Andreas Perstinger > On 2011-10-12 13:15, selahattin ay wrote: > >> >> hi all, I wrote these codes but the program must write the prints to a >> text file... >> code = [100, 200, 3

Re: file processing question

2011-10-12 Thread Andreas Perstinger
On 2011-10-12 13:15, selahattin ay wrote: hi all, I wrote these codes but the program must write the prints to a text file... code = [100, 200, 300, 400, 500] list= [] a = 0 while a< 9: a+=1 list.append(a) last_list = [[int(str(i) + str(k)) for i in code] for k in list] list2= []

file processing question

2011-10-12 Thread selahattin ay
hi all, I wrote these codes but the program must write the prints to a text file... code = [100, 200, 300, 400, 500] list= [] a = 0 while a < 9: a+=1 list.append(a) last_list = [[int(str(i) + str(k)) for i in code] for k in list] list2= [] b = 0 while b < 9: b+=1 list2.appen

Re: Elisp Lesson on file processing (make downloadable copy of a website)

2008-07-10 Thread [EMAIL PROTECTED]
Xah Lee wrote: « ... emacs program and tutorial that does archiving a website for offline reading. (See http://xahlee.org/emacs/make_download_copy.html ) » Sashi wrote: «Why not use wget or curl?» The Emacs lisp program makes a archive of parts of website you own, so that readers of your website

Re: Elisp Lesson on file processing (make downloadable copy of a website)

2008-07-10 Thread Sashi
On Jul 6, 4:05 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > In this week i wrote a emacs program and tutorial that does archiving > a website for offline reading. > (Seehttp://xahlee.org/emacs/make_download_copy.html) Why not use wget or curl? -- http://mail.python.org/mailman/listinfo/pyt

Re: Elisp Lesson on file processing (make downloadable copy of a website)

2008-07-06 Thread [EMAIL PROTECTED]
In this week i wrote a emacs program and tutorial that does archiving a website for offline reading. (See http://xahlee.org/emacs/make_download_copy.html ) In the process, i ran into a problem with the unix “cp” utility. I've been a unix admin for Solaris during 1998-2004. Even the first time i l

Re: parallel csv-file processing

2007-11-09 Thread Paul Boddie
On 9 Nov, 12:02, Paul Rubin wrote: > > Why not pass the disk offsets to the job server (untested): > >n = 1000 >for i,_ in enumerate(reader): > if i % n == 0: >job_server.submit(calc_scores, reader.tell(), n) > > the remote process seeks to the approp

Re: parallel csv-file processing

2007-11-09 Thread Marc 'BlackJack' Rintsch
On Fri, 09 Nov 2007 02:51:10 -0800, Michel Albert wrote: > Obviously this won't work as you cannot access a slice of a csv-file. > Would it be possible to subclass the csv.reader class in a way that > you can somewhat efficiently access a slice? An arbitrary slice? I guess not as all records bef

Re: parallel csv-file processing

2007-11-09 Thread Paul Rubin
Michel Albert <[EMAIL PROTECTED]> writes: > buffer = [] > for line in reader: >buffer.append(line) >if len(buffer) == 1000: > f = job_server.submit(calc_scores, buffer) > buffer = [] > > f = job_server.submit(calc_scores, buffer) > buffer = [] > > but would this not kill my me

parallel csv-file processing

2007-11-09 Thread Michel Albert
Currently I am faced with a large computation tasks, which works on a huge CSV file. As a test I am working on a very small subset which already contains 2E6 records. The task itself allows the file to be split however as each computation only involves one line. The application performing the compu

Re: How can I use python for file processing

2007-08-26 Thread Ricardo Aráoz
Marc 'BlackJack' Rintsch wrote: > On Sun, 26 Aug 2007 06:05:11 +, [EMAIL PROTECTED] wrote: > >> I am trying to use python for file processing. >> Suppose I have a file like this: >> I want to build a Hashmap between the line "begin_QOS_statistics"

Re: How can I use python for file processing

2007-08-25 Thread Marc 'BlackJack' Rintsch
On Sun, 26 Aug 2007 06:05:11 +, [EMAIL PROTECTED] wrote: > I am trying to use python for file processing. > Suppose I have a file like this: > I want to build a Hashmap between the line "begin_QOS_statistics" and > "end_QOS_statistics" > and for each line

How can I use python for file processing

2007-08-25 Thread [EMAIL PROTECTED]
Hi, I am trying to use python for file processing. Suppose I have a file like this: I want to build a Hashmap between the line "begin_QOS_statistics" and "end_QOS_statistics" and for each line I want to put the first text as the key of the hash table and the second text as th

Re: File processing - is Python suitable?

2007-06-19 Thread Jorgen Grahn
On Tue, 19 Jun 2007 05:15:17 -0700, ferrad <[EMAIL PROTECTED]> wrote: > I have not used Python before, but believe it may be what I need. > > I have large text files containing text, numbers, and junk. I want to > delete large chunks process other bits, etc, much like I'd do in an > editor, but wa

Re: File processing - is Python suitable?

2007-06-19 Thread Peter Otten
ferrad wrote: > I have not used Python before, but believe it may be what I need. > > I have large text files containing text, numbers, and junk. I want to > delete large chunks process other bits, etc, much like I'd do in an > editor, but want to do it automatically. I have a set of generic >

Re: File processing - is Python suitable?

2007-06-19 Thread Alan Isaac
ferrad wrote: > I have large text files containing text, numbers, and junk. I want to > delete large chunks process other bits, etc, much like I'd do in an > editor, but want to do it automatically. > Question: can I translate these types of rules into programmatical > constructs that Python can

Re: File processing - is Python suitable?

2007-06-19 Thread Helmut Jarausch
ferrad wrote: > I have not used Python before, but believe it may be what I need. > > I have large text files containing text, numbers, and junk. I want to > delete large chunks process other bits, etc, much like I'd do in an > editor, but want to do it automatically. I have a set of generic > r

File processing - is Python suitable?

2007-06-19 Thread ferrad
I have not used Python before, but believe it may be what I need. I have large text files containing text, numbers, and junk. I want to delete large chunks process other bits, etc, much like I'd do in an editor, but want to do it automatically. I have a set of generic rules that my fingers follo

Re: File processing

2005-09-23 Thread Bryan Olson
Peter Hansen wrote: > Gopal wrote: >> [...] I'm >> thinking of going with this format by having "Param Name - value". Note >> that the value is a string/number; something like this: >> >> PROJECT_ID = "E4208506" >> SW_VERSION = "18d" >> HW_VERSION = "2" >> >> In my script, I need to parse

Re: File processing

2005-09-23 Thread Jeremy Jones
Gopal wrote: >Thanks for the reference. However, I'm not understanding how to use it. >Could you please provide with an example? Like I open the file, read >line and give it to parser? > >Please help me. > > > I had thought of recommending what Peter Hansen recommended - just importing the text

Re: File processing

2005-09-23 Thread Gopal
Thank you very much. That works!!! -- http://mail.python.org/mailman/listinfo/python-list

Re: File processing

2005-09-23 Thread Peter Hansen
Gopal wrote: > Hello, > > I'm Gopal. I'm looking for a solution to the following problem: > > I need to create a text file config.txt having some parameters. I'm > thinking of going with this format by having "Param Name - value". Note > that the value is a string/number; something like this: >

Re: File processing

2005-09-23 Thread Gopal
Thanks for the reference. However, I'm not understanding how to use it. Could you please provide with an example? Like I open the file, read line and give it to parser? Please help me. -- http://mail.python.org/mailman/listinfo/python-list

Re: File processing

2005-09-23 Thread Jeremy Jones
Gopal wrote: >Hello, > >I'm Gopal. I'm looking for a solution to the following problem: > >I need to create a text file config.txt having some parameters. I'm >thinking of going with this format by having "Param Name - value". Note >that the value is a string/number; something like this: > >PROJEC

Re: File processing

2005-09-23 Thread [EMAIL PROTECTED]
The ConfigParser class is designed for this task, see http://docs.python.org/lib/module-ConfigParser.html -- http://mail.python.org/mailman/listinfo/python-list

File processing

2005-09-23 Thread Gopal
Hello, I'm Gopal. I'm looking for a solution to the following problem: I need to create a text file config.txt having some parameters. I'm thinking of going with this format by having "Param Name - value". Note that the value is a string/number; something like this: PROJECT_ID = "E4208506" SW_VE