Re: Invoking Python from Python

2005-11-11 Thread Scott David Daniels
Cameron Laird wrote: ... > I should make that explicit: application developers, you > don't have to tell customers everything your programs do. > Your obligation is to make 'em meet requirements. If it > helps *you* that they do more, so be it. I'd agree with the proviso that you at least inform

Re: Invoking Python from Python

2005-11-09 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: . . . >It's very flexible - but at this point, the "configuration file" is a >Python program, and not really suitable to use by non-programmers.

Re: Invoking Python from Python

2005-11-09 Thread Mike Meyer
[EMAIL PROTECTED] (Cameron Laird) writes: > I'll rein myself in and suggest an even easier introduction > to this subject: configuration files. RARELY is the correct > answer to create a new syntax, although many development > organizations give the impression that's their first choice. > ".ini"-

Re: Invoking Python from Python

2005-11-09 Thread B Mahoney
I also think something along the lines of execfile() may serve the original poster. There was a thread last month about compile() and exec() with a concise example from Fredrik Lundh. Google "Changing an AST" in this group. With dynamically generated code I prefer the separate compile() step so

Re: Invoking Python from Python

2005-11-09 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: . . . >Since Cameron didn't provide examples, let me grab a simple one. The >cheetah templating system works by creating Python programs from the >template.

Re: Invoking Python from Python

2005-11-08 Thread Mike Meyer
[EMAIL PROTECTED] (Cameron Laird) writes: > In article <[EMAIL PROTECTED]>, > Thomas Guettler <[EMAIL PROTECTED]> wrote: >>creating source code with a script, is no good solution. >>Once I had to maintain lisp code which stored its data in lisp code, too >>(incl. conditions and loops). It was a n

Re: Invoking Python from Python

2005-11-08 Thread Martin Miller
John Henry wrote: > Hi all, > > I have a need to create a Python script on the fly from another Python > program and then execute the script so created. Do I need to invoke > Python through os.spawnl or is there a better way? When doing something similar to this I used the built-in 'execfile()' f

Re: Invoking Python from Python

2005-11-08 Thread Jeffrey Schwab
John Henry wrote: > Hi all, > > I have a need to create a Python script on the fly from another Python > program and then execute the script so created. Do I need to invoke > Python through os.spawnl or is there a better way? Could you import the generated script? This might be the way to go if

Re: Invoking Python from Python

2005-11-08 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Thomas Guettler <[EMAIL PROTECTED]> wrote: . . . >creating source code with a script, is no good solution. > >Once I had to maintain lisp code which stored its data in lisp code, too >(incl. co

Re: Invoking Python from Python

2005-11-08 Thread Thomas Guettler
Am Tue, 08 Nov 2005 08:10:25 -0800 schrieb John Henry: > Hi all, > > I have a need to create a Python script on the fly from another Python > program and then execute the script so created. Do I need to invoke > Python through os.spawnl or is there a better way? Hi, creating source code with a

Invoking Python from Python

2005-11-08 Thread John Henry
Hi all, I have a need to create a Python script on the fly from another Python program and then execute the script so created. Do I need to invoke Python through os.spawnl or is there a better way? Thanks, -- John -- http://mail.python.org/mailman/listinfo/python-list