Re: Simple Matrix class

2007-01-25 Thread Paul McGuire
On Jan 24, 3:18 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Ill-conditioned matrices. You should grab a copy of _Matrix Computations_ by > Gene H. Golub and Charles F. Van Loan. > > For example, try the Hilbert matrix n=6. > > H_ij = 1 / (i + j - 1) > Sure enough, this gets ugly at n=6. Thanks

Re: ANN: Dejavu 1.5.0RC1

2007-01-25 Thread fumanchu
On Jan 24, 9:39 pm, "Michele Simionato" <[EMAIL PROTECTED]> wrote: > On Jan 24, 11:57 pm, "Robert Brewer" <[EMAIL PROTECTED]> wrote: > > The Dejavu Object-Relational Mapper (version 1.5.0RC1) is now available > > and in the public domain. Get it at http://projects.amor.org/dejavu, > > or from PyPI:

Re: Fast Imaging for Webserver

2007-01-25 Thread Paul McGuire
On Jan 25, 12:46 am, "Prateek" <[EMAIL PROTECTED]> wrote: > Concurrency Level: 1 > Time taken for tests: 18.664 seconds > Complete requests: 1000 > Failed requests:0 > Broken pipe errors: 0 > Total transferred: 1468 bytes > HTML transferred: 14417000 bytes >

Do I need Python to run Blender correctly?

2007-01-25 Thread AKA gray asphalt
I downloaded Blender but there was no link for python. Am I on the right track? -- http://mail.python.org/mailman/listinfo/python-list

Re: logging module and doctest

2007-01-25 Thread Peter Otten
Gary Jefferson wrote: > I've written a logging.filter and would like to use doctest on it > (using a StreamHandler for stdout), but this doesn't seem possible. > Output from the logger seems to disappear (running the doctest strings > through the interpreter as-is yields expected results). I assu

Re: Python does not play well with others

2007-01-25 Thread BJörn Lindqvist
On 1/24/07, Harry George <[EMAIL PROTECTED]> wrote: > Python - it just works. Same scripts run on every platform. Bindings > available to every C/C++/FORTRAN library I've needed so far. Often > the bindings are not complete, but oddly enough the binding developers > have chosen to do just the fu

Re: Getting to an SSH account over a HTTP proxy

2007-01-25 Thread BJörn Lindqvist
On 22 Jan 2007 17:16:35 -0800, Nanjundi <[EMAIL PROTECTED]> wrote: > BJörn Lindqvist wrote: > > I want to use Python to connect to a SSH account over a HTTP proxy to > > automate some operations. I thought paramiko would be able to do that, > > but it can not (it seems). > > > > Is there some other

Re: Python does not play well with others

2007-01-25 Thread Steve Holden
Kay Schluehr wrote: > On 25 Jan., 04:46, "Paul Boddie" <[EMAIL PROTECTED]> wrote: > >>> That's because, in those worlds, either the >>> development team for the language or the development team >>> for the subsystem takes responsibility for making them work. >>> Only Python doesn't do that.And t

Re: Getting to an SSH account over a HTTP proxy

2007-01-25 Thread BJörn Lindqvist
On 1/22/07, Yu-Xi Lim <[EMAIL PROTECTED]> wrote: > He's referring to the HTTP CONNECT method, which can tunnel arbitrary > TCP connections, not just HTTP. The IETF draft for this is titled > "Tunneling TCP based protocols through Web proxy servers". > > AFAIK, there are no Python modules which supp

Re: raise UnicodeError, "label too long"

2007-01-25 Thread Flavio
Guys, I am sorry I wrote these messages very late at night. Naturally what came before the dot is the language defining two letter string that is usual of wikipedia urls. Something in my code is obviously gobbling that up. Thanks for pointing that out and my apologies again for not seeing this o

Re: The reliability of python threads

2007-01-25 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "Paddy" <[EMAIL PROTECTED]> writes: |> |> Three to four months before `strange errors`? I'd spend some time |> correlating logs; not just for your program, but for everything running |> on the server. Then I'd expect to cut my losses and arrange to safely |> re-sta

Re: Subclassing cElementTree.XMLTreeBuilder

2007-01-25 Thread Fredrik Lundh
"mukappa" wrote: > Is it possible to subclass cElementTree.XMLTreeBuilder? no, it's a factory function. if you need to extend it, you'll have to wrap it. but I'm not sure I see the use case; what is it you're trying to do here? -- http://mail.python.org/mailman/listinfo/python-list

pdb in python2.5

2007-01-25 Thread Rotem
Hi, Maybe I'm repeating a previous post (please correct me if I am). I've tried the following code in python 2.5 (r25:51908, Oct 6 2006, 15:22:41) example: from __future__ import with_statement import threading def f(): l = threading.Lock() with l: print "hello" raise E

Re: Fast Imaging for Webserver

2007-01-25 Thread half . italian
On Jan 24, 10:46 pm, "Prateek" <[EMAIL PROTECTED]> wrote: > Hi. I'm creating a web-application using CherryPy 2.2.1. My application > needs to process images (JPG/PNG files) to > > 1) create thumbnails (resize them) > 2) overlay them on a custom background (a simple frame) > 3) Overlay 'badges' (s

Re: Fast Imaging for Webserver

2007-01-25 Thread bearophileHUGS
Paul McGuire: > before you start replacing PIL, or > optimizing CherryPy, or other possible performance-improving efforts, > you should profile the within-request processing, find the bottleneck, > and take care of that first. Good advice. Among the tests, the OP can also try to change the antiali

Re: newbie question:connecting to a database

2007-01-25 Thread kavitha thankaian
Hi, I could solve the problem in connecting to a database,,, while configuring the daatsourcename by default it gets connected to the master table,,,so there i must specify the database which i like to connect,,,so now i can see the animals table in my database,, Thanks Eugene,,,

Re: How can i do this in Python?

2007-01-25 Thread bearophileHUGS
Gabriel Genellina: > import operator,fileinput > mapper = map(operator.itemgetter, [0,1,20,21,2,10,12,14,11,4,5,6]) > for line in fileinput.input(): > fields = line.split() > print '\t'.join(m(fields) for m in mapper) I'm just curious, what's the advantage of using itemgetter there compa

Re: Static variables

2007-01-25 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Bruno Desthuilliers: >> And this let you share state between functions: >> >> def make_counter(start_at=0, step=1): >>count = [start_at] >>def inc(): >> count[0] += step >> return count[0] >>def reset(): >> count[0] = [start_at] >> retur

Re: Fast Imaging for Webserver

2007-01-25 Thread Fredrik Lundh
"Prateek" wrote: > Hi. I'm creating a web-application using CherryPy 2.2.1. My application > needs to process images (JPG/PNG files) to > > 1) create thumbnails (resize them) > 2) overlay them on a custom background (a simple frame) > 3) Overlay 'badges' (small 16x16 images) on top of the final th

str and __setitem__

2007-01-25 Thread Tor Erik Soenvisen
Hi, What do I need to do to make the code below work as expected: class str2(str): def __setitem__(self, i, y): assert type(y) is str assert type(i) is int assert i < len(self) self = self[:i] + y + self[1+i:] a = str2('1

While loop with "or"? Please help!

2007-01-25 Thread wd . jonsson
Hmm, my while loop with "or" doesn't seem to work as I want it to... How do I tell the while loop to only accept "Y" or "y" or "N" or "n" input from the str(raw_input)? Thank's in advance! Snippet of code: import os def buildfinder(): os.system("CLS") GameRoot = os.getenv("GAME_ROOT") +

Re: While loop with "or"? Please help!

2007-01-25 Thread Ravi Teja
> while usrinp != "y" or "Y" or "N" or "n": PROBLEM Correct way: while usrinp != "y" or usrinp != "Y" or usrinp != "N" or usrinp != "n": There has to be a boolean evaluation on both sides of or. Or in this case: while usrinp not in ['Y', 'y', 'N', 'n']: Ravi Teja. -- http://mail.p

Re: str and __setitem__

2007-01-25 Thread Peter Otten
Tor Erik Soenvisen wrote: > What do I need to do to make the code below work as expected: > > class str2(str): > > def __setitem__(self, i, y): > assert type(y) is str > assert type(i) is int > assert i < len(self) > > self

Re: Do I need Python to run Blender correctly?

2007-01-25 Thread gatti
On Jan 25, 9:25 am, "AKA gray asphalt" <[EMAIL PROTECTED]> wrote: > I downloaded Blender but there was no link for python. Am I on the right > track? Don't worry, Blender includes its own bundled Python interpreter, which is usually one version behind; just leave it alone. Lorenzo Gatti -- http

Re: Rendering text question (context is MSWin UI Automation)

2007-01-25 Thread Boris Borcic
Chris Mellon wrote: > On 1/24/07, Boris Borcic <[EMAIL PROTECTED]> wrote: >> Chris Mellon wrote: >>> Using either win32 or wxPython you will be able to produce bitmaps >>> directly, without needing to create a visible window. >>> >>> >>> Some quick & dirty wxPython code >>> >>> def getTextBitmap(te

Re: module email

2007-01-25 Thread Sergey Dorofeev
"Rob Wolfe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> p2=email.message.Message() >> p2.set_type("message/rfc822") >> p2.set_payload(m) > > Payload is a _list_ of Message objects (is_multipart() == True) > or a _string_ object (is_multipart() == False) but never just Message

Re: str and __setitem__

2007-01-25 Thread Steven D'Aprano
On Thu, 25 Jan 2007 10:16:31 +, Tor Erik Soenvisen wrote: > Hi, > > What do I need to do to make the code below work as expected: Use another language *wink* Python strings are immutable, you can't change them in place. > class str2(str): > > def __setitem__(self, i, y): >

Re: Python does not play well with others

2007-01-25 Thread Ben Sizer
On Jan 24, 1:50 am, John Nagle <[EMAIL PROTECTED]> wrote: > In the Perl, Java, PHP, and C/C++ worlds, the equivalent > functions just work. That's because, in those worlds, either the > development team for the language or the development team > for the subsystem takes responsibility for making t

Re: str and __setitem__

2007-01-25 Thread bearophileHUGS
Peter Otten: > >>> class mutable_str(object):... def __init__(self, value): > ... self._value = value > ... def __setitem__(self, index, value): > ... self._value = self._value[:index] + value + > self._value[index+1:] > ... def __str__(self): > ... r

Re: logging module and doctest

2007-01-25 Thread Peter Otten
Peter Otten wrote: > Gary Jefferson wrote: > >> I've written a logging.filter and would like to use doctest on it >> (using a StreamHandler for stdout), but this doesn't seem possible. >> Output from the logger seems to disappear (running the doctest strings >> through the interpreter as-is yield

Re: Do I need Python to run Blender correctly?

2007-01-25 Thread [EMAIL PROTECTED]
On Jan 25, 5:47 pm, [EMAIL PROTECTED] wrote: > On Jan 25, 9:25 am, "AKA gray asphalt" <[EMAIL PROTECTED]> > wrote: > > > I downloaded Blender but there was no link for python. Am I on the right > > track? > Don't worry, Blender includes its own bundled Python interpreter, which > is usually one v

MIME text attachment question

2007-01-25 Thread Neal Becker
I want to send a file (plain text) as an attachment. I'm using MIMEText. This attaches text OK, but I would like to have a filename attached to it, so that the recipient could save it without having to specify a filename. Any suggestions? -- http://mail.python.org/mailman/listinfo/python-list

Re: free variables /cell objects question

2007-01-25 Thread gangesmaster
no, it has nothing to do with "i" being global. >>> tuple(lambda: i for i in range(10))[0]() 9 >>> tuple(lambda: i for i in range(10))[1]() 9 what i see as a bug is this code not working as expected: >>> def make_foos(names): ... funcs = [] ... for n in names: ... def foo():

Re: My Tkinter Threading nightmare

2007-01-25 Thread half . italian
On Jan 24, 7:35 pm, Paul Rubin wrote: > Paul Rubin writes: > > def idle(self): > > # read and execute any commands waiting on the queue > > while True: > > try: > >func, args, kw = self.cmd_qu

Re: Python does not play well with others

2007-01-25 Thread Paul Boddie
On 25 Jan, 12:01, "Ben Sizer" <[EMAIL PROTECTED]> wrote: > > Python is quite capable in many areas, such that the people in the > community with the expertise to extend the language and libraries, are > usually the ones who've been happily using the polished features for > years and have found they

Re: free variables /cell objects question

2007-01-25 Thread Paul Rubin
"gangesmaster" <[EMAIL PROTECTED]> writes: > what i see as a bug is this code not working as expected: > > >>> def make_foos(names): > ... funcs = [] > ... for n in names: > ... def foo(): > ... print "my name is", n > ... funcs.append(foo) > ...

Re: While loop with "or"? Please help!

2007-01-25 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hmm, my while loop with "or" doesn't seem to work as I want it to... > How do I tell the while loop to only accept "Y" or "y" or "N" or "n" > input from the str(raw_input)? > > Thank's in advance! > > Snippet of code: > > import os > > def buildfinder(): > os.s

Re: My Tkinter Threading nightmare

2007-01-25 Thread Paul Rubin
[EMAIL PROTECTED] writes: > > try: > > func, args, kw = self.cmd_queue.get(block=False) > > except QueueEmpty: > > return > > func (*args, **kw) > > Thanks Paul. That has made more sense than all of my scrounging > combined,

Re: While loop with "or"? Please help!

2007-01-25 Thread Paul Rubin
[EMAIL PROTECTED] writes: > while usrinp != "y" or "Y" or "N" or "n": PROBLEM while userinp not in 'yYnN': ... Or maybe more generally: while userinp.lower() not in 'yn':# case independent test ... -- http://mail.python.org/mailman/listinfo/python-list

Re: Subclassing cElementTree.XMLTreeBuilder

2007-01-25 Thread mukappa
On Jan 25, 4:32 am, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > "mukappa" wrote: > > Is it possible to subclass cElementTree.XMLTreeBuilder?no, it's a factory > > function. if you need to extend it, you'll have to wrap it. but > I'm not sure I see the use case; what is it you're trying to do he

Re: While loop with "or"? Please help!

2007-01-25 Thread Peter Otten
Bruno Desthuilliers wrote: > and simplified again thanks to Python 'in' operator: > while not usrinp.lower() in "yn": But note that 'in' performs a substring search and therefore "yn" and "" would be accepted as valid answers, too. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: While loop with "or"? Please help!

2007-01-25 Thread Bruno Desthuilliers
Peter Otten a écrit : > Bruno Desthuilliers wrote: > >> and simplified again thanks to Python 'in' operator: >> while not usrinp.lower() in "yn": > > But note that 'in' performs a substring search and therefore "yn" and "" > would be accepted as valid answers, too. Mmm, right. Thanks for the cor

Re: While loop with "or"? Please help!

2007-01-25 Thread Tim Williams
On 25/01/07, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Peter Otten a écrit : > > Bruno Desthuilliers wrote: > > > >> and simplified again thanks to Python 'in' operator: > >> while not usrinp.lower() in "yn": > > > > But note that 'in' performs a substring search and therefore "yn" and "" >

Re: While loop with "or"? Please help!

2007-01-25 Thread Paul Rubin
Peter Otten <[EMAIL PROTECTED]> writes: > > while not usrinp.lower() in "yn": > > But note that 'in' performs a substring search and therefore "yn" and "" > would be accepted as valid answers, too. Oh right, that's a recent change to the language, I think. OK: while not usrinp.lower() in list

Re: module email

2007-01-25 Thread Rob Wolfe
Sergey Dorofeev wrote: > "Rob Wolfe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > >> p2=email.message.Message() > >> p2.set_type("message/rfc822") > >> p2.set_payload(m) > > > > Payload is a _list_ of Message objects (is_multipart() == True) > > or a _string_ object (is_multipar

Re: pdb in python2.5

2007-01-25 Thread R. Bernstein
"Rotem" <[EMAIL PROTECTED]> writes: > Hi, > > Maybe I'm repeating a previous post (please correct me if I am). > > I've tried the following code in python 2.5 (r25:51908, Oct 6 2006, > 15:22:41) > example: > > from __future__ import with_statement > import threading > > def f(): > l = thr

Re: While loop with "or"? Please help!

2007-01-25 Thread [EMAIL PROTECTED]
On Jan 25, 11:26 am, [EMAIL PROTECTED] wrote: > Hmm, my while loop with "or" doesn't seem to work as I want it to... > How do I tell the while loop to only accept "Y" or "y" or "N" or "n" > input from the str(raw_input)? > > Thank's in advance! > > Snippet of code: > > import os > > def buildfind

Re: Rendering text question (context is MSWin UI Automation)

2007-01-25 Thread Chris Mellon
On 1/25/07, Boris Borcic <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > > On 1/24/07, Boris Borcic <[EMAIL PROTECTED]> wrote: > >> Chris Mellon wrote: > >>> Using either win32 or wxPython you will be able to produce bitmaps > >>> directly, without needing to create a visible window. > >>> > >>>

how to unistall a Python package?

2007-01-25 Thread siggi
Hi all, installing a package with 'setup.py' is easy. But how do I uninstall the package, once I want to get rid of it again? Thanks, siggi -- http://mail.python.org/mailman/listinfo/python-list

Re: Python does not play well with others

2007-01-25 Thread skip
Paul> We all know that the Python language has issues (or "warts" Paul> as they are popularly called), although some of the most notable Paul> ones don't seem to have been addressed as yet in the plans for Paul> Python 3000 (eg. default argument evaluation), but some of the

Please have a look at this class

2007-01-25 Thread antred
Hello everyone, While working on a program I encountered a situation where I'd construct a largish data structure (a tree) from parsing a host of files and would end up having to throw away parts of my newly built tree if a file turned out to contain invalid data. My first thought was 'Well, you c

Re: free variables /cell objects question

2007-01-25 Thread Steven D'Aprano
On Thu, 25 Jan 2007 04:29:35 -0800, Paul Rubin wrote: > "gangesmaster" <[EMAIL PROTECTED]> writes: >> what i see as a bug is this code not working as expected: >> >> >>> def make_foos(names): >> ... funcs = [] >> ... for n in names: >> ... def foo(): >> ...

Re: how to unistall a Python package?

2007-01-25 Thread martin . laloux
you delete it from lib -- http://mail.python.org/mailman/listinfo/python-list

Re: Please have a look at this class

2007-01-25 Thread Neil Cerutti
On 2007-01-25, antred <[EMAIL PROTECTED]> wrote: > While working on a program I encountered a situation where I'd > construct a largish data structure (a tree) from parsing a host > of files and would end up having to throw away parts of my > newly built tree if a file turned out to contain invalid

Python email parser

2007-01-25 Thread mneagul
Hello, I want to use email.Parser for parsing some email messages but I have a small problem: it is very, very slow... For 110MB of email messages it takes ~29-30 seconds for parsing. Do you know some other email parser for python? Marian Neagul -- http://mail.python.org/mailman/listinfo/p

Re: Python email parser

2007-01-25 Thread antred
Hmm, I'm not sure whether I'd call 30 secs for 110 MB particularly slow. I mean that *IS* a lot of data. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to unistall a Python package?

2007-01-25 Thread Wang Shuhao
Third party packages are put into $PYTHONHOME\Lib\site-packages after been installed, so to uninstall them, just go there and delete the directory contains all files of your package. - Original Message - From: "siggi" <[EMAIL PROTECTED]> Newsgroups: comp.lang.python To: Sent: Thursday

Re: My Tkinter Threading nightmare

2007-01-25 Thread Aahz
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > > self.progressWindow.protocol('WM_DELETE_WINDOW', self.callback) > >becomes > > gui.cmd_queue.put(self.progressWindow.protocol, > ('WM_DELETE_WINDOW', self.callback)) > >where gui is the Window

Re: Please have a look at this class

2007-01-25 Thread Bruno Desthuilliers
antred a écrit : > Hello everyone, > > While working on a program I encountered a situation where I'd > construct a largish data structure (a tree) from parsing a host of > files and would end up having to throw away parts of my newly built > tree if a file turned out to contain invalid data. My f

Re: While loop with "or"? Please help!

2007-01-25 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > > On Jan 25, 11:26 am, [EMAIL PROTECTED] wrote: (snip) >> #Runs the buildfinder function >> usrinp = buildfinder() >> >> def buildwhiler(): >> >> while usrinp != "y" or "Y" or "N" or "n": PROBLEM >> print "Enter Y or N!" >> usr = str(raw_in

Re: Please have a look at this class

2007-01-25 Thread Steven D'Aprano
On Thu, 25 Jan 2007 06:38:28 -0800, antred wrote: > Hello everyone, > > While working on a program I encountered a situation where I'd > construct a largish data structure (a tree) from parsing a host of > files and would end up having to throw away parts of my newly built > tree if a file turned

Re: wxPython: panel not fully painted

2007-01-25 Thread Morpheus
On Wed, 24 Jan 2007 13:35:51 -0800, citronelu wrote: > Hi, > > I'm new to wxpython, and the following code is my first serious > attempt: > > > #~ start code > import wx > > class MyPanel(wx.Panel): > def __init__(self, parent, id): > wx.Panel.__init__(self, parent, id) > s

Re: smtplib starttls gmail example - comments?

2007-01-25 Thread py
Excellent imput! I learned - no need for trailing . and i was doing it wrong anyway. - all those extra trys were redundant. - the trailing comma functionality in print. - the extra ehlo is an rfc req. Thanks all. -dave -- http://mail.python.org/mailman/listinfo/python-list

Re: match nested parenthesis

2007-01-25 Thread arn . zart
[EMAIL PROTECTED] wrote: > hi > i wish to find an reg exp for matching nested parenthesis of varying > level like > string = > "somewords1(words(somewords2)-(some(some)words3)somestuff)somestuff" > and be able to evaluate the pair starting from the inner most(the > deepest level) , ie (some) > up

Two dimensional lists

2007-01-25 Thread gonzlobo
I might get an answer since I didn't call them arrays. :^) Ok, I have 2 lists that I need to process individually, then merge them into a 2x list and fill with data. arinc429 = ['ab', '2b', '0b', '21', 'c1', '61', '11', 'db', '9b', '5b', 'eb', '6b', '1b', '6e', '3e'] iPIDs = [300, 301, 3

Re: sqlite user-defined functions & unicode issue

2007-01-25 Thread Gerhard Häring
Ben Wolfson wrote: I've got a db some of whose elements have been created automatically from filesystem data (whose encoding is iso-8859-1). If I try to select one of those elements using a standard SQL construct, things work fine: [...] How can I get around this? I really want to be able to s

Re: ANN: Dejavu 1.5.0RC1

2007-01-25 Thread Michele Cella
On 25 Gen, 09:02, "fumanchu" <[EMAIL PROTECTED]> wrote: > > > I am curious ... how this compare to SQLAlchemy?The comparisons could be > > endless ;) but here are some of the larger > differences: > > 1. Dejavu uses generic "storage" concepts and syntax, while SQLAlchemy > prefers database concep

Re: Do I need Python to run Blender correctly?

2007-01-25 Thread John Nagle
AKA gray asphalt wrote: > I downloaded Blender but there was no link for python. Am I on the right > track? Blender doesn't require Python, but if you have Python, you can write plug-ins for Blender. Get "The Blender Book"; otherwise you'll never figure Blender out.

Re: Two dimensional lists

2007-01-25 Thread Laszlo Nagy
> # shouldn't I be able to fill the lists simply by pointing to a location? > > matrix[a_idx, p_idx] = 0x219 # and so on? > Lists are not matrices. For example: L = [ [1,2,3], ['a','b','c'], 10 ] print L[1][2] # Prints 'c', you will like this syntax but... print L[2][5] # TypeError: 10 is not

Re: Using Timing function problem.....

2007-01-25 Thread Jona
Thanks so much! that did it! you can tell I'm new with python.. lol... thanks again.. Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: free variables /cell objects question

2007-01-25 Thread gangesmaster
[Steven] > My solution is, don't try to have one function do too much. Making a list > of foos should be a separate operation from making a single foo: that's exactly what my second example does (as well as my production code) [Paul] > But it does work as expected, if your expectations are based

assertions to validate function parameters

2007-01-25 Thread Matthew Wilson
Lately, I've been writing functions like this: def f(a, b): assert a in [1, 2, 3] assert b in [4, 5, 6] The point is that I'm checking the type and the values of the parameters. I'm curious how this does or doesn't fit into python's duck-typing philosophy. I find that when I detect inv

asyncore.dispatcher.handle_read

2007-01-25 Thread Indy
Greetings. I am writing an asynchronous server, and I use the standard library's module asyncore. I subclass asyncore.dispatcher. handle_accept works just right, that is, when a client socket makes a request to connect to my server socket, things that I set in handle_accept definition, happen. So,

Re: Python does not play well with others

2007-01-25 Thread John Nagle
Paul Boddie wrote: > On 25 Jan, 12:01, "Ben Sizer" <[EMAIL PROTECTED]> wrote: > >> I think that is why many of the SIGs are stagnant, why the standard library >> has so much fluff yet still lacks in key areas such as multimedia and web >> development, etc. > ... I think this is also a good insight

Re: Two dimensional lists

2007-01-25 Thread Peter Otten
gonzlobo wrote: > I might get an answer since I didn't call them arrays. :^) > > Ok, I have 2 lists that I need to process individually, then merge > them into a 2x list and fill with data. > > arinc429 = ['ab', '2b', '0b', '21', 'c1', '61', '11', 'db', '9b', '5b', > 'eb', > '6b', '1b',

Re: assertions to validate function parameters

2007-01-25 Thread George Sakkis
On Jan 25, 11:54 am, Matthew Wilson <[EMAIL PROTECTED]> wrote: > Lately, I've been writing functions like this: > > def f(a, b): > > assert a in [1, 2, 3] > assert b in [4, 5, 6] > > The point is that I'm checking the type and the values of the > parameters. > > I'm curious how this does o

running applications in python

2007-01-25 Thread lee
how can i run or open a windows application from the python prompt?for e.g.mediaplayer opening,folder acess etc -- http://mail.python.org/mailman/listinfo/python-list

Re: Python does not play well with others

2007-01-25 Thread Paul Rubin
John Nagle <[EMAIL PROTECTED]> writes: > My main concern is with glue code to major packages. The connections > to OpenSSL, MySQL, and Apache (i.e. mod_python) all exist, but have major > weaknesses. If you're doing web applications, those are standard pieces > which need to work right. Ther

Re: Python does not play well with others

2007-01-25 Thread skip
John> My main concern is with glue code to major packages. The John> connections to OpenSSL, MySQL, and Apache (i.e. mod_python) all John> exist, but have major weaknesses. I have no SSL experience or direct mod_python experience (I do use Myghty effectively), but I have used MySQLdb

Re: Two dimensional lists

2007-01-25 Thread Travis Oliphant
Laszlo Nagy wrote: >># shouldn't I be able to fill the lists simply by pointing to a location? >> >>matrix[a_idx, p_idx] = 0x219 # and so on? >> > > Lists are not matrices. For example: > > L = [ [1,2,3], ['a','b','c'], 10 ] > print L[1][2] # Prints 'c', you will like this syntax but... > prin

Re: running applications in python

2007-01-25 Thread Jordan
os.system, os.spawn, the process module, os.popen[1,2,3,4], this is a pretty basic thing, not trying to be mean, but you should look in the python docs, this is definitely in there. Also, the subprocess module is meant to replace all of those but i haven't looked too closely at it yet, so the foll

Re: Email attachments

2007-01-25 Thread Facundo Batista
Steve Holden wrote: > I'm having some trouble getting attachments right for all recipients, > and it seems like Apple's mail.app is the pickiest client at the moment. > It doesn't handle attachments that both Thunderbird and Outlook find > perfectly acceptable. The following code works ok with

Re: asyncore.dispatcher.handle_read

2007-01-25 Thread Jordan
That was not entirely helpful, it's way more likely a mistake you made in subclassing dispatcher than a problem within asycore itself (that ended up sounding a lot more mean/angry than intended, sorry ¬_¬ ), you really need to show us what changes you made to asyncore.dispatcher if you want help.

Re: ANN: Dejavu 1.5.0RC1

2007-01-25 Thread olive
Looks interesting... Do you consider a StorageManagers for Oracle ? Olive. On Jan 24, 11:57 pm, "Robert Brewer" <[EMAIL PROTECTED]> wrote: > The Dejavu Object-Relational Mapper (version 1.5.0RC1) is now available > and in the public domain. Get it athttp://projects.amor.org/dejavu, > or from PyP

Re: Thoughts on using isinstance

2007-01-25 Thread Matthew Woodcraft
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Matthew Woodcraft a écrit : >> Adding the validation code can make your code more readable, in that >> it can be clearer to the readers what kind of values are being >> handled. > This is better expressed in the docstring. And if it's in the > doc

Re: Rendering text question (context is MSWin UI Automation)

2007-01-25 Thread Boris Borcic
Chris Mellon wrote: > On 1/25/07, Boris Borcic <[EMAIL PROTECTED]> wrote: >> Chris Mellon wrote: > > Some quick & dirty wxPython code > > def getTextBitmap(text, font, fgcolor, bgcolor): > dc = wx.MemoryDC() > dc.SetFont(font) > width, height= dc.GetTextExte

RE: Overloading assignment operator

2007-01-25 Thread Carroll, Barry
> -Original Message- > From: Gabriel Genellina [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 23, 2007 9:24 PM > To: python-list@python.org > Subject: Re: Overloading assignment operator > > "Carroll, Barry" <[EMAIL PROTECTED]> escribió en el mensaje > news:[EMAIL PROTECTED] > > > * .

Re: While loop with "or"? Please help!

2007-01-25 Thread Daniel
2007-01-25 11:26:09 [EMAIL PROTECTED] wrote in message <[EMAIL PROTECTED]> > Hmm, my while loop with "or" doesn't seem to work as I want it to... > How do I tell the while loop to only accept "Y" or "y" or "N" or "n" > input from the str(raw_input)? > > Thank's in advance! > > Snippet of code:

Module for SVG?

2007-01-25 Thread Sebastian Bassi
Hello, I found http://www2.sfk.nl/svg as a Python module for writing SVG. Last update was in 2004 and I am not sure if there is something better. Any recommendation for generating SVG graphics? Best, SB. -- http://mail.python.org/mailman/listinfo/python-list

Re: Rendering text question (context is MSWin UI Automation)

2007-01-25 Thread Chris Mellon
On 1/25/07, Boris Borcic <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > > On 1/25/07, Boris Borcic <[EMAIL PROTECTED]> wrote: > >> Chris Mellon wrote: > > > > > Some quick & dirty wxPython code > > > > def getTextBitmap(text, font, fgcolor, bgcolor): > > dc = wx.MemoryDC

Re: The reliability of python threads

2007-01-25 Thread Paddy
On Jan 25, 9:26 am, [EMAIL PROTECTED] (Nick Maclaren) wrote: > In article <[EMAIL PROTECTED]>,"Paddy" <[EMAIL PROTECTED]> writes:|> > |> Three to four months before `strange errors`? I'd spend some time > |> correlating logs; not just for your program, but for everything running > |> on the serve

Re: The reliability of python threads

2007-01-25 Thread Carl J. Van Arsdall
Aahz wrote: > [snip] > > My response is that you're asking the wrong questions here. Our database > server locked up hard Sunday morning, and we still have no idea why (the > machine itself, not just the database app). I think it's more important > to focus on whether you have done all that is re

Re: Do I need Python to run Blender correctly?

2007-01-25 Thread Boris Borcic
[EMAIL PROTECTED] wrote: > Also note that only standard modules bundled in the Blender package are > available. And extension modules e.g. numpy can't be installed into it. Not my experience, I've installed and used numpy (or was it Numeric ?) with Blender Python a couple years ago. YMMV, Bori

Possible bug in Python 2.5? (Was Re: pdb in python2.5)

2007-01-25 Thread R. Bernstein
I'd like to change my assessment of whether the problem encountered is a pdb bug or not. It could be a bug in Python. (Right now it is only known to be a bug in version 2.5.) For a given traceback t, the question is whether t.tb_frame.f_lineno can ever be different from t.tb_lineno. Still, for no

Re: The reliability of python threads

2007-01-25 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "Paddy" <[EMAIL PROTECTED]> writes: |> |> > |> Three to four months before `strange errors`? I'd spend some time |> > |> correlating logs; not just for your program, but for everything running |> > |> on the server. Then I'd expect to cut my losses and arrange to s

Re: Module for SVG?

2007-01-25 Thread Boris . Boutillier
Depending on the size of your project, the xist library from living logic is supporting svg xml: http://www.livinglogic.de/Python/xist/ http://www.livinglogic.de/Python/xist/ns/svg/ We've used it successfully, but later on came back to simply use the standard dom creation tools in python to reduce

Re: The reliability of python threads

2007-01-25 Thread Paddy
On Jan 25, 7:36 pm, [EMAIL PROTECTED] (Nick Maclaren) wrote: > In article <[EMAIL PROTECTED]>,"Paddy" <[EMAIL PROTECTED]> writes:|> > |> > |> Three to four months before `strange errors`? I'd spend some time > |> > |> correlating logs; not just for your program, but for everything > running > |>

Re: Python does not play well with others

2007-01-25 Thread [EMAIL PROTECTED]
On Jan 25, 12:17 pm, John Nagle <[EMAIL PROTECTED]> wrote: > My main concern is with glue code to major packages. The connections > to OpenSSL, MySQL, and Apache (i.e. mod_python) all exist, but have major > weaknesses. If you're doing web applications, those are standard pieces > which need

Re: The reliability of python threads

2007-01-25 Thread Paul Rubin
"Paddy" <[EMAIL PROTECTED]> writes: > No, you should think of the service that needs to be up. You seem to be > talking about how it can't be fixed rather than looking for ways to > keep things going. But you're proposing cargo cult programming. There is no reason whatsoever to expect that restar

Re: Python does not play well with others

2007-01-25 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I haven't had a need to do anything with OpenSSL from Python; all > that takes place in the Apache server That's a reasonable approach for a typical server-side web application, but there are other types of Python apps that can also want to use SS

  1   2   >