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= []

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

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