Re: genetic algorithms package for python ?

2006-09-01 Thread placid
Thomas Samson wrote: > Xiao Jianfeng <[EMAIL PROTECTED]> writes: > > > Hi all, > > > > I am looking for a genetic algorithms package for Python. > > > > I have googled the web before posting and found some links. The link > > of pygene(http://www.freenet.org.nz/python/pygene) cannot be opened. >

pysqlite - simple problem

2006-09-01 Thread rdrink
I am just getting into pysqlite (with a fair amount of Python and MySQL experience behind me) and have coded a simple test case to try to get the hang of things... yet have run into a 'stock simple' problem... I can create a database 'test.db', add a table 'foo' (which BTW I repeatedly DROP on eac

ANN: GMPY binaries for Windows 2.5

2006-09-01 Thread casevh
GMPY binaries for Python 2.5 are available at http://home.comcast.net/~casevh/ Notes They have not been extensively tested. This is based on the CVS version of gmpy and includes a patch (not yet in CVS) from Alex Martelli that resolves a bug with divm(). Please consider this an "unofficial"

Re: Tkinter listbox question

2006-09-01 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> Wrote: | Hi, | I need help about Tkinter listbox widget.I want,when somebody click on | any item(file) in Listbox,then in new Label widget text must be | selected item from server. | | my program (wrong example): | | import ftputil | import Tkinter | root=Tkinter.Tk() | f

Re: HTTPS Login

2006-09-01 Thread Gerold Penz
Tom Grove schrieb: > I am trying to login to a secure website and I am having some difficulty > understanding the process. Hi Tom! This code should do what you want: http://www.python-forum.de/post-18148.html#18148 Regards, Gerold :-) -- ___

Re: pysqlite - simple problem

2006-09-01 Thread Gerold Penz
rdrink schrieb: > num = 200 > cur.execute("INSERT INTO foo (id) VALUES (?)", num) Hi! ``num`` must be an iterable object (tuple, list, ...). num = (200,) cur.execute("INSERT INTO foo (id) VALUES (?)", num) Regards, Gerold :-) -- __

Re: pysqlite - simple problem

2006-09-01 Thread Fredrik Lundh
"rdrink" <[EMAIL PROTECTED]> wrote: >I am just getting into pysqlite (with a fair amount of Python and MySQL > experience behind me) and have coded a simple test case to try to get > the hang of things... > > yet have run into a 'stock simple' problem... what does import sqlite print sql

Re: pysqlite - simple problem

2006-09-01 Thread John Machin
rdrink wrote: > I am just getting into pysqlite (with a fair amount of Python and MySQL > experience behind me) and have coded a simple test case to try to get > the hang of things... > yet have run into a 'stock simple' problem... > > I can create a database 'test.db', add a table 'foo' (which BTW

Re: AttributeError: 'Attributes' object has no attribute 'saveFile'

2006-09-01 Thread crystalattice
[EMAIL PROTECTED] wrote: > Hi > > Sounds like you've got a wizard-type interface thing happening. > I haven't used wxGlade but I have done similar things in GTK several > times. > > Try putting all the windows in a notebook widget with hidden tabs. > Put the 'Next Page' button and the filename out

Re: Subclassing Tkinter Buttons

2006-09-01 Thread Rob Wolfe
Bob Greschke wrote: > I don't use classes much (mainly because I'm stupid), but I'd like to make a > subclass of the regular Tkinter Button widget that simply adds spaces to the > passed "text=" when the program is running on Windows (Linux, Solaris, Mac > add a little space between the button tex

Re: Timeline for Python?

2006-09-01 Thread crystalattice
I'd write for 2.4, even though 2.5 should be coming out "shortly". There aren't many significant changes to the whole language between 2.4 and 2.5. Probably the best thing is write for 2.4 and have a sidenote stating where 2.5 operates differently. The Python 3 timeline is almost a moving target

Parsing form input in a BaseHTTPServer

2006-09-01 Thread Ron Garret
I'm write a web server using BaseHTTPServer. It can't be a CGI because it has to do some weird server-push stuff as database updates come in. But I still need to process form inputs as if it were a CGI. But the cgi module only works in a CGI environment. Is there something with the equivale

Re: Python style: to check or not to check args and data members

2006-09-01 Thread Joel Hedlund
> Short answer: Use Traits. Don't invent your own mini-Traits. Thanks for a quick and informative answer! I'll be sure to read up on the subject. (And also: thanks Bruno for your contributions!) > Types are very frequently exactly the wrong thing you want to check for. I see what you mean. Al

Re: re.compile() doesn't work under Windows?

2006-09-01 Thread ddtl
Thanks everybody for pointing out the problem. And indeed, the script was named differently on Linux. ddtl. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: GMPY binaries for Windows 2.5

2006-09-01 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, casevh wrote: Interesting subject line. I think I still have a set of "Win 3.11 for workgroups" disks lying around somewhere, but where do I get Windows 2.5? ;-) SCNR, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: pysqlite - simple problem

