[Tutor] exec vs system (fwd)

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Sat, 24 Feb 2001 21:51:51 -0800 (PST)

---------- Forwarded message ----------
Date: Sat, 24 Feb 2001 21:05:50 +0000
From: Viktor Lakics <lakicsv@usa.net>
To: Danny Yoo <dyoo@hkn.eecs.berkeley.edu>
Subject: exec vs system

On Sat, Feb 24, 2001 at 02:10:39AM -0800, Danny Yoo wrote:
> On Sat, 24 Feb 2001, Viktor Lakics wrote:
> > I have the script working, except the very last
> > bit, to invoke fetchmail. Here is what I want with pseudo-code:
> > 
> > if weekDay() and workHours():
> > 	run "fetchmail -d 2000"
> > else:
> > 	sys.exit
> > 
> > I did RTFM and know that I need to use one of the
> > os.exec...commands. But I am confused about the syntax:
> I'm actually not too familiar with os.exec(), but have you tried
> os.system()?  Here's an example:

The reason I have not tried, was that I thought that the difference
between execv and system is that exec is replacing the python
interpreter when it is invoked. And I thought if I invoke fetchmail
in demon mode (that is what the -d stands for) it is better to run
it this way...

Is that right? Does it make any difference?