Re: Timeline for Python?

2006-09-01 Thread Fredrik Lundh
Sebastian Bassi wrote: > Maybe I forgot to tell, but its going to take me at least 6 month to > finish the book I don't think anyone will know exactly how 3.0 will look within 6 months. Not that your publisher may care about that; there are plenty of books out there that describe how the autho

Re: pysqlite - simple problem

2006-09-01 Thread Fredrik Lundh
rdrink wrote: > And yes I should prolly move to pysqlite2, but for now I was able to > fix it this way... > num = 200 > mess = "INSERT INTO foo (id) VALUES (%s)" % num > cur.execute(mess) > > ... don't know why I didn't think of that last (oh wait, Yes I do... > because 'last night' was actually

Re: Incremental Progress Report object/closure?

2006-09-01 Thread Fredrik Lundh
Gabriel Genellina wrote: > What about a simple: > > print "Time elapsed: blah blah blah\r" % whatever, > > (notice the \r and the final , ) to avoid messing up the output when you're leaving the loop, or if something goes wrong inside the loop, it's usually better to *start* with a carriage r

Libraries in python

2006-09-01 Thread eduardo . rosa
Hy people, I'm new in python and comming from JAVA. Something I really like in java is the easy way to add a library to the project. Just put the jar file in the folder ( WEB-INF/lib ) and doesn't need to restart the server ( tomcat ). Can I do some like using python - I'm using apache mod_python

Re: ANN: GMPY binaries for Windows 2.5

2006-09-01 Thread casevh
> > Notes > > > > They have not been extensively tested. > > They don't work. At least the Pentium4 binary doesn't work, > same problem as before. Is the patch installed? I found the problem. Updated binaries should be available in a couple of hours. I'll add a note to the web page. I tested

Re: IndentationError: expected an indented block

2006-09-01 Thread John Machin
[EMAIL PROTECTED] wrote: > Haha. How can I fix this! Haha to you too. Position your cursor at the scene of the crime. Hit the space-bar 4 times. Hit Ctrl-s. Try running it again. If you would prefer a more sensible answer, you might like to ask a more sensible question, which would include a cop

Re: Using eval with substitutions

2006-09-01 Thread Carl Banks
[EMAIL PROTECTED] wrote: > >>> a,b=3,4 > >>> x="a+b" > >>> eval(x) > 7 > >>> y="x+a" > > Now I want to evaluate y by substituting for the evaluated value of x. > eval(y) will try to add "a+b" to 3 and return an error. I could do > this, > >>> eval(y.replace("x",str(eval(x > 10 > > but this beco

Re: simpleparse parsing problem

2006-09-01 Thread Paul McGuire
"David Hirschfield" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Anyone out there use simpleparse? If so, I have a problem that I can't > seem to solve...I need to be able to parse this line: > > """Cen2 = Cen(OUT, "Cep", "ies", wh, 544, (wh/ht));""" > > with this grammar: > > gr

IndentationError: expected an indented block

2006-09-01 Thread casioculture
Haha. How can I fix this! -- http://mail.python.org/mailman/listinfo/python-list

Re: C code in Python

2006-09-01 Thread Robert Kern
Tommy Grav wrote: > I have some numerical code in C that I would like to call from Python. Can > anyone point me in a direction for some text I could read on how to do this? It somewhat depends on the kind of numerical code and the interface it exposes. Do you need to pass arrays back and forth?

Re: Timeline for Python?

2006-09-01 Thread Sebastian Bassi
On 1 Sep 2006 00:57:04 -0700, crystalattice <[EMAIL PROTECTED]> wrote: > 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 wh

Re: disgrating a list

2006-09-01 Thread Simon Forman
jwaixs wrote: > Thank you for all your reply and support. Neil's fits the most to me. I > shrinked it to this function: > > def flatten(x): > for i in range(len(x)): > if isinstance(x[i], list): > x[i:i+1] = x[i] > > Thank you all again. If someone could find even a cuter wa

Re: Using eval with substitutions

2006-09-01 Thread abhishek
Thanks very much for all your suggestions - Peter, Duncan and Frederic. It was a great help. Incidentally the question arose while I was trying to solve the 2-nots problem, http://www.inwap.com/pdp10/hbaker/hakmem/boolean.html#item19 Part of my program takes a set of boolean expressions in 3 vari

simpleparse parsing problem

2006-09-01 Thread David Hirschfield
Anyone out there use simpleparse? If so, I have a problem that I can't seem to solve...I need to be able to parse this line: """Cen2 = Cen(OUT, "Cep", "ies", wh, 544, (wh/ht));""" with this grammar: grammar = r''' declaration := ws, line, (ws, line)*, ws line:= (statement / assignment),

Re: pictures as characters in a Tk text box?

2006-09-01 Thread Simon Forman
Jay wrote: > This may be really obscure, but I had a dream about programming > something like this, so don't blame me. Is it possible to take a small > image or icon and display it as a character in a Tk text box? Think > how Thunderbird displays text smilies as actual smiley icons. Or how > in

Weekly Python Patch/Bug Summary

2006-09-01 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 412 open ( +5) / 3397 closed ( +4) / 3809 total ( +9) Bugs: 900 open (+12) / 6149 closed ( +4) / 7049 total (+16) RFE : 233 open ( +1) / 236 closed ( +0) / 469 total ( +1) New / Reopened Patches __ set liter

Re: pysqlite - simple problem

2006-09-01 Thread rdrink
Thanks everyone! But... RTFM? Ouch. It's not like I don't know what I'm doing :-( ... rather, that I *am* using the older sqlite module > print sqlite.paramstyle = pyformat > print sqlite.version = 1.0.1 which does not support the qmark sytax. (and I fell victim of someone elses tutor

C code in Python

2006-09-01 Thread Tommy Grav
I have some numerical code in C that I would like to call from Python. Cananyone point me in a direction for some text I could read on how to do this?Cheers Tommy[EMAIL PROTECTED]http://homepage.mac.com/tgrav/"Any intelligent fool can make things bigger, more complex, and more violent. It takes a t

Re: disgrating a list

2006-09-01 Thread Gimble
Or, (to add needed recursion to your simple loop): def flatten(x): "Modified in-place flattening" for i in range(len(x)): if isinstance(x[i], list): x[i:i+1] = flatten(x[i]) return x This version modifies in-place (as yours does), which may or may not be what you w

Re: disgrating a list

2006-09-01 Thread George Sakkis
jwaixs wrote: > Thank you for all your reply and support. Neil's fits the most to me. I > shrinked it to this function: > > def flatten(x): > for i in range(len(x)): > if isinstance(x[i], list): > x[i:i+1] = x[i] > > Thank you all again. If someone could find even a cuter w

Re: disgrating a list

2006-09-01 Thread Gimble
> def flatten(x): > for i in range(len(x)): > if isinstance(x[i], list): > x[i:i+1] = x[i] I don't think this does what you want. Try [[[1,2,3]]] as a trivial example. A recursive version, that's not as short as yours: def flatten(x): "Recursive example to flatten a

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

2006-09-01 Thread Joel Hedlund
> Oh, I was just addressing your bit about not knowing unit tests. > Doctests can be quicker to put together and have only a small learning > curve. OK, I see what you mean. And you're right. I'm struggling mightily right now with trying to come up with sane unit tests for a bunch of generalized

Re: ANN: GMPY binaries for Windows 2.5

2006-09-01 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > GMPY binaries for Python 2.5 are available at > http://home.comcast.net/~casevh/ > > Notes > > They have not been extensively tested. They don't work. At least the Pentium4 binary doesn't work, same problem as before. Is the patch installed? Python 2.5c1 (r25c1:51

Re: OO on python real life tutorial?

2006-09-01 Thread Claudio Grondi
filippo wrote: > 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

Re: disgrating a list

2006-09-01 Thread Diez B. Roggisch
jwaixs schrieb: > Diez B. Roggisch wrote: >> Why do you wrap a in a list? Just >> >> c = a + [b] >> >> will do it. > > Yes I know, but the problem is I don't know if 'a' is a list or not. I > could make a type check, but I don't want to program in that way. So you're telling us that if not isins

tp_members and T_ULONGLONG ("C" Python modules)

2006-09-01 Thread Gimble
While writing custom modules, I've found the tp_members type entry very useful. (As background, it is a pointer to a constant structure that defines direct access sizes and types of member variables within your custom PyObject ). However, the defined type enumeration (including T_USHORT, T_UINT,

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

2006-09-01 Thread Paddy
Joel Hedlund wrote: > > You might try doctests, they can be easier to write and fit into the > > unit test framework if needed. > > While I firmly believe in keeping docs up to date, I don't think that > doctests alone can solve the problem of maintaining data integrity in > projects with more com

Re: disgrating a list

2006-09-01 Thread jwaixs
Thank you for all your reply and support. Neil's fits the most to me. I shrinked it to this function: def flatten(x): for i in range(len(x)): if isinstance(x[i], list): x[i:i+1] = x[i] Thank you all again. If someone could find even a cuter way, I'd like to see that way.

pictures as characters in a Tk text box?

2006-09-01 Thread Jay
This may be really obscure, but I had a dream about programming something like this, so don't blame me. Is it possible to take a small image or icon and display it as a character in a Tk text box? Think how Thunderbird displays text smilies as actual smiley icons. Or how in AIM as you type a smi

Re: Python for Windows

2006-09-01 Thread Larry Bates
mistral wrote: > Larry Bates писал(а): > >> mistral wrote: >>> hg писал(а): > Grant Edwards wrote: > >> Will the msi installer modify registry or other system files? >> Does it possible install Python not touching registry and >> system files? You can make your own installe

Re: where or filter on list

2006-09-01 Thread Larry Bates
What I mean is: What if there are two items that are equidistant to what you are searching for? Example: foo = [-5,-1,1,3,5] print closest(0, foo) -1 and 1 are both "equally close" to zero that I'm searching for. This is an edge case that you didn't define an answer to and closest function tha

Re: OO on python real life tutorial?

2006-09-01 Thread filippo
Diez B. Roggisch ha scritto: > I've been doing an online hotel reservation system, btw, and I assure > you: OO was very helpful, even in its crappy PHP incarnation. thanks Diez, I'll keep trying OO paradigm. Probably the advantages will be clearer to me porting to python my app. Best regards, Fi

Re: Syntax suggestion.

2006-09-01 Thread Eirikur Hallgrimsson
>> "if" statement. So i thought that ommiting the parentheses and, why >> not, the commas in such cases will be a sort of beautiful/easier :) >> >> Adiaux >> Samir >> This actually exists. The language which omits punctuation not actually required to resolve ambiguity is called Ruby. Ruby is

Re: Syntax suggestion.

2006-09-01 Thread Simon Forman
samir wrote: > Bonan tagon! > > George Sakkis wrote: > > > It's been done; it's called "IPython": > > http://ipython.scipy.org/doc/manual/manual.html > > Thank you for the link! It's just what I've needed but... > > Roberto Bonvallet wrote : > > > ...so finally you get something that is exactly lik

Re: $HOSTNAME not in os.environ?

2006-09-01 Thread slinkp
Grant Edwards wrote: > On 2006-09-01, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Can anybody explain this one? > > print os.getenv('HOSTNAME') > > None > > > [EMAIL PROTECTED] ~ $ echo $HOSTNAME > > kermit > > Perhaps the HOSTNAME variable isn't exported? Aha. Right you are. Thank

Re: disgrating a list

2006-09-01 Thread Neil Cerutti
On 2006-09-01, Tal Einat <[EMAIL PROTECTED]> wrote: > Tim Chase wrote: >> I'm not sure if '__iter__' is the right thing to be looking >> for, but it seems to work at least for lists, sets, >> dictionarys (via their keys), etc. I would use it because at >> least then you know you can iterate over i

Re: Threads and Progress Bar

2006-09-01 Thread Ritesh Raj Sarraf
Dennis Lee Bieber on Friday 01 Sep 2006 23:04 wrote: > Well... first off -- some minimal code would be of use... > I was scared that people might feel that I'm asking for a ready-made solution. :-) Here's the code. The is the progress bar code. progressbar.py class progressBar: def __init__

Re: Incremental Progress Report object/closure?

2006-09-01 Thread Gabriel Genellina
At Friday 1/9/2006 15:07, Terrence Brannon wrote: 'lo all, I'm looking for something that gives feedback to the screen every X iterations, reporting Time elapsed: 0:00:00 X,XXX,XXX records done. speed /second. [Action Label] What about a simple: print "Time elapsed: blah blah blah\r"

Re: Syntax suggestion.

2006-09-01 Thread samir
Bonan tagon! George Sakkis wrote: > It's been done; it's called "IPython": > http://ipython.scipy.org/doc/manual/manual.html Thank you for the link! It's just what I've needed but... Roberto Bonvallet wrote : > ...so finally you get something that is exactly like any Unix shell, and > complete

Re: os.name under Win32

2006-09-01 Thread Igor Kravtchenko
Hi Fredrik, yes I've checked and I'm sure we don't assign os.name somewhere ourself. I'll replace os.name == "posix" with sys.platform == "win32" as you suggested and see how thing goes. Thanks for your help, Igor. Fredrik Lundh wrote: >Igor Kravtchenko wrote: > > > >>We have an applicatio

Re: $HOSTNAME not in os.environ?

2006-09-01 Thread Grant Edwards
On 2006-09-01, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Can anybody explain this one? print os.getenv('HOSTNAME') > None > [EMAIL PROTECTED] ~ $ echo $HOSTNAME > kermit Perhaps the HOSTNAME variable isn't exported? -- Grant Edwards grante Yow! All

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

2006-09-01 Thread Joel Hedlund
> You might try doctests, they can be easier to write and fit into the > unit test framework if needed. While I firmly believe in keeping docs up to date, I don't think that doctests alone can solve the problem of maintaining data integrity in projects with more comlex interfaces (which is what

Re: disgrating a list

2006-09-01 Thread Neil Cerutti
On 2006-09-01, jwaixs <[EMAIL PROTECTED]> wrote: > Hello, > > How can I disgrate (probably not a good word for it) a list? For > example: > > a = [1,2] > b = 3 > c = [a] + [b] # which makes [[1,2],3] > > Then how can I change c ([[1,2],3]) into [1,2,3]? I have a > simple function for this: You

$HOSTNAME not in os.environ?

2006-09-01 Thread slinkp
Can anybody explain this one? [EMAIL PROTECTED] ~ $ python Python 2.4.3 (#1, Jul 27 2006, 13:07:44) [GCC 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.environ['HOSTNAME'] Traceback (most rece

Re: python loops

2006-09-01 Thread Paddy
Putty wrote: > In C and C++ and Java, the 'for' statement is a shortcut to make very > concise loops. In python, 'for' iterates over elements in a sequence. > Is there a way to do this in python that's more concise than 'while'? > > C: > for(i=0; i > > python: > while i < length: >

RE: Newbie question involving buffered input

2006-09-01 Thread Caolan
Title: Re: Newbie question involving buffered input That makes sense I suppose - why is there a stdin.flush() method then? From: [EMAIL PROTECTED] on behalf of Jean-Paul CalderoneSent: Fri 9/1/2006 9:53 AMTo: python-list@python.orgSubject: Re: Newbie question involving buffered input

Re: disgrating a list

2006-09-01 Thread Tal Einat
Tim Chase wrote: > I'm not sure if '__iter__' is the right thing to be looking for, > but it seems to work at least for lists, sets, dictionarys (via > their keys), etc. I would use it because at least then you know > you can iterate over it AFAIK and as seen throughout posts on c.l.py, the best

Re: Incremental Progress Report object/closure?

2006-09-01 Thread George Sakkis
Terrence Brannon wrote: > 'lo all, I'm looking for something that gives feedback to the screen > every X iterations, reporting > > Time elapsed: 0:00:00 X,XXX,XXX records done. speed /second. > [Action Label] > > > Such a thingy is useful when one is cranking away at million record > flat f

Re: disgrating a list

2006-09-01 Thread Hardcoded Software
Tim Chase wrote: > >>> def flatten(x): > ... q = [] > ... for v in x: > ... if hasattr(v, '__iter__'): > ... q.extend(flatten(v)) > ... else: > ... q.append(v) > ... return q > ... Let's do some nitpicking on "pythonic" s

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

2006-09-01 Thread Paddy
Joel Hedlund wrote: > > Hmmm... So. I should build grimly paranoid parsers for external data, use > duck-typed interfaces everywhere on the inside, and simply callously > disregard developers who are disinclined to read documentation? I could do > that. > > > if you're really serious, unit tests

Re: disgrating a list

2006-09-01 Thread Peter Otten
jwaixs wrote: > > Diez B. Roggisch wrote: >> Why do you wrap a in a list? Just >> >> c = a + [b] >> >> will do it. > > Yes I know, but the problem is I don't know if 'a' is a list or not. I > could make a type check, but I don't want to program in that way. Somewhere in the call chain you have

Re: disgrating a list

2006-09-01 Thread Tim Chase
jwaixs wrote: > Hello, > > How can I disgrate (probably not a good word for it) a list? For > example: > > a = [1,2] > b = 3 > c = [a] + [b] # which makes [[1,2],3] > > Then how can I change c ([[1,2],3]) into [1,2,3]? I have a simple > function for this: > > def fla

Re: disgrating a list

2006-09-01 Thread George Sakkis
jwaixs wrote: > Hello, > > How can I disgrate (probably not a good word for it) a list? For > example: > > a = [1,2] > b = 3 > c = [a] + [b] # which makes [[1,2],3] > > Then how can I change c ([[1,2],3]) into [1,2,3]? I have a simple > function for this: > > def flatt

Incremental Progress Report object/closure?

2006-09-01 Thread Terrence Brannon
'lo all, I'm looking for something that gives feedback to the screen every X iterations, reporting Time elapsed: 0:00:00 X,XXX,XXX records done. speed /second. [Action Label] Such a thingy is useful when one is cranking away at million record flat files and one wants to provide feedback t

Re: a question about ftplib

2006-09-01 Thread Gabriel G
At Friday 1/9/2006 06:32, alper soyler wrote: Thank you very much for your help. The program works however, after downloading 121 '.pep' files, it gave me time out error: Traceback (most recent call last): File "ftp1.0.py", line 18, in ? for filename in ftp.nlst(): ... File "/usr/lib

Re: disgrating a list

2006-09-01 Thread jwaixs
Diez B. Roggisch wrote: > Why do you wrap a in a list? Just > > c = a + [b] > > will do it. Yes I know, but the problem is I don't know if 'a' is a list or not. I could make a type check, but I don't want to program in that way. Noud -- http://mail.python.org/mailman/listinfo/python-list

Re: OO on python real life tutorial?

2006-09-01 Thread Diez B. Roggisch
filippo schrieb: > 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

Re: Strange import behavior

2006-09-01 Thread Peter Otten
unexpected wrote: > 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 t

Re: disgrating a list

2006-09-01 Thread Diez B. Roggisch
jwaixs schrieb: > Hello, > > How can I disgrate (probably not a good word for it) a list? For > example: > > a = [1,2] > b = 3 > c = [a] + [b] # which makes [[1,2],3] Why do you wrap a in a list? Just c = a + [b] will do it. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: OO on python real life tutorial?

2006-09-01 Thread filippo
Fredrik Lundh ha scritto: > How many do you need ? ;-) (snip) thanks Fredrik, I know there are plenty of tutorials and manuals. I know what classes, inheritance and polymorphism are. My problem is that I cannot figure out how they can help me in my practical problem (my software). The only things

disgrating a list

2006-09-01 Thread jwaixs
Hello, How can I disgrate (probably not a good word for it) a list? For example: a = [1,2] b = 3 c = [a] + [b] # which makes [[1,2],3] Then how can I change c ([[1,2],3]) into [1,2,3]? I have a simple function for this: def flatten(l): r = [] s = [l]

Re: raw audio in windows

2006-09-01 Thread Jay
So, are you saying this would be possible to do with the PlaySound function? Fredrik Lundh wrote: > Ben Sizer wrote: > > > Not really. You'll have to convert it to .wav and then pass it to a > > helper app. > > > >

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

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 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: 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: 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: 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

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: 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

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: 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.

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

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: 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

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: 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

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: 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: 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

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: 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

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: 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: 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: 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: 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

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

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

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

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: 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: 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 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

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: 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

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: 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

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: 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

  1   2   >