Need to write python source with python

88888 Dihedral dihedral88888 at googlemail.com
Tue Feb 28 13:09:50 EST 2012


在 2012年2月29日星期三UTC+8上午1时56分43秒,Peter Otten写道:
> crstop at gmail.com wrote:
> 
> > I'm new to Python but have experience with a few other programming
> > languages(Java, Perl, JavaScript).
> > 
> > I'm using Python 2.7.2 and I'm trying to create and write to a file (.py)
> > a python class and functions from python. I will also need to later read
> > and edit the file. I realize I could just write strings using the
> > available string and file writing methods but suspect there is a better
> > way than that.
> > 
> > I have read about pickle, ast, and Django; searched this group and the web
> > but haven't found a solution that seems to fit. Any suggestion?
> 
> Due to Python's dynamic nature it is rarely necessary to generate Python 
> code. What are you actually trying to achieve?

Check myHDL, and BOA and pythoncard that can  translate user messages
to pyhton code as delphie.



More information about the Python-list mailing list