bruno at modulix wrote:
Yves Glodt wrote:
(snip)
ok I see your point, and python's...
(just FYI, and not to start a flamewar ;-):
In php, the [] means append to an array object.
yes, I know this.
If the array does not exist yet, it's created.
Which is what I don't like. It should
Yves Glodt wrote:
Which raises another question... :-)
Is there a possibility to bring together apache and python in a way that
I can embed python into html?
What do you mean ?
Or even, write a smallish webserver in python (using twisted maybe)
whose only purpose is to serve pages and
Yves Glodt wrote:
Is there a possibility to bring together apache and python in a way that
I can embed python into html?
http://www.onlamp.com/pub/a/python/2004/02/26/python_server_pages.html
http://www.modpython.org/live/mod_python-3.2.2b/doc-html/pyapi-psp.html#pyapi-psp
/F
--
[EMAIL PROTECTED] wrote:
Yves Glodt wrote:
Which raises another question... :-)
Is there a possibility to bring together apache and python in a way that
I can embed python into html?
What do you mean ?
I need this (invalid example-html follows):
html
h1title of page/h1
?py
import time
Yves Glodt wrote:
I need this (invalid example-html follows):
html
h1title of page/h1
?py
import time
print pHello, today is: %s/p % (time.ctime())
?
/html
Cheetah template ?
But I like Kid better as I don't want python in HTML, Kid IMO strikes
the balance between python feature
On Wed, 09 Nov 2005 20:45:52 +0100, bruno at modulix wrote:
If the array does not exist yet, it's created.
Which is what I don't like. It should crash.
Perhaps not *crash* as such. Raise an exception perhaps.
--
Steven.
--
http://mail.python.org/mailman/listinfo/python-list
Yves Glodt [EMAIL PROTECTED] writes:
Which raises another question... :-)
Is there a possibility to bring together apache and python in a way
that I can embed python into html?
Lots of ways. Most of them aren't really Python, but look a lot like
it.
PSP is most like PHP/ASP/etc., and I
...?!?
My question is: Is there no way to append to a non existing list?
I am lazy for declaring it first, IMHO it bloats the code, and (don't
know if it's good to say that here) where I come from (php) I was used
to not-needing it...
regards,
Yves
--
http://mail.python.org/mailman/listinfo
Hi
I think there's no way to append to a non existing list.
Sorry about my question, but the English is my second language, and I
don't know what is the meaning of IHMO (or IMHO). I googled and found
that it means In My Humbled Opinion, is that true? Thanks and accept
my appologies
to a non existing list?
I am lazy for declaring it first, IMHO it bloats the code, and (don't
know if it's good to say that here) where I come from (php) I was used
to not-needing it...
regards,
Yves
--
http://mail.python.org/mailman/listinfo/python-list
the way python works...?!?
My question is: Is there no way to append to a non existing list?
how do you expect Python to figure out what kind of empty object
you want ?
/F
--
http://mail.python.org/mailman/listinfo/python-list
Yves My question is: Is there no way to append to a non existing list?
My question in return is: How is Python supposed to know that pkcolumns is
supposed to be a list instead of some other type of object that happens to
define an append() method? For example, my code might contain
normal as it's the way python works...?!?
My question is: Is there no way to append to a non existing list?
I am lazy for declaring it first, IMHO it bloats the code, and (don't
know if it's good to say that here) where I come from (php) I was used
to not-needing it...
regards,
Yves
If PHP is heavily influenced by Perl(as I read some where), the
variable name determine it I believe. @myvar is an array ?
[EMAIL PROTECTED] wrote:
I don't know php, but would also have to wonder how it knows to create a
list instead of an integer (for example).
Skip
--
[EMAIL PROTECTED] wrote:
Yves My question is: Is there no way to append to a non existing list?
My question in return is: How is Python supposed to know that pkcolumns is
supposed to be a list instead of some other type of object that happens to
define an append() method?
I am fairly
by the amount of answers that my question
rose, in so little time!
thanks all!
There is a lot I don't like about python but if you have to use it, you
have to cope with it.
Yves Glodt wrote:
My question is: Is there no way to append to a non existing list?
I am lazy for declaring it first, IMHO
guess that's normal as it's the way python works...?!?
My question is: Is there no way to append to a non existing list?
I am lazy for declaring it first, IMHO it bloats the code, and (don't
know if it's good to say that here) where I come from (php) I was used
to not-needing it...
regards
that's normal as it's the way python works...?!?
yes sir.
My question is: Is there no way to append to a non existing list?
No. Definitively. And that's a Good Thing(tm).
How would you use something that doesn't exist ???
I am lazy for declaring it first,
s/declaring/instantiating/
If you were
Juho Schultz wrote:
Yves Glodt wrote:
Hello,
if I do this:
for row in sqlsth:
pkcolumns.append(row[0].strip())
etc
You mean you want to type pkcolumns only once to keep your code short?
Would something like this be useful?
pkcolumns = [row.strip() for row in
Yves Glodt [EMAIL PROTECTED] writes:
I guess that's normal as it's the way python works...?!?
Yes, that's the way Python works.
My question is: Is there no way to append to a non existing list?
The next time you go shopping at your local super-market, do
*not* get a shopping-cart
I guess that's normal as it's the way python works...?!?
yes sir.
My question is: Is there no way to append to a non existing list?
No. Definitively. And that's a Good Thing(tm).
How would you use something that doesn't exist ???
I am lazy for declaring it first,
s/declaring
[EMAIL PROTECTED] wrote:
Thomas Bellman wrote:
The next time you go shopping at your local super-market, do
*not* get a shopping-cart (or shopping-basket, or any similar
container). As you pick up the things you want to buy, try
to put them into the non-existing cart. Perhaps you will then
Yves Glodt wrote:
I am fairly new to python (and I like it more and more), but I can not
answer this question... As I said, where I come from it is possible, and
how they do it is explained a little here:
http://lu.php.net/manual/en/language.types.type-juggling.php
but that page doesn't
Max M wrote:
Yves Glodt wrote:
bruno at modulix wrote:
Yves Glodt wrote:
Hello,
if I do this:
for row in sqlsth:
pkcolumns.append(row[0].strip())
etc
without a prior:
pkcolumns = [];
I get this error on first iteration:
UnboundLocalError: local variable
Yves Glodt wrote:
bruno at modulix wrote:
Yves Glodt wrote:
Hello,
if I do this:
for row in sqlsth:
pkcolumns.append(row[0].strip())
etc
without a prior:
pkcolumns = [];
I get this error on first iteration:
UnboundLocalError: local variable 'pkcolums'
Fredrik Lundh wrote:
x = 10 + 20 # should this be 30 or 1020 or 1020 or ...?
I think Perl handles this case pretty well and sane.
In fact, this strict but dynamic type checking is quite painful to work
with, especially the new decimal class.
I can do a :
decimal + int
but not
decimal +
Yves Glodt [EMAIL PROTECTED] wrote:
My question is: Is there no way to append to a non existing list?
Nope. The problem (well, part of the problem, anyway) is that when you do:
foo.append (bar)
what's happening is you're calling foo's append method. If foo doesn't
already exist, it has
In article [EMAIL PROTECTED],
Yves Glodt [EMAIL PROTECTED] wrote:
You mean you want to type pkcolumns only once to keep your code short?
Would something like this be useful?
pkcolumns = [row.strip() for row in sqlsth]
I will look into this, maybe it's what I need, thanks!
The list
On Wed, 09 Nov 2005 13:46:52 +0100, Yves Glodt wrote:
My question is: Is there no way to append to a non existing list?
I am lazy for declaring it first, IMHO it bloats the code, and (don't
know if it's good to say that here) where I come from (php) I was used
to not-needing
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:
Fredrik Lundh wrote:
x = 10 + 20 # should this be 30 or 1020 or 1020 or ...?
I think Perl handles this case pretty well and sane.
In fact, this strict but dynamic type checking is quite painful to work
with, especially the new decimal class.
Mike Meyer wrote:
Float doesn't handle implicit conversion to anything but but builtin types.
In particular, it doesn't check to see if the object beinng added has a
__float__ method, and invoke that to do the conversion if it does.
that's because __float__ is there to let you control what
Yves Glodt wrote:
(snip)
ok I see your point, and python's...
(just FYI, and not to start a flamewar ;-):
In php, the [] means append to an array object.
yes, I know this.
If the array does not exist yet, it's created.
Which is what I don't like. It should crash.
[] *is* explicit for
Fredrik Lundh [EMAIL PROTECTED] writes:
Mike Meyer wrote:
Float doesn't handle implicit conversion to anything but but builtin types.
In particular, it doesn't check to see if the object beinng added has a
__float__ method, and invoke that to do the conversion if it does.
that's because
On Wednesday 09 November 2005 07:00, Yves Glodt wrote:
I will never mention any p-language except python in this list anymore...
+1 QOTW
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
34 matches
Mail list logo