2006-09-01 Thread Fredrik Lundh
John Machin wrote: >> So this has to be something stupidly simple... but for the life of me I >> can't see it. > > With the '?' paramstyle, the 2nd arg to cursor.execute() should be a > *sequence* (typically a tuple) of the values that you are inserting. > > Tty this: > cur.execute("INSERT INTO foo

Re: GC and security

2006-09-01 Thread Fredrik Lundh
Dennis Lee Bieber wrote: > This is after they'd made an 11x14 enlargement of the "stolen" > print, cleaned it up with a marker, reduced to life size, and etched > onto printed circuit board to form a mold for making a latex "skin". > Which, BTW, also fooled the lock. http://www.diva-portal.or

Re: Python style: to check or not to check args and data members

2006-09-01 Thread Joel Hedlund
Bruno >> Your email address seem to be wrong. I tried to reply to you directly in order to avoid thread bloat but my mail bounced. Thanks for the quick reply though. I've skimmed through some docs on your suggestions and I'll be sure to read up on them properly later. But as I said to Robert Ke

a new object definition

2006-09-01 Thread Sylvain Ferriol
hello everybody, i want to talk with you about a question i have in mind and i do not find a answer. it 's simple: why do we not have a beatiful syntax for object definition as we have for class definition ? we can define a class in python in 2 ways: 1. by using the metaclass constructor my

Re: pysqlite - simple problem

2006-09-01 Thread John Machin
Fredrik Lundh wrote: > John Machin wrote: > >> So this has to be something stupidly simple... but for the life of me I > >> can't see it. > > > > With the '?' paramstyle, the 2nd arg to cursor.execute() should be a > > *sequence* (typically a tuple) of the values that you are inserting. > > > > Tt

Classes referencing each other

2006-09-01 Thread Manuel Bleichner
Hello list, I have searched for some time now, but no result... I'm having the following problem: In a module I have a huge number of classes of the form: class A(object): connected_to = [B, C] class B(object) connected_to = [C] class C(object) connected_to = [A] As you s

Re: SQLObject or SQLAlchemy?

2006-09-01 Thread Bruno Desthuilliers
Jorge Vargas wrote: > On 8/31/06, John Salerno <[EMAIL PROTECTED]> wrote: >> Are there any major differences between these two? It seems they can >> both be used with TurboGears, and SQLAlchemy with Django. I'm just >> wondering what everyone's preference is, and why, and if there are even >> more

Strange string encoding behaviour with pymssql

2006-09-01 Thread Fabrizio Cornelli
Hello,  I'm using pymssql to extract data from a legacy table with a non-ascii encoded name. The strange thing is that I can make my query from the idle's console, but it doesn't work from python. (I'm working in a windows environment) The error shows that there's a problem related to the encoding,

Re: a new object definition

2006-09-01 Thread Michele Simionato
Sylvain Ferriol wrote: > hello everybody, > > i want to talk with you about a question i have in mind and i do not > find a answer. it 's simple: > why do we not have a beatiful syntax for object definition as we have > for class definition ? See http://www.python.org/dev/peps/pep-0359 (already r

Re: Pros/Cons of Turbogears/Rails?

2006-09-01 Thread Paul Boddie
fuzzylollipop wrote: > Paul Boddie wrote: > > > > In various open source circles, the mere usage of 1.0 may indicate some > > kind of stability, but not necessarily maturity, or at least the desire > > of the developers to persuade users that the code is ready for them to > > use. > > nope in GENER

