Re: Edit Python code programmatically

2008-02-10 Thread greg
Guilherme Polo wrote: > Generating code like this is always dangerous. Generating code isn't dangerous in itself. What's dangerous is mixing hand-edited and generated code in the same file. There's too much opportunity for hand edits to get wiped out by subsequent automatic edits or vice versa.

Re: Edit Python code programmatically

2008-02-09 Thread Benjamin
On Feb 9, 5:47 am, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > 2008/2/9, Alex <[EMAIL PROTECTED]>: > > > Which library could you recommend to perform simple editing of Python > > code (from Python program)? For example, open *.py file, find specific > > function definition, add another function

Re: Edit Python code programmatically

2008-02-09 Thread Guilherme Polo
2008/2/9, Alex <[EMAIL PROTECTED]>: > Guilherme Polo wrote: > > 2008/2/9, Alex <[EMAIL PROTECTED]>: > > > >> Guilherme Polo wrote: > >> > 2008/2/9, Arnaud Delobelle <[EMAIL PROTECTED]>: > >> > > >> >> On Feb 9, 12:32 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > >> >> > 2008/2/9, Al

Re: Edit Python code programmatically

2008-02-09 Thread Alex
Guilherme Polo wrote: > 2008/2/9, Alex <[EMAIL PROTECTED]>: > >> Guilherme Polo wrote: >> > 2008/2/9, Arnaud Delobelle <[EMAIL PROTECTED]>: >> > >> >> On Feb 9, 12:32 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: >> >> > 2008/2/9, Alex <[EMAIL PROTECTED]>: >> >> > >> >> > > Guilherme

Re: Edit Python code programmatically

2008-02-09 Thread Guilherme Polo
2008/2/9, Alex <[EMAIL PROTECTED]>: > Guilherme Polo wrote: > > 2008/2/9, Arnaud Delobelle <[EMAIL PROTECTED]>: > > > >> On Feb 9, 12:32 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > >> > 2008/2/9, Alex <[EMAIL PROTECTED]>: > >> > > >> > > Guilherme Polo wrote: > >> > > > 2008/2/9,

Re: Edit Python code programmatically

2008-02-09 Thread Alex
Guilherme Polo wrote: > 2008/2/9, Arnaud Delobelle <[EMAIL PROTECTED]>: > >> On Feb 9, 12:32 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: >> > 2008/2/9, Alex <[EMAIL PROTECTED]>: >> > >> > > Guilherme Polo wrote: >> > > > 2008/2/9, Alex <[EMAIL PROTECTED]>: >> >> >> > > >> Which l

Re: Edit Python code programmatically

2008-02-09 Thread Steve Holden
Guilherme Polo wrote: > 2008/2/9, Arnaud Delobelle <[EMAIL PROTECTED]>: >> On Feb 9, 12:32 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: >> > 2008/2/9, Alex <[EMAIL PROTECTED]>: >> > >> > > Guilherme Polo wrote: >> > > > 2008/2/9, Alex <[EMAIL PROTECTED]>: >> >> > > >> Which library could

Re: Edit Python code programmatically

2008-02-09 Thread Guilherme Polo
2008/2/9, Arnaud Delobelle <[EMAIL PROTECTED]>: > On Feb 9, 12:32 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > > 2008/2/9, Alex <[EMAIL PROTECTED]>: > > > > > Guilherme Polo wrote: > > > > 2008/2/9, Alex <[EMAIL PROTECTED]>: > > > > > > >> Which library could you recommend to perform si

Re: Edit Python code programmatically

2008-02-09 Thread Arnaud Delobelle
On Feb 9, 12:32 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > 2008/2/9, Alex <[EMAIL PROTECTED]>: > > > Guilherme Polo wrote: > >  > 2008/2/9, Alex <[EMAIL PROTECTED]>: > > >  >> Which library could you recommend to perform simple editing of Python > >  >>  code (from Python program)? For examp

Re: Edit Python code programmatically

2008-02-09 Thread Dustan
On Feb 9, 6:10 am, Alex <[EMAIL PROTECTED]> wrote: > Guilherme Polo wrote: > > 2008/2/9, Alex <[EMAIL PROTECTED]>: > > >> Which library could you recommend to perform simple editing of Python > >> code (from Python program)? For example, open *.py file, find specific > >> function definition, add

Re: Edit Python code programmatically

2008-02-09 Thread Guilherme Polo
2008/2/9, Alex <[EMAIL PROTECTED]>: > Guilherme Polo wrote: > > 2008/2/9, Alex <[EMAIL PROTECTED]>: > > > >> Which library could you recommend to perform simple editing of Python > >> code (from Python program)? For example, open *.py file, find specific > >> function definition, add another

Re: Edit Python code programmatically

2008-02-09 Thread Alex
Steven D'Aprano wrote: > On Sat, 09 Feb 2008 14:38:29 +0300, Alex wrote: > > >> Which library could you recommend to perform simple editing of Python >> code (from Python program)? >> > > I'm not even sure such a library exists. > Yes they exist, that field is called "code-generation",

Re: Edit Python code programmatically

2008-02-09 Thread Alex
Guilherme Polo wrote: > 2008/2/9, Alex <[EMAIL PROTECTED]>: > >> Which library could you recommend to perform simple editing of Python >> code (from Python program)? For example, open *.py file, find specific >> function definition, add another function call inside, find existing >> call and

Re: Edit Python code programmatically

2008-02-09 Thread Ben Finney
Alex <[EMAIL PROTECTED]> writes: > Which library could you recommend to perform simple editing of > Python code (from Python program)? For example, open *.py file, find > specific function definition, add another function call inside, find > existing call and change parameter value, etc. You migh

Re: Edit Python code programmatically

2008-02-09 Thread Steven D'Aprano
On Sat, 09 Feb 2008 14:38:29 +0300, Alex wrote: > Which library could you recommend to perform simple editing of Python > code (from Python program)? I'm not even sure such a library exists. > For example, open *.py file, find specific > function definition, add another function call inside, f

Re: Edit Python code programmatically

2008-02-09 Thread Guilherme Polo
2008/2/9, Alex <[EMAIL PROTECTED]>: > Which library could you recommend to perform simple editing of Python > code (from Python program)? For example, open *.py file, find specific > function definition, add another function call inside, find existing > call and change parameter value, etc. > Y

Edit Python code programmatically

2008-02-09 Thread Alex
Which library could you recommend to perform simple editing of Python code (from Python program)? For example, open *.py file, find specific function definition, add another function call inside, find existing call and change parameter value, etc. What I'm trying to implement isn't a real visua