Harlin Seritt wrote:
Hi,
How does one get the name of a class from within the class code? I
tried something like this as a guess:
self.__name__
Get the class first, then inspect its name:
class Foo(object): pass
...
f = Foo()
f.__class__.__name__
'Foo'
HTH
--
d.
--
Daniel Nogradi wrote:
Does anyone know what has happened to the codebase of the subway
project? It seems the whole project has been shut down leaving no
trace of the code on net but I would be very happy to see it,
apparently it had some cool features that would be fun to look at.
Does anyone
Daniel Nogradi wrote:
(...)
the egg file can not be downloaded completely, the connection is
closed at byte 138903 all the time and the file is bigger than that.
If anyone managed to grab the file please let me know so far I tried
wget and firefox.
I've checked on my hd and found a recent
(%f, 1, True)
'10,000.00'
locale.format($%.2f, 1, True)
'$10,000.00'
bye.
--
deelan
http://www.deelan.com/
http://blog.deelan.com/
--
http://mail.python.org/mailman/listinfo/python-list
):
req.content_type = 'text/plain'
req.send_http_header()
req.write('mptest.py\n')
return apache.OK
Is this code enough for testing?
i believe so.
also check this:
Getting mod_python Working
http://www.dscpl.com.au/articles/modpython-001.html
--
deelan http://www.deelan.com
versa. It sounds
you are passing the *string* None to mysql, with it isn't
the same thing.
Adapting the Laszlo's example already posted:
cursor.execute(insert into tablename(fieldname) values (%s), [None])
HTH.
--
deelan, #1 fan of adriana lima!
http://www.deelan.com/
--
http
releases so i cannot be precise in
this regard.
HTH.
--
deelan, #1 fan of adriana lima!
http://www.deelan.com/
--
http://mail.python.org/mailman/listinfo/python-list
/
later,
deelan.
--
deelan, #1 fan of adriana lima!
http://www.deelan.com/
--
http://mail.python.org/mailman/listinfo/python-list
Konrad Mühler wrote:
Hi,
a simple question but i found no solution:
How can i convert a float value into a string value?
just use the str built-in type:
f = 9.99
str(f)
'9.99'
--
deelan, #1 fan of adriana lima!
http://www.deelan.com/
--
http://mail.python.org/mailman/listinfo
--
deelan, #1 fan of adriana lima!
http://www.deelan.com/
--
http://mail.python.org/mailman/listinfo/python-list
,
deelan.
--
deelan, #1 fan of adriana lima!
http://www.deelan.com/
--
http://mail.python.org/mailman/listinfo/python-list
deelan wrote:
(...)
# optional, get rid of _setup_table symbol
del _setup_table()
damn copy and paste :) of course i meant:
del _setup_table
--
deelan, #1 fan of adriana lima!
http://www.deelan.com/
--
http://mail.python.org/mailman/listinfo/python-list
)))
'spam'
HTH,
deelan.
--
deelan, #1 fan of adriana lima!
http://www.deelan.com/
--
http://mail.python.org/mailman/listinfo/python-list
)
the pythonic way is to use property (as others have already explained)
only when is *stricly necessary*. this may clarify things up:
Python Is Not Java
http://dirtsimple.org/2004/12/python-is-not-java.html
HTH.
--
deelan http://www.deelan.com
--
http://mail.python.org/mailman/listinfo/python-list
the group archives:
http://groups-beta.google.com/groups?q=comp.lang.python+switch+statement
HTH.
--
deelan http://www.deelan.com
--
http://mail.python.org/mailman/listinfo/python-list
. the _mysql extension will be complied
against such files and then wrapped by python code.
HTH.
--
deelan, #1 fan of adriana lima!
http://www.deelan.com/
--
http://mail.python.org/mailman/listinfo/python-list
console, there
should be some mention on innodb support somewhere.
2) version of mysqldb you are using
bye.
--
deelan, #1 fan of adriana lima!
http://www.deelan.com/
--
http://mail.python.org/mailman/listinfo/python-list
: command 'gcc' failed with exit status 1
you need mysql-devel package installed to compile the _mysql extension.
just look a the release notes:
https://sourceforge.net/project/shownotes.php?group_id=22307release_id=303257
HTH.
--
deelan, #1 fan of adriana lima!
http://www.deelan.com/
--
http
names.
HTH.
--
deelan http://www.deelan.com/
--
http://mail.python.org/mailman/listinfo/python-list
', 'replace')
'?'
using replace will not throw an error, but it will replace
the offending characther with a question mark.
HTH.
--
deelan http://www.deelan.com/
--
http://mail.python.org/mailman/listinfo/python-list
.
--
@prefix foaf: http://xmlns.com/foaf/0.1/ .
#me a foaf:Person ; foaf:nick deelan ;
foaf:weblog http://blog.deelan.com/ .
--
http://mail.python.org/mailman/listinfo/python-list
img src=BAZ.jpg
see:
http://cheetahtemplate.org/
--
@prefix foaf: http://xmlns.com/foaf/0.1/ .
#me a foaf:Person ; foaf:nick deelan ;
foaf:weblog http://blog.deelan.com/ .
--
http://mail.python.org/mailman/listinfo/python-list
objects will always be encoded to
the connection's character set regardless of this setting.''
--
@prefix foaf: http://xmlns.com/foaf/0.1/ .
#me a foaf:Person ; foaf:nick deelan ;
foaf:weblog http://blog.deelan.com/ .
--
http://mail.python.org/mailman/listinfo/python-list
', 'latin-1')
then feed u to the hammer function (the fix_unicode at the
end).
HTH,
deelan
--
Però è bello sapere che, di questi tempi spietati, almeno
un mistero sopravvive: l'età di Afef Jnifen. -- dagospia.com
--
http://mail.python.org/mailman/listinfo/python-list
'tuple'
if there's no ambiguity you can omit the parens:
t = '1',
type(t)
type 'tuple'
HTH,
deelan
--
@prefix foaf: http://xmlns.com/foaf/0.1/ .
#me a foaf:Person ; foaf:nick deelan ;
foaf:weblog http://blog.deelan.com/ .
--
http://mail.python.org/mailman/listinfo/python-list
() and rollback() methods for this).
hope this helps,
deelan.
--
Però è bello sapere che, di questi tempi spietati, almeno
un mistero sopravvive: l'età di Afef Jnifen. -- dagospia.com
--
http://mail.python.org/mailman/listinfo/python-list
deelan wrote:
which version of MySQLdb are you running? versions
1.1.6 and below gained a connection.autocommit) method set by default
ehm, 1.1.6 and *above*, of course. :)
--
Però è bello sapere che, di questi tempi spietati, almeno
un mistero sopravvive: l'età di Afef Jnifen. -- dagospia.com
Gary Nutbeam wrote:
(...)
Does anyone know of something similar to Rails or Maypole in Python?
you may want to take a look at subway:
http://subway.python-hosting.com/
it glues together cherrypy2, sqlobject
and cheetah using an MVC approach.
HTH,
deelan.
--
http://mail.python.org/mailman/listinfo
(B
(Bthe line:
(B
(Bfeed = property(__get_feed) # I wrote this
(B
(Bmakes "feed" a *readonly* attribute.
(B
(Bcheers,
(Bdeelan.
(B
(B--
(B@prefix foaf: http://xmlns.com/foaf/0.1/ .
(B#me a foaf:Person ; foaf:nick "deelan" ;
(Bfoaf:weblog http://blo
input and output encoding.
cheers,
deelan.
[1] http://dealmeida.net/en/Projects/PyTextile/
--
@prefix foaf: http://xmlns.com/foaf/0.1/ .
#me a foaf:Person ; foaf:nick deelan ;
foaf:weblog http://blog.deelan.com/ .
--
http://mail.python.org/mailman/listinfo/python-list
compiled mysqldb against 5.0
client libs?
you may want to post on the mysqldb forum of ask
for help there:
http://sourceforge.net/forum/forum.php?forum_id=70461
HTH,
deelan
--
@prefix foaf: http://xmlns.com/foaf/0.1/ .
#me a foaf:Person ; foaf:nick deelan ;
foaf:weblog http://blog.deelan.com/ .
--
http
typical newbie errors:
http://www.ferg.org/projects/python_gotchas.html
HTH,
deelan
--
Vedrai come ti tratteranno le mie TV
Berlusconi a Follini (Luglio 2004)
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
I have a variable that I want to make global across all modules, i.e. I
want it added to the builtin namespace. Is there a way to do this?
i would not pollute built-ins namespace.
how about:
### a.py
FOO = I'm a global foo!
### b.py
import a
print a.FOO
HTH,
deelan
[EMAIL PROTECTED] wrote:
(...)
Run it and get a name error, which, makes sense.
If I try to use the standard import solution as deelan suggests I have
a circular reference on the imports and I get an error that it can't
import class DataSource (presumbably because it hasn't gotten far
enough
only be
determined if you know how many times it has already been called)
see python gotchas:
http://www.ferg.org/projects/python_gotchas.html#bct_sec_5
bye.
--
@prefix foaf: http://xmlns.com/foaf/0.1/ .
#me a foaf:Person ; foaf:nick deelan ;
foaf:weblog http://www.netspyke.com/ .
--
http
.
--
@prefix foaf: http://xmlns.com/foaf/0.1/ .
#me a foaf:Person ; foaf:nick deelan ;
foaf:weblog http://www.netspyke.com/ .
--
http://mail.python.org/mailman/listinfo/python-list
36 matches
Mail list logo