File Parsing Question

2007-09-12 Thread Shankarjee Krishnamoorthi
Hi, I am new to Python. I am trying to do the following inp = open(my_file,'r') for line in inp: # Perform some operations with line if condition something: # Start re reading for that position again for line in inp: if some other condition

Re: File Parsing Question

2007-09-12 Thread Shankarjee Krishnamoorthi
I would prefer to use something with seek. I am not able to use seek() with "for line in inp". Use tell and seek does not seem to do anything with the code. When I try to do for line in inp.readlines(): # Top of Loop if not condition in line: do_something else: fo

Re: File Parsing Question

2007-09-13 Thread Shankarjee Krishnamoorthi
Great. That worked for me. I had some of my routines implemented in Perl earlier. Now that I started using Python I am trying to do all my automation scripts with Python. Thanks a ton Jee On 9/13/07, Peter Otten <[EMAIL PROTECTED]> wrote: > Dennis Lee Bieber wrote: > > > for line in inp: > > > >

Embedding a executable inside Python Script

2007-09-19 Thread Shankarjee Krishnamoorthi
Hi I have a python routine which calls an executable file created by someone else (I dont have the source code. All I have is an exe file). I do # My Python Code output = os.system('other_executable.exe') # Rest of my program. I need to give this routine to others to use it. I have a exe made

Re: Embedding a executable inside Python Script

2007-09-19 Thread Shankarjee Krishnamoorthi
I missed the obvious fact there. Thanks. I added it to the PATH and that fixed everything. Shankarjee On 9/19/07, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-09-19, Shankarjee Krishnamoorthi <[EMAIL PROTECTED]> wrote: > > > I have a exe made with py2exe for my P