Re: a new object definition

2006-09-01 Thread Bruno Desthuilliers
Sylvain Ferriol wrote: > hello everybody, > > i want to talk with you about a question i have in mind and i do not > find a answer. it 's simple: > why do we not have a beatiful syntax for object definition as we have > for class definition ? Python's classes are objects too - instances of their

Re: Classes referencing each other

2006-09-01 Thread Duncan Booth
"Manuel Bleichner" <[EMAIL PROTECTED]> wrote: > If anyone of you knows a neat way to solve this, I'd be > very grateful. You could use a function: class A(object): @staticmethod def connected_to(): return [B, C] class B(object) @staticmethod def connected_to(): return [C] c

Re: Broadcast server

2006-09-01 Thread swell
Yes but before going deeper ( too deep ) i would like to play with a toy python example. Basically what i want to study first is a socket or socket+select server and 5 clients that get time updated from the server. Don't really know how to keep hot connections without blocking the server ? If some

Re: Python style: to check or not to check args and data members

2006-09-01 Thread Bruno Desthuilliers
Joel Hedlund wrote: >> Short answer: Use Traits. Don't invent your own mini-Traits. > > Thanks for a quick and informative answer! I'll be sure to read up on > the subject. (And also: thanks Bruno for your contributions!) > >> Types are very frequently exactly the wrong thing you want to check fo

Jython: PyException toString() is empty

2006-09-01 Thread axel
Hello, I have the problem to get informations about script errors. And I have found that I get a PySyntaxError if the script is wrong and if I use for instance an unknown name I get PyException. But I don't get any information, not even a string. How can I get detailed informations about the error

Re: Python style: to check or not to check args and data members

2006-09-01 Thread Bruno Desthuilliers
Joel Hedlund wrote: > Bruno >> Your email address seem to be wrong. let's say "disguised" !-) > I tried to reply to you > directly in order to avoid thread bloat but my mail bounced. I don't think it's a good idea anyway - this thread is on topic here and may be of interest to others too IMHO

Re: python loops

