Re: Getting a class name

2007-02-17 Thread deelan
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. --

Re: subway

2007-01-31 Thread deelan
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

Re: subway

2007-01-31 Thread deelan
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

Re: locale, format monetary values

2006-04-17 Thread deelan
(%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

Re: mod_python

2005-10-11 Thread deelan
): 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

Re: Python, Mysql, insert NULL

2005-10-05 Thread deelan
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

Re: 'ascii' codec can't encode character u'\u2013'

2005-09-30 Thread deelan
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

Re: Code for generating validation codes (in images)

2005-09-04 Thread Giuseppe di Sabato (aka deelan)
/ later, deelan. -- deelan, #1 fan of adriana lima! http://www.deelan.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert float to string ...

2005-08-23 Thread deelan
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

Re: MySQL help

2005-08-01 Thread deelan
-- deelan, #1 fan of adriana lima! http://www.deelan.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: namespaces

2005-07-31 Thread deelan
, deelan. -- deelan, #1 fan of adriana lima! http://www.deelan.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: namespaces

2005-07-31 Thread deelan
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

Re: tuple to string?

2005-07-22 Thread deelan
))) 'spam' HTH, deelan. -- deelan, #1 fan of adriana lima! http://www.deelan.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get/set class attributes in Python

2005-06-12 Thread deelan
) 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

Re: case/switch statement?

2005-06-11 Thread deelan
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

Re: MySQLDBAPI

2005-06-10 Thread deelan
. 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

Re: about accessing mysql

2005-06-10 Thread deelan
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

Re: MySQLDBAPI

2005-06-09 Thread deelan
: 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

Re: MoinMoin WikiName and python regexes

2005-06-08 Thread deelan
names. HTH. -- deelan http://www.deelan.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble Encoding

2005-06-07 Thread deelan
', '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

Re: something like CPAN, PPMs?

2005-06-01 Thread 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

Re: Design problem, call function from HTML?

2005-05-30 Thread deelan
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

Re: MySQLdb and Unicode

2005-05-20 Thread deelan
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

Re: problems with  character

2005-03-22 Thread deelan
', '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

Re: Why tuple with one item is no tuple

2005-03-15 Thread deelan
'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

Re: Can't seem to insert rows into a MySQL table

2005-03-12 Thread deelan
() 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

Re: Can't seem to insert rows into a MySQL table

2005-03-12 Thread deelan
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

Re: Ruby on Rails or Perl's Maypole..is there a Python equivalent

2005-03-03 Thread deelan
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

Re: what is wrong?

2005-02-24 Thread deelan
(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

Re: display VARCHAR(mysql) and special chars in html

2005-02-23 Thread deelan
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

Re: Problem in importing MySQLdb

2005-01-20 Thread deelan
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

Re: File Handling Problems Python I/O

2005-01-06 Thread deelan
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

Re: Newbie namespace question

2004-12-22 Thread deelan
[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

Re: Newbie namespace question

2004-12-22 Thread 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

Re: Keyword arguments - strange behaviour?

2004-12-21 Thread deelan
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

Re: Persistent objects

2004-12-13 Thread deelan
. -- @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