On Mon, Nov 30, 2009 at 1:12 PM, Dave Angel wrote:
> Victor Subervi wrote:
>
>> On Sun, Nov 29, 2009 at 10:23 PM, Dave Angel wrote:
>>
>>
>>
>>> exec is a statement, and statements don't have "return values." It's
>>> not
>>> a function, so there are no parentheses in its syntax, either. exec
On Mon, Nov 30, 2009 at 12:25 PM, Carsten Haese wrote:
> Victor Subervi wrote:
> > Taking out the parenthesis did it! Thanks. Now, you state this is an
> > option of last resort. Although this does indeed achieve my desired aim,
> > here is a complete example of what I am trying to achieve. The fo
Victor Subervi wrote:
On Sun, Nov 29, 2009 at 10:23 PM, Dave Angel wrote:
exec is a statement, and statements don't have "return values." It's not
a function, so there are no parentheses in its syntax, either. exec is also
a technique of last resort; there's nearly always a better/safer
Victor Subervi wrote:
> Taking out the parenthesis did it! Thanks. Now, you state this is an
> option of last resort. Although this does indeed achieve my desired aim,
> here is a complete example of what I am trying to achieve. The following
> is from 'createTables2.py':
>
> for table in tables
Jean-Michel Pichavant wrote:
if which == '':
i = 0
all = ''
while i < len(meanings):
table = '%s\n' % meanings[i]
table += "\n \n
composing HTML like that is painful, bug prone and insecure
You should have a look at http://tottinge.blogsome.com/meaningfulnames/
I
Victor Subervi wrote:
if which == '':
i = 0
all = ''
while i < len(meanings):
table = '%s\n' % meanings[i]
table += "\n \n align='center'>%s\n " % names[i]
j = 0
for elt in code:
if (j + 8) % 8 == 0:
table += ' \n'
table += ' %s\
On Sun, Nov 29, 2009 at 10:23 PM, Dave Angel wrote:
> exec is a statement, and statements don't have "return values." It's not
> a function, so there are no parentheses in its syntax, either. exec is also
> a technique of last resort; there's nearly always a better/safer/faster way
> to accom
Dave Angel wrote:
exec is a statement, and statements don't have "return values." It's
not a function,
In 3.x, it is a function, though the use of print as a statement
indicates that the OP was using 2.x.
--
http://mail.python.org/mailman/listinfo/python-list
Victor Subervi wrote:
Hi;
I have the following line of code:
exec('%s()' % table)
where 'table' is a variable in a for loop that calls variables from another
script. I've made it so that it only calls one variable. I know for a fact
that it's calling that variable in the script because it found
Thanks for the responses everyone. That does make sense to me now.
-Greg
--
http://mail.python.org/mailman/listinfo/python-list
7stud wrote:
> On Apr 8, 11:31 pm, "Gregory Piñero" <[EMAIL PROTECTED]> wrote:
> > Is there a way to call exec such that it won't have access to any more
> > objects than I explicitly give it?
>
> I think the way it works is that when the def is parsed, a function
> object is created and assigned t
Gregory Piñero <[EMAIL PROTECTED]> wrote:
> I'm curious why this code isn't working how I expect it to:
>
> import sys
> d=3
>
> def func1(a,b,c):
> print a,b,c,d
> print sys.path
>
> exec "func1(1,2,3)" in {'func1':func1}
>
>
> returns:
> 1 2 3 3
> [ sys.path stuff ]
>
> Sin
On Apr 8, 11:31 pm, "Gregory Piñero" <[EMAIL PROTECTED]> wrote:
> I'm curious why this code isn't working how I expect it to:
>
> import sys
> d=3
>
> def func1(a,b,c):
> print a,b,c,d
> print sys.path
>
> exec "func1(1,2,3)" in {'func1':func1}
>
>
> returns:
> 1 2 3 3
> [ sys.path stu
Gregory Piñero schrieb:
> I'm curious why this code isn't working how I expect it to:
>
> import sys
> d=3
>
> def func1(a,b,c):
> print a,b,c,d
> print sys.path
>
> exec "func1(1,2,3)" in {'func1':func1}
>
>
> returns:
> 1 2 3 3
> [ sys.path stuff ]
>
> Since I'm telling exec
14 matches
Mail list logo