2006-09-01 Thread stdazi
`range' is especially useful for iterating over long sequences ;-) for i in range(0,100) : OverflowError: range() result has too many items Sybren Stuvel wrote: > [EMAIL PROTECTED] enlightened us with: > > I thought the xrange was preferred? for x in xrange(length): > > True. I

Re: Classes referencing each other

2006-09-01 Thread Georg Brandl
Manuel Bleichner wrote: > Hello list, > > I have searched for some time now, but no result... > I'm having the following problem: > > In a module I have a huge number of classes of the form: > > class A(object): >connected_to = [B, C] > > > class B(object) >connected_to = [C] >

Re: Python style: to check or not to check args and data members

2006-09-01 Thread Joel Hedlund
> And while we're at it : please avoid top-posting. Yes, that was sloppy. Sorry. /Joel -- http://mail.python.org/mailman/listinfo/python-list

Re: Classes referencing each other

2006-09-01 Thread Manuel Bleichner
Thanks for your answer :) > You could use a function: > > class A(object): >@staticmethod >def connected_to(): return [B, C] > I already thought about such a solution, but since my code has to be compatible with python 2.3, i would have to use the connected_to = staticmethod(connected

Re: python loops

2006-09-01 Thread bearophileHUGS
Kay Schluehr: > I hate ii ;) It's not nice looking, I agree. A more explicit name is often better. But I think ii is better than i because you can find it in the code (with the Find command of the editor or grep) more easily than i. Bye, bearophile -- http://mail.python.org/mailman/listinfo/py

Re: Classes referencing each other

2006-09-01 Thread Manuel Bleichner
Thanks for the answer. > You could move all connections to a central location after the > class definitions, such as > > class A: pass > class B: pass > class C: pass > > connections = {A: (B, C), B: (C,), C: (A,)} I think I simplified my classes a bit too much :) Actually there are multiple typ

Re: python loops

2006-09-01 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I thought the xrange was preferred? for x in xrange(length): preferred by premature optimization freaks, perhaps. in practice, if the range is reasonably small and you're going to loop over all the integers, it doesn't really matter. (the range form creates a list an

Re: Classes referencing each other

2006-09-01 Thread John Machin
Manuel Bleichner wrote: > Hello list, > > I have searched for some time now, but no result... > I'm having the following problem: > > In a module I have a huge number of classes of the form: > > class A(object): >connected_to = [B, C] > > > class B(object) >connected_to = [C] > > >

Re: raw audio in windows

2006-09-01 Thread Ben Sizer
Putty wrote: > Hi. I've written a small python script that was primarily meant for > use in a unix-compatible environment. It writes a bunch of raw audio > to a file and then sends the file to /dev/audio and the system plays > the audio. Very simple. > > Is there a simple way I could edit the sc

Re: raw audio in windows

2006-09-01 Thread Fredrik Lundh
Ben Sizer wrote: > Not really. You'll have to convert it to .wav and then pass it to a > helper app. > > >>> import winsound >>> help(winsound) Help on module winsound: NAME winsound FILE c:\python24\dlls

Re: Python style: to check or not to check args and data members

2006-09-01 Thread Joel Hedlund
> I'm not sure that trying to fight against the language is a sound > approach, whatever the language. That's the very reason I posted in the first place. I feel like I'm fighting the language, and since python at least to me seems to be so well thought out in all other aspects, the most obviou

Adding sender name to email

2006-09-01 Thread gillespie . amanda
How do I add a Sender name to the emails sent by the following script: def createhtmlmail (html, text, subject): """Create a mime-message that will render HTML in popular MUAs, text in better ones""" import MimeWriter import mimetools import cStringIO

Jython: single step / pause / debug ...

2006-09-01 Thread axel
Hello, I want to integrate Jython into my java application. But I want to control the script execution. How can be realized this? I have used TraceFunction and the script stops alway in traceCall(). But (1) I have never seen what I have to return there, (2) only this function is called - also if t

Question about ftplib

2006-09-01 Thread alper soyler
I am trying to get '.pep' files from the ftp.genome.jp/pub/kegg/genomes/??? directories (???=directory names) with the below script. However, after downloading 121 files (I have to download 300 more), it gave me the time out error message:Traceback (most recent call last):  File "ftp1.0.py", line 1

Re: a new object definition

2006-09-01 Thread Sylvain Ferriol
Michele Simionato a écrit : > Sylvain Ferriol wrote: > >>hello everybody, >> >>i want to talk with you about a question i have in mind and i do not >>find a answer. it 's simple: >>why do we not have a beatiful syntax for object definition as we have >>for class definition ? > > > See http://www

Re: Classes referencing each other

2006-09-01 Thread Manuel Bleichner
Hi, thanks for your answer, too :) Your solution won't do it, because of reasons I explained in the answer to Georg Brandl. > BTW, care to tell us what the connections mean? Applications of > connected instances of the one class are of course very common, but 50 > classes connected in a cyclic fa

Threads and Progress Bar

2006-09-01 Thread Ritesh Raj Sarraf
Hi, I have a small application, written in Python, that uses threads. The application uses function foo() to download files from the web. As it reads data from the web server, it runs a progress bar by calling an install of a progress bar class. When using threads, I get the problem that the prog

Re: Adding sender name to email

2006-09-01 Thread Tim Williams
On 1 Sep 2006 03:26:12 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > How do I add a Sender name to the emails sent by the following script: > > > writer = MimeWriter.MimeWriter(out) > # set up some basic headers... we put subject here > # because smtplib.sendmail ex

Django website

2006-09-01 Thread Antal Rutz
hi, is there something wrong with django's website (djangoproject.com) or I have problems? It looks ugly, the css files can't be found, I even cannot download the source from there. Do you know anything about them? Any mirror I can get the tarball from? Thanks -- --arutz -- http://mail.pytho

Re: Adding sender name to email

2006-09-01 Thread Tim Williams
On 01/09/06, Tim Williams <[EMAIL PROTECTED]> wrote: > On 1 Sep 2006 03:26:12 -0700, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote: > > How do I add a Sender name to the emails sent by the following script: > > > add the line > > writer.addheader("From", a_sender_address) > > and you should also ha

Re: Django website

2006-09-01 Thread Richie Hindle
[Antal] > is there something wrong with django's website (djangoproject.com) > or I have problems? > It looks ugly, the css files can't be found, I even cannot download > the source from there. It's broken for me too, so it's not a problem at your end. -- Richie Hindle [EMAIL PROTECTED] -- htt

Re: Pros/Cons of Turbogears/Rails?

2006-09-01 Thread paron
[EMAIL PROTECTED] wrote: > I was initially leaning towards Rails due to maturity, > but the most recent version of TurboGears seem to have > fixed a lot of the "ad hoc" feeling I got from previous > versions. But I'm still very much up in the air. > > Thanks, > Ken I've found that familiarity wi

Re: a new object definition

2006-09-01 Thread Michele Simionato
Sylvain Ferriol wrote: > Michele Simionato a écrit : > > > > See http://www.python.org/dev/peps/pep-0359 (already rejected by > > Guido). > > > i do not understand the withdrawal note, what do "different level" mean ? > do you have an example or is it python core implemantation problem ? I asked

Re: Python style: to check or not to check args and data members

2006-09-01 Thread Bruno Desthuilliers
Joel Hedlund wrote: >> I'm not sure that trying to fight against the language is a sound >> approach, whatever the language. > > That's the very reason I posted in the first place. I feel like I'm > fighting the language, and since python at least to me seems to be so > well thought out in all ot

Re: Django website

2006-09-01 Thread Bruno Desthuilliers
Antal Rutz wrote: > hi, > > is there something wrong with django's website (djangoproject.com) Obviously, yes. > or I have problems? I don't think so. I warned them on the google group, I think things should be fixed soon. -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1]

Question about import and namespace

2006-09-01 Thread jdemoor
Hi, I'm new to Python and have the following problem : I have an application started by a main.py file, which does a ' from module_1 import * '. main.py is responsible from the creation of an object which is then used in module_1. What is the best way to make that object visible in the module_1 na

Re: Question about import and namespace

2006-09-01 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, jdemoor wrote: > I have an application started by a main.py file, which does a ' from > module_1 import * '. > main.py is responsible from the creation of an object which is then > used in module_1. > What is the best way to make that object visible in the module_1 > namesp

Re: Question about import and namespace

2006-09-01 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I'm new to Python and have the following problem : > I have an application started by a main.py file, which does a ' from > module_1 import * '. > main.py is responsible from the creation of an object which is then > used in module_1. > What is the best way to make that

dictionaries - returning a key from a value

2006-09-01 Thread Michael Malinowski
Appologies if this is a somewhat simple question, but currently I can return a value from a dictionary using its key by doing :    dDictionary.get( key )   However, I am curious to know if its possible to get the key from giving a value (basically the opposite of what I did above, inste

How to make an announcement (was Re: ANN: GMPY binaries for Windows 2.5)

2006-09-01 Thread beliavsky
[EMAIL PROTECTED] wrote: > GMPY binaries for Python 2.5 are available at > http://home.comcast.net/~casevh/ "The General Multiprecision PYthon project (GMPY) focuses on Python-usable modules providing multiprecision arithmetic functionality to Python programmers." A sign of Python's health is tha

Re: introspection

2006-09-01 Thread rick
Fredrik Lundh wrote: > brad tilley wrote: > >> How do I import a module and then ask it to show me its methods or >> other aspects about itself during execution? I'd like to do something >> such as this: >> >> import win32api > > dir(win32api) > help(win32api) > > and also > > import inspect

Re: dictionaries - returning a key from a value

2006-09-01 Thread Avell Diroll
Michael Malinowski wrote: (snip) > However, I am curious to know if its possible to get the key from giving > a value (basically the opposite of what I did above, instead of getting > a value from a key, I want the key from a value). Is there a way of > doing this? Or would I need to cycle all the

Help with autotools

2006-09-01 Thread Jonh Wendell
Hi all! I need help with autotools stuff.. My directory structure: project_name src main.py others.py data ui.glade images.png po translations.po I'd like to do something like that: The files in "src" should be installed at: $prefix/lib/project_name The files in "data"

Re: Egg problem (~/.python-eggs)

2006-09-01 Thread paul kölle
Mike Orr wrote: [... snipp ...] > Can I make it use a different eggs directory? Any other idea how to > install a program using eggs on a server? I had a similar issue with tracd on gentoo. My solution was setting PYTHON_EGG_CACHE=/tmp/.egg_cache in /etc/conf.d/tracd and exporting that var in /e

ANN: GMPY binaries for Python 2.5

2006-09-01 Thread casevh
Marc 'BlackJack' Rintsch wrote: > Interesting subject line. I think I still have a set of "Win 3.11 for > workgroups" disks lying around somewhere, but where do I get Windows 2.5? ;-) > > SCNR, > Marc 'BlackJack' Rintsch I've changed the subject line to read "Python 2.5" instead of "Window

Re: a new object definition

2006-09-01 Thread Sylvain Ferriol
Michele Simionato a écrit : > Sylvain Ferriol wrote: > >>Michele Simionato a écrit : >> >>>See http://www.python.org/dev/peps/pep-0359 (already rejected by >>>Guido). >>> >> >>i do not understand the withdrawal note, what do "different level" mean ? >>do you have an example or is it python core i

OO on python real life tutorial?

2006-09-01 Thread filippo
Hello, I coded my +10k lines app using Perl/Tk. It is something like a hotel software manager, it has a bunch of windows to manage the arrivals, bills etc etc. I want to port this on Python/WxPython but I'd like to get benefit of python, not just doing a row by row raw porting. My problem is that

Re: Question about import and namespace

2006-09-01 Thread jdemoor
Thanks for the replies. > You can do both > > from module import * > import module > > as these kinds of import are not mutually exclusive. Would this run the code in 'module' twice, or just make the objects in it accessible by several names ? -- http://mail.python.org/mailman/listinfo/python-l

Re: OO on python real life tutorial?

2006-09-01 Thread Fredrik Lundh
"filippo" wrote: > I coded my +10k lines app using Perl/Tk. It is something like a hotel > software manager, it has a bunch of windows to manage the arrivals, > bills etc etc. I want to port this on Python/WxPython but I'd like to > get benefit of python, not just doing a row by row raw porting. >

Re: Question about import and namespace

2006-09-01 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Thanks for the replies. > >> You can do both >> >> from module import * >> import module >> >> as these kinds of import are not mutually exclusive. > > Would this run the code in 'module' twice, or just make the objects in > it accessible by several names ? The latter

Re: Question about import and namespace

2006-09-01 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, jdemoor wrote: >> from module import * >> import module >> >> as these kinds of import are not mutually exclusive. > > Would this run the code in 'module' twice, or just make the objects in > it accessible by several names ? The code at module level is only executed at fi

Re: dictionaries - returning a key from a value

2006-09-01 Thread bearophileHUGS
Avell Diroll: keys = [key for key in sampledict if sampledict[key] == '1974'] Or better, given: sampledict = {'the Holy Grail':1975, 'Life of Brian':1979, 'Party Political Broadcast':1974,'Mr. Neutron':1974, 'Hamlet':1974, 'Light Entertainment War':1974} keys = [key

working with ldap files

2006-09-01 Thread flit
Hello All, I am struggling with some ldap files. I am using the csv module to work with this files (I exported the ldap to a csv file). I have this string on a field CN=pointhairedpeoplethatsux,OU=Groups,OU=Hatepeople,OU=HR,DC=fabrika,DC=com;CN=pointhairedboss,OU=Groups,OU=Hatepeople,OU=HR,DC=fab

Tkinter listbox and ftputil

2006-09-01 Thread vedran_dekovic
Hi, Again I need help about tkinter listbox. example: In listbox must write (imaginary file in server): ['-rw-r--r-- 1 [EMAIL PROTECTED] vedran.byethost12.com 3506 Jun 25 14:40 file.gif'] and then when somebody click on file in listbox,then in new Entry widget must write just filename

Re: dictionaries - returning a key from a value

2006-09-01 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > keys = [key for key in sampledict if sampledict[key] == '1974'] > > Or better, given: > > sampledict = {'the Holy Grail':1975, 'Life of Brian':1979, > 'Party Political Broadcast':1974,'Mr. Neutron':1974, > 'Hamlet':1974, 'Light Entertainment War

Re: dictionaries - returning a key from a value

2006-09-01 Thread bearophileHUGS
Fredrik Lundh: > better in what sense? With better I may mean faster, or needing less memory, or requiring a shorter code, or other things. It depends on many things, related to the program I am creating. Thank you for the timings, you are right, as most times. Sometimes I am wrong, but I try to

Re: Question about import and namespace

2006-09-01 Thread jdemoor
Ok, thanks again. That was helpful. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python style: to check or not to check args and data members

2006-09-01 Thread Joel Hedlund
> I still wait for a > proof that it leads to more robust programs - FWIW, MVHO is that it > usually leads to more complex - hence potentially less robust - code. MVHO? I assume you are not talking about Miami Valley Housing Opportunities here, but bloat probably leads to bugs, yes. > Talking ab

Re: working with ldap files

2006-09-01 Thread Tim Chase
> I have this string on a field > CN=pointhairedpeoplethatsux,OU=Groups,OU=Hatepeople,OU=HR,DC=fabrika,DC=com;CN=pointhairedboss,OU=Groups,OU=Hatepeople,OU=HR,DC=fabrika,DC=com > this string is all the groups one user has membership. > So what I am trying to do. > read this string > and extract onl

Re: working with ldap files (2nd answer)

2006-09-01 Thread Tim Chase
>> I have this string on a field >> CN=pointhairedpeoplethatsux,OU=Groups,OU=Hatepeople,OU=HR,DC=fabrika,DC=com;CN=pointhairedboss,OU=Groups,OU=Hatepeople,OU=HR,DC=fabrika,DC=com >> this string is all the groups one user has membership. >> So what I am trying to do. >> read this string >> and extra

os.name under Win32

2006-09-01 Thread Igor Kravtchenko
Hi! We have an application using Python that is intended to work both under Win32 and Linux. Since some parts of the code need to be different depending whether we are under Win32 or Linux, we use the traditional: if os.name == "posix": some Linux code else: some Win32 code However, we hav

Re: os.name under Win32

2006-09-01 Thread Fredrik Lundh
Igor Kravtchenko wrote: > We have an application using Python that is intended to work both under > Win32 and Linux. > Since some parts of the code need to be different depending whether we > are under Win32 > or Linux, we use the traditional: > > if os.name == "posix": > some Linux code > el

Re: SQLObject or SQLAlchemy?

2006-09-01 Thread lazaridis_com
John Salerno wrote: > Are there any major differences between these two? It seems they can > both be used with TurboGears, and SQLAlchemy with Django. I'm just > wondering what everyone's preference is, and why, and if there are even > more choices for ORM. > > Thanks. You can review the Persit Ca

Re: Duck typing alows true polymorfisim

2006-09-01 Thread Isaac Gouy
The Ghost In The Machine wrote: > In comp.lang.java.advocacy, Tor Iver Wilhelmsen > <[EMAIL PROTECTED]> > wrote > on 31 Aug 2006 18:31:15 +0200 > <[EMAIL PROTECTED]>: > > The Ghost In The Machine <[EMAIL PROTECTED]> writes: > > > >> Also, one language is very conspicuous by its absence: C#. > > >

Re: a new object definition

2006-09-01 Thread Steven Bethard
Sylvain Ferriol wrote: > hello everybody, > > i want to talk with you about a question i have in mind and i do not > find a answer. it 's simple: > why do we not have a beatiful syntax for object definition as we have > for class definition ? > > we can define a class in python in 2 ways: > 1. b

Problem loading true-type font with PIL

2006-09-01 Thread Christian Stapfer
After switching from Python 2.3 to 2.4 (Enought), PIL throws an exception that did not occur formerly (under Python 2.3) when executing ImageFont.truetype(font, size) where font = "C:/Windows/Fonts/comic.TTF". Here is the traceback that results: Traceback (most recent call last): File "Ge

Re: Problem loading true-type font with PIL

2006-09-01 Thread Christian Stapfer
Christian Stapfer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > After switching from Python 2.3 to 2.4 (Enought), ^ I mean: Python Enthought Edition--Python 2.4.3 for Windows, sorry for that. I see in the documentation for PIL that an

Newbie question involving buffered input

2006-09-01 Thread Caolan
I am executing the code below on a Windows XP system and if I enter > 2 characters it buffers the input and the call to sys.stdin.flush does not flush the input, it remains buffered.   What am I doing wrong here?   Thanks,   Caolan       try:    gooberselectX = sys.stdin.read(2)  

Re: Python style: to check or not to check args and data members

2006-09-01 Thread Bruno Desthuilliers
Joel Hedlund wrote: >> I still wait for a >> proof that it leads to more robust programs - FWIW, MVHO is that it >> usually leads to more complex - hence potentially less robust - code. > > MVHO? I assume you are not talking about Miami Valley Housing > Opportunities here, Nope --> My Very Humbl

Re: SQLObject or SQLAlchemy?

2006-09-01 Thread Bruno Desthuilliers
lazaridis_com wrote: > John Salerno wrote: >> Are there any major differences between these two? It seems they can >> both be used with TurboGears, and SQLAlchemy with Django. I'm just >> wondering what everyone's preference is, and why, and if there are even >> more choices for ORM. >> >> Thanks.

Strange import behavior

2006-09-01 Thread unexpected
Hey guys, I'm having problems importing a file into my python app. Everytime I try to define the object specified by this file, i.e, test = Test(), It raises an ImportError exception: ImportError: cannot import name Test. I've declared it as: from test import Test (and I've also tried from tes

Re: Newbie question involving buffered input

2006-09-01 Thread Jean-Paul Calderone
On Fri, 1 Sep 2006 09:31:11 -0700, Caolan <[EMAIL PROTECTED]> wrote: >I am executing the code below on a Windows XP system and if I enter > 2 >characters it buffers the input and the call to sys.stdin.flush does not flush >the input, it remains buffered. You cannot flush input. The flush method

used to work at ungerer lab?

2006-09-01 Thread lind
I am looking for an old friend, used to work at a path lab in Pretoria, dabbled in Scientology and rock climbing? I know this is not friendster.com, but I really have to get into contact with him. Hendrik van Rooyen wrote: > <[EMAIL PROTECTED]> Wrote: > > > | Hi, > | I need help about Tkinter lis

Re: SQLObject or SQLAlchemy?

2006-09-01 Thread lazaridis_com
Ο/Η Bruno Desthuilliers έγραψε: > lazaridis_com wrote: > > John Salerno wrote: > >> Are there any major differences between these two? It seems they can > >> both be used with TurboGears, and SQLAlchemy with Django. I'm just > >> wondering what everyone's preference is, and why, and if there are e

Re: used to work at ungerer lab?

2006-09-01 Thread lind
Yes, and Du Buisson's and a variety of others. Liked spiders and spent time at the WNNR? lind wrote: > I am looking for an old friend, used to work at a path lab in Pretoria, > dabbled in Scientology and rock climbing? I know this is not > friendster.com, but I really have to get into contact with

Re: Strange import behavior

2006-09-01 Thread Fredrik Lundh
unexpected wrote: > I'm having problems importing a file into my python app. Everytime I > try to define the object specified by this file, i.e, > > test = Test(), > > It raises an ImportError exception: ImportError: cannot import name > Test. > > I've declared it as: > > from test import Test

Re: OO on python real life tutorial?

2006-09-01 Thread Claudio Grondi
filippo wrote: > Hello, > > I coded my +10k lines app using Perl/Tk. It is something like a hotel > software manager, it has a bunch of windows to manage the arrivals, > bills etc etc. I want to port this on Python/WxPython but I'd like to > get benefit of python, not just doing a row by row raw p

Re: raw audio in windows

2006-09-01 Thread Jay
I'm afraid I can't do that. Don't take it personally. I would send it to you, but at this time, I'm developing this app with a friend and I don't know his feelings about the program's distribution or licensing. I can't send it around until I speak to him about it. Sorry. spiffy wrote: > On 31

Re: OO on python real life tutorial?

2006-09-01 Thread filippo
thanks Fredrik and Claudio, probably structured coding paradigm is what I need. Claudio, could you explain better your sentence below? Claudio Grondi ha scritto: > Python/Tk for it in order to avoid programming in wxPython if not really > necessary (wxPython has its strengths with growing project

  1   2   >