Reading a file and resuming reading.

2007-05-25 Thread Karim Ali
do this simply by counting the lines! I appreciate any help. Karim _ Windows Live Hotmail. Now with better security, storage and features. www.newhotmail.ca?icid=WLHMENCA149 -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading a file and resuming reading.

2007-05-25 Thread Karim Ali
to the previously known position: # restart with old bytyepos with file(filename) as f: f.seek(bytepos) for line in f: ... process line ... bytepos += len(line) -- Thanks! This works perfectly. I did not know you can iterate directly using the file handle! Karim

Re: Call script which accepts com. line par. from another scriptand error control

2007-05-24 Thread Karim Ali
such that the second script can call: first_script.main(command line). Is this possible? If i can simply do whatever it is that parse_args() does but on a variable of my choosing.. Karim From: James Stroud [EMAIL PROTECTED] To: python-list@python.org Subject: Re: Call script which accepts com. line par. from

Re: Call script which accepts com. line par. from another scriptanderror control

2007-05-24 Thread Karim Ali
Karim Ali wrote: What I still dont know though is how do I handle the fact that the first script is expecting command line parameters. I would like to be able to replace the command line parameters by a variable such that the second script can call: first_script.main(command line

Call script which accepts com. line par. from another script and error control

2007-05-23 Thread Karim Ali
Hi, I would really appreciate help on this. I have a script (s1.py) which I would like to call from another script (s2.py). No problem there. The first issue is that s1.py has a command line parser which I would like to keep but instead of fetching the information from the command line, I

<    1   2