>From (UML) state diagrams to Python code made easy.
State machines are without any doubt a very good way to model behavior. The new
code generator from Sinelabore translates hierarchical state machines
efficiently into different languages now including Python.
The generator accepts diagrams fr
? Or at least a code generation tool ?
I read about Cog and might use it.
Jbb
--
https://mail.python.org/mailman/listinfo/python-list
On 27/06/2013 9:17 AM, Foo Stack wrote:
Given string input such as:
foo=5 AND a=6 AND date=now OR date='2013/6' AND bar='hello'
I am going to implement:
- boolean understanding (which operator takes precendence)
- spliting off of attributes into my function which computes their table in th
On 2013-06-26 16:17, Foo Stack wrote:
> Given string input such as:
> foo=5 AND a=6 AND date=now OR date='2013/6' AND bar='hello'
>
> I am going to implement:
>
> - boolean understanding (which operator takes precendence)
> - spliting off of attributes into my function which computes their
>
Given string input such as:
foo=5 AND a=6 AND date=now OR date='2013/6' AND bar='hello'
I am going to implement:
- boolean understanding (which operator takes precendence)
- spliting off of attributes into my function which computes their table in the
SQL database
- piece everything together
Perhaps:
http://code.google.com/p/python-graph/
On Tue, Aug 2, 2011 at 8:03 PM, Rita wrote:
> Hello,
>
> This isn't much of a python question but a general algorithm question.
>
> I plan to input the following string and I would like to generate something
> like this.
>
> input: a->(b,c)->d
> o
Hello,
This isn't much of a python question but a general algorithm question.
I plan to input the following string and I would like to generate something
like this.
input: a->(b,c)->d
output:
parent a, child b c
parent b c child d
Are there any libraries or tools which will help me evaluate ite
Plug? Any evidence to say that? As long as this thread concerned, is there any
answer more closed to the topic "C++ code generation" than mine?
I think Stefan was telling you, in a nice way, to stop spamming every thread
about code generation with a plug for your project.
2010
I think Stefan was telling you, in a nice way, to stop spamming every thread
about code generation with a plug for your project.
2010/3/17 CHEN Guang
> >> - Original Message -
> >> From: "Dan Goodman"
> >>
> >>> I'm doing some C++ c
>> - Original Message -
>> From: "Dan Goodman"
>>
>>> I'm doing some C++ code generation using Python, and would be interested
>>> in any comments on the approach I'm taking.
>>
>> PythoidC ( http://pythoidc.googlecod
CHEN Guang, 17.03.2010 02:54:
- Original Message -
From: "Dan Goodman"
I'm doing some C++ code generation using Python, and would be interested
in any comments on the approach I'm taking.
PythoidC ( http://pythoidc.googlecode.com ) is a C code generator (not C++
PythoidC ( http://pythoidc.googlecode.com ) is a C code generator (not C++)
- Original Message -
From: "Dan Goodman"
To:
Sent: Wednesday, March 17, 2010 9:00 AM
Subject: C++ code generation
> Hi all,
>
> I'm doing some C++ code generation using Python, and w
Hi all,
I'm doing some C++ code generation using Python, and would be interested
in any comments on the approach I'm taking.
Basically, the problem involves doing some nested loops and executing
relatively simple arithmetic code snippets, like:
for i in xrange(len(X)):
George Trojan wrote:
I need an advice on table generation. The table is essentially a fifo,
containing about 200 rows. The rows are inserted every few minutes or
so. The simplest solution is to store row data per line and write
directly html code:
line = "value1value2>... "
each run of the pro
On Jan 20, 10:03 pm, "D'Arcy J.M. Cain" wrote:
> On Wed, 20 Jan 2010 21:03:10 +
>
> George Trojan wrote:
> > I need an advice on table generation. The table is essentially a fifo,
> > containing about 200 rows. The rows are inserted every few minutes or
> > so. The simplest solution is to sto
ah ok, i misread your post. Store each 'junk' as an item
in the deque. the idea is the same though.
On Wed, Jan 20, 2010 at 4:55 PM, Chris Colbert wrote:
>
>
> On Wed, Jan 20, 2010 at 4:52 PM, Chris Colbert wrote:
>
>> use a deque with a 'junk' as each element
>>
>> http://docs.python.org/librar
On Wed, 20 Jan 2010 21:03:10 +
George Trojan wrote:
> I need an advice on table generation. The table is essentially a fifo,
> containing about 200 rows. The rows are inserted every few minutes or
> so. The simplest solution is to store row data per line and write
> directly html code:
> li
On Wed, Jan 20, 2010 at 4:52 PM, Chris Colbert wrote:
> use a deque with a 'junk' as each element
>
> http://docs.python.org/library/collections.html
>
> On Wed, Jan 20, 2010 at 4:03 PM, George Trojan wrote:
>
>> I need an advice on table generation. The table is essentially a fifo,
>> containing
use a deque with a 'junk' as each element
http://docs.python.org/library/collections.html
On Wed, Jan 20, 2010 at 4:03 PM, George Trojan wrote:
> I need an advice on table generation. The table is essentially a fifo,
> containing about 200 rows. The rows are inserted every few minutes or so.
> T
I need an advice on table generation. The table is essentially a fifo,
containing about 200 rows. The rows are inserted every few minutes or
so. The simplest solution is to store row data per line and write
directly html code:
line = "value1value2>... "
each run of the program would read the pr
versions of a C++ source code,
> basically injecting different flavours of inline assembler depending
> on target compiler/CPU.
>
> Code generation should be integrated into a 'master source file' which
> is the processed and generates the right code for GCC / MSVC or other
>
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
ats wrote:
> I want to generate 3 different versions of a C++ source code,
> basically injecting different flavours of inline assembler depending
> on target compiler/CPU.
Are you aware that there are also packages that let you generate and
call C cod
> Any suggestions?
I've happily used Cheetah with Leo (http://webpages.charter.net/
edreamleo/front.html) to organise and script my code generation needs,
but you may also be happy with cog (http://nedbatchelder.com/code/
cog/).
AK
--
http://mail.python.org/mailman/listinfo/python-list
ke some mistakes.
>
> > I want to generate 3 different versions of a C++ source code,
> > basically injecting different flavours of inline assembler depending
> > on target compiler/CPU.
>
> > Code generation should be integrated into a 'master source file' which
nline assembler depending
on target compiler/CPU.
Code generation should be integrated into a 'master source file' which
is the processed and generates the right code for GCC / MSVC or other
cases. Something like:
int FastAdd( int t1, int t2 ){
int r;
##if USE_INLINE_ASM
r/CPU.
Code generation should be integrated into a 'master source file' which
is the processed and generates the right code for GCC / MSVC or other
cases. Something like:
int FastAdd( int t1, int t2 ){
int r;
##if USE_INLINE_ASM
#ARG( eax, "t1")
#ARG( eb
On Nov 14, 3:04 am, Aaron Brady <[EMAIL PROTECTED]> wrote:
> On Nov 13, 7:16 pm, Alex_Gaynor <[EMAIL PROTECTED]> wrote:
>
> > I'm trying to figure out what the best architecture for doing code
> > generation would be. I have a set of ASTs that define a program,
On Nov 13, 7:16 pm, Alex_Gaynor <[EMAIL PROTECTED]> wrote:
> I'm trying to figure out what the best architecture for doing code
> generation would be. I have a set of ASTs that define a program, so
> what should I do to for code generation. As I see it the 2 choices
> are
I'm trying to figure out what the best architecture for doing code
generation would be. I have a set of ASTs that define a program, so
what should I do to for code generation. As I see it the 2 choices
are to have the ASTs have a generate code method that returns the
correct code for thems
On Jun 23, 6:44 am, eliben <[EMAIL PROTECTED]> wrote:
> Thanks for all the replies in this post. Just to conclude, I want to
> post a piece of code I wrote to encapsulate function creation in this
> way:
>
> def create_function(code):
> """ Create and return the function defined in code.
>
Since nobody mentioned textwrap.dedent yet as an alternative to the
old "if 1:" trick, I thought I should do so. :)
--
http://mail.python.org/mailman/listinfo/python-list
Le Tuesday 24 June 2008 07:18:47 eliben, vous avez écrit :
> > If code generation is not the best, and I fail to see any performance
> > issue that could explain such a choice, except a misunderstanding of
> > what "compilation" means in python, just don't use
eliben wrote:
And while we're on the topic of what compilation means in Python,
It depends on the implementation.
I'm
not sure I fully understand the difference between compiled (.pyc)
code and exec-ed code. Is the exec-ed code turned to bytecode too,
i.e. it will be as efficient as comp
> If code generation is not the best, and I fail to see any performance issue
> that could explain such a choice, except a misunderstanding of
> what "compilation" means in python, just don't use it, use closures or
> callable instances, there are many way to achieve th
On Jun 21, 7:52 am, Peter Otten <[EMAIL PROTECTED]> wrote:
> eliben wrote:
> > On Jun 20, 2:44 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
> >> eliben wrote:
> >> > Additionally, I've found indentation to be a problem in such
> >> > constructs. Is there a workable way to indent the code at the level
Maric Michaud a écrit :
Le Monday 23 June 2008 09:22:29 Bruno Desthuilliers, vous avez écrit :
With some help from the guys at IRC I came to realize your way doesn't
do the same. It creates a function that, when called, creates 'foo' on
globals(). This is not exactly what I need.
I possibly mes
ion for the original problem. I think these interface are not a
replacement for the quick eval-exec idiom but more intended to make massive
code generation programs object oriented and closer to python internals.
AFAIK, the only use case I see code generation (eval - exec, playing with code
objec
eliben a écrit :
d = {}
execcode in globals(), d
return d['foo']
My way:
return function(compile(code, '', 'exec'), globals())
With some help from the guys at IRC I came to realize your way doesn't
do the same. It creates a function that, when called, creates 'foo' on
globals(). This
Thanks for all the replies in this post. Just to conclude, I want to
post a piece of code I wrote to encapsulate function creation in this
way:
def create_function(code):
""" Create and return the function defined in code.
"""
m = re.match('\s*def\s+([a-zA-Z_]\w*)\s*\(', code)
if m
[EMAIL PROTECTED] wrote:
> On 20 juin, 21:44, eliben <[EMAIL PROTECTED]> wrote:
...
>> The generic version has to make a lot of decisions at runtime, based
>> on the format specification.
>> Extract the offset from the spec, extract the length.
... ...
> Just my 2 cents. Truth is that as long as i
f all, I see absolutely no connection between your question and
> the text you quote. Is there? Or did you pick one post randomly to
> post your question on?
>
> Second, yes - I have profiled my code.
>
> Third, this is a very typical torture path one has to go through when
> ask
ick one post randomly to
post your question on?
Second, yes - I have profiled my code.
Third, this is a very typical torture path one has to go through when
asking about code generation. It is true of almost all communities,
except Lisp, perhaps. You have to convince everyone that you have a
real
On Jun 21, 2:02 pm, eliben <[EMAIL PROTECTED]> wrote:
> On Jun 21, 8:52 am, Peter Otten <[EMAIL PROTECTED]> wrote:
>
>
>
> > eliben wrote:
> > > On Jun 20, 2:44 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
> > >> eliben wrote:
> > >> > Additionally, I've found indentation to be a problem in such
> >
On Jun 21, 8:52 am, Peter Otten <[EMAIL PROTECTED]> wrote:
> eliben wrote:
> > On Jun 20, 2:44 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
> >> eliben wrote:
> >> > Additionally, I've found indentation to be a problem in such
> >> > constructs. Is there a workable way to indent the code at the level
eliben wrote:
> On Jun 20, 2:44 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
>> eliben wrote:
>> > Additionally, I've found indentation to be a problem in such
>> > constructs. Is there a workable way to indent the code at the level of
>> > build_func, and not on column 0 ?
>>
>> exec"if 1:" + code.
On Jun 20, 2:44 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
> eliben wrote:
> > Additionally, I've found indentation to be a problem in such
> > constructs. Is there a workable way to indent the code at the level of
> > build_func, and not on column 0 ?
>
> exec"if 1:" + code.rstrip()
>
> Peter
Why
>d = {}
> execcode in globals(), d
> return d['foo']
>
> My way:
>
> return function(compile(code, '', 'exec'), globals())
>
With some help from the guys at IRC I came to realize your way doesn't
do the same. It creates a function that, when called, creates 'foo' on
globals(). This is not
> So you are saying that for example "if do_reverse: data.reverse()" is
> *much* slower than "data.reverse()" ? I would expect that checking the
> truthness of a boolean would be negligible compared to the reverse
> itself. Did you try converting all checks to identity comparisons with
> None ? I m
On 20 juin, 21:44, eliben <[EMAIL PROTECTED]> wrote:
> On Jun 20, 3:19 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
>
(snip)
> > It's still not clear why the generic version is so slower, unless you
> > extract only a few selected fields, not all of them. Can you post a
> > sample of how you used
On 20 juin, 21:41, eliben <[EMAIL PROTECTED]> wrote:
> > [1] except using compile to build a code object with the function's
> > body, then instanciate a function object using this code, but I'm not
> > sure whether it will buy you much more performance-wise. I'd personnaly
> > prefer this because
[EMAIL PROTECTED]> wrote:
> > > > eliben a écrit :> Hello,
>
> > > > > In a Python program I'm writing I need to dynamically generate
> > > > > functions[*]
>
> > > > (snip)
>
> > > > > [*] I know that each ti
t; > > In a Python program I'm writing I need to dynamically generate
> > > > functions[*]
>
> > > (snip)
>
> > > > [*] I know that each time a code generation question comes up people
> > > > suggest that there's a better way to ach
> [1] except using compile to build a code object with the function's
> body, then instanciate a function object using this code, but I'm not
> sure whether it will buy you much more performance-wise. I'd personnaly
> prefer this because I find it more explicit and readable, but YMMV.
>
How is com
> FWIW, when I had a similar challenge for dynamic coding, I just
> generated a py file and then imported it. This technique was nice
> because can also work with Pyrex or Psyco.
>
I guess this is not much different than using exec, at the conceptual
level. exec is perhaps more suitable when you
On Fri, Jun 20, 2008 at 3:17 AM, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
Just to make things clear: you do know that you can dynamically build
> functions without exec, do you ?
Actually, I don't know how to do this, but would like to. Can you point me
to a place where I can read more a
eliben a écrit :
On Jun 20, 9:17 am, Bruno Desthuilliers wrote:
eliben a écrit :> Hello,
In a Python program I'm writing I need to dynamically generate
functions[*]
(snip)
[*] I know that each time a code generation question comes up people
suggest that there's a better w
On Jun 20, 5:03 am, eliben <[EMAIL PROTECTED]> wrote:
> I've rewritten it using a dynamically generated procedure
> for each field, that does hard coded access to its data. For example:
>
> def get_counter(packet):
> data = packet[2:6]
> data.reverse()
> return data
>
> This gave me a huge sp
On Jun 20, 8:03 am, eliben <[EMAIL PROTECTED]> wrote:
> On Jun 20, 9:17 am, Bruno Desthuilliers
> [EMAIL PROTECTED]> wrote:
> > eliben a écrit :> Hello,
>
> > > In a Python program I'm writing I need to dynamically generate
> > > functions[*]
>
eliben wrote:
> Additionally, I've found indentation to be a problem in such
> constructs. Is there a workable way to indent the code at the level of
> build_func, and not on column 0 ?
exec "if 1:" + code.rstrip()
Peter
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 20, 9:17 am, Bruno Desthuilliers wrote:
> eliben a écrit :> Hello,
>
> > In a Python program I'm writing I need to dynamically generate
> > functions[*]
>
> (snip)
>
> > [*] I know that each time a code generation question comes up people
> &g
eliben a écrit :
Hello,
In a Python program I'm writing I need to dynamically generate
functions[*]
(snip)
[*] I know that each time a code generation question comes up people
suggest that there's a better way to achieve this, without using exec,
eval, etc.
Just to make things
def build_func(args):
code """def foo(...)..."""
d = {}
exec code in globals(), d
return d['foo']
My question is, considering that I really need code generation[*] -
"is there a cleaner way to do this ?" Also, what happens if I replace
Hi,
just a quick announcement that I finished the port of the Cython compiler to
the Py3 target platform. While you cannot currently run Cython itself in Py3,
you can build the generated C sources unchanged under Py2.3 through 3.0a5.
http://cython.org/
There isn't a release yet (though there
...
Thank you for your answers. I tried to parse the wsdl with two
libraries. (axis2 (java) and SOAPPy). Both fail because there
is no entry for 'service'.
The wsdl is from SAP XI.
Has someone hints?
Thomas
--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guett
roubles after system upgrade and
regenerating stub.
> This project uses code generation. That's something
> I don't like.
But after you have generated files it is easy to use that tool -- just call a
function and grab result.
With ZSI you don't have to generate code, but y
On Apr 2, 3:06 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I looked for a solution to talk to a web service which
> offers its signature with a wsdl file.
>
> I googled for 'wsdl python' and found ZSI.
>
> This project uses code generation.
Hi,
I looked for a solution to talk to a web service which
offers its signature with a wsdl file.
I googled for 'wsdl python' and found ZSI.
This project uses code generation. That's something
I don't like.
The book 'dive into python' uses SOAPpy. This looks
bet
I changed that and the writelines and I am very close now. thanks.
Dennis Lee Bieber wrote:
> On 1 Dec 2006 17:24:18 -0800, "[EMAIL PROTECTED]"
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>
> > data = sys2.stdin.readlines()
>
> And what do you expect to read from
It is left over from the example I stold it from, I remove it and see
if that helps.
Dennis Lee Bieber wrote:
> On 1 Dec 2006 17:24:18 -0800, "[EMAIL PROTECTED]"
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>
> > data = sys2.stdin.readlines()
>
> And what do you ex
I never see anything from print(data). The example I tried to adapt
using readlines may be a little old or something. I did close all the
files to prevent problems when I figure out what is wrong with what I
have.
John Machin wrote:
> You say "I am sure the readlines code is crashing it." I ca
You say "I am sure the readlines code is crashing it." I can't imagine
how you can be sure of anything, but yes, it is a possibility that
sys.stdin.readlines() might behave strangely when called from a GUI
kit. Why from sys.stdin anyway?
You have two *known* definite problems (not closing your out
John Machin wrote:
> [EMAIL PROTECTED] wrote:
> > I am writing out zero byte files with this (using python 2.5). I have
> > no idea why I am having that problem
>
> Which output file(s) do you mean, temp.orc or temp.sco or both?
> Two possible causes outlined below.
>
> > I am also looking for an
[EMAIL PROTECTED] wrote:
> I am writing out zero byte files with this (using python 2.5). I have
> no idea why I am having that problem
Which output file(s) do you mean, temp.orc or temp.sco or both?
Two possible causes outlined below.
> I am also looking for an example
> of readlines where I ca
I am writing out zero byte files with this (using python 2.5). I have
no idea why I am having that problem, I am also looking for an example
of readlines where I can choose a number of lines say lines 12 to 14
and then write them back to disk. any help would be apreaceted.
import sys as sys2
i
Stefan Behnel wrote:
> I've been looking through Python templating systems all over the place, but I
> just can't find one that supports XPath - which is by far the best thing to
> have when you generate stuff from XML. TAL might be able to get me part of the
> way (at least, it supports some kind
und that I need a template system that supports
>> Python interaction. I know, lxml's XSLT support is /somewhat/ getting there,
>> but even with that, XSLT is so clumsy when it comes to code generation
>> (looping constructs and if/else above all), that it would take me t
tem that supports
> Python interaction. I know, lxml's XSLT support is /somewhat/ getting there,
> but even with that, XSLT is so clumsy when it comes to code generation
> (looping constructs and if/else above all), that it would take me tons of XSLT
> code to write what I want.
>
LT support is /somewhat/ getting there,
but even with that, XSLT is so clumsy when it comes to code generation
(looping constructs and if/else above all), that it would take me tons of XSLT
code to write what I want.
I've been looking through Python templating systems all over the place, b
Try this:
http://uml.sourceforge.net/index.php
Regards,
Philippe
Maurice LING wrote:
> Hi,
>
> Is there any UML tools that is able to take UML and generate Python codes?
>
> Cheers
> Maurice
--
http://mail.python.org/mailman/listinfo/python-list
uch things, but I doubt
> that any current tool is much better except for trivial
> subsets of UML.
Have a look at Enterprise Architect from Sparx Systems
(http://www.sparxsystems.com.au).
It is a really nice UML tool that is also affordable. I have also used
Rational Rose since about 96-97,
James wrote:
> The brain may be fine for generating Python from UML but it is MANY
> MANY orders of magnitude harder to generate UML from code with just
> your brain than using a tool (usually zero effort and error free) no
> matter how good you are at Python.
I've really only used Rational Rose,
Peter Dembinski wrote:
> "Grigoris Tsolakidis" <[EMAIL PROTECTED]> writes:
>
> > There is tool to generate UML from Python Code...
>
> The best is human brain.
No! It isn't. In fact, it's the worst.
The brain may be fine for generating Python from UML but it is MANY
MANY orders of magnitude harde
"Grigoris Tsolakidis" <[EMAIL PROTECTED]> writes:
> There is tool to generate UML from Python Code...
The best is human brain.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks James. I've googled a few times and it is always tools that
generates UML from Python codes that comes up in the top hits, which
brings me to wonder if there is something that does the opposite.
maurice
James wrote:
>>Is there any UML tools that is able to take UML and generate Python co
> Is there any UML tools that is able to take UML and generate Python codes?
Dia2code generates Python from UML.
Boa Constructor generates UML from Python.
PyUt.
Object Domain's UML Tool (Commercial)
You need to use Google.
--
http://mail.python.org/mailman/listinfo/python-list
Enterprise Architect (http://www.sparxsystems.com.au/) supports an
add-in that will generate Python from UML diagrams. Once you install
EA, follow the instructions for adding the Python technology resource,
which is a free download from the EA website.
Will also generate UML from Python source.
There is tool to generate UML from Python Code...
"Maurice LING" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Is there any UML tools that is able to take UML and generate Python codes?
>
> Cheers
> Maurice
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Is there any UML tools that is able to take UML and generate Python codes?
Cheers
Maurice
--
http://mail.python.org/mailman/listinfo/python-list
88 matches
Mail list logo