Re: Picking a license

2010-05-07 Thread Patrick Maupin
On May 7, 6:44 pm, Ben Finney wrote: > Patrick Maupin writes: > > On May 7, 5:33 pm, Ben Finney wrote: > > > Since no-one is forcing anyone to take any of the actions permitted > > > in the license, and since those actions would not otherwise be > > > permitted under copyright law, it's both fal

Re: idiomatic way to collect and report multiple exceptions?

2010-05-07 Thread Ben Cohen
I've condensed the advice from this thread into this. import sys import traceback class ExceptionList(object): def __init__(self, msg, errors=None, *args): self.errortb = errors or [] super(ExceptionList, self).__init__(msg, *args) def __str__(self): """Print a pretty

Re: idiomatic way to collect and report multiple exceptions?

2010-05-07 Thread Ben Cohen
Apologies for the TABs -- I wrote that example for demonstration purposes in my mail client -- I'll copy and paste from a real code editor in the future. Ben On May 7, 2010, at 3:28 PM, Aahz wrote: > In article , > Ben Cohen wrote: >> >> eg -- I'd like to do something like this: >> >> errors

Re: unable to get Hudson to run unit tests

2010-05-07 Thread Stefan Behnel
j vickroy, 07.05.2010 20:44: I apologize if this is not the appropriate forum for a question about Hudson (http://hudson-ci.org/), but I did not know where else to ask and my web searches have not been fruitful. Certainly nice to read something about Hudson in this forum, which is rare enough.

Re: Teaching Programming

2010-05-07 Thread Gregory Ewing
alex23 wrote: This is my biggest issue with Knuth's view of literate programming. If the generated source isn't readable, am I just supposed to trust it? How can I tell if an error lies in my expression of the algorithm or in the code generation itself? Knuth would say that the code generator

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-07 Thread exarkun
On 7 May, 07:25 pm, p.f.mo...@gmail.com wrote: On 7 May 2010 15:36, Giampaolo Rodol� wrote: You can easily avoid this by setting a lower timeout when calling asyncore.loop(), like 1 second or less (for example, Twisted uses 0.001 secs). Thanks, that's what I was considering. This is a good

Re: recursive converting object to string which hasn't __str__ or/and__repr__

2010-05-07 Thread Lie Ryan
On 05/06/10 14:40, Daneel Yaitskov wrote: > Hi, > > > > Everybody knows class's __str__ and __repr__ can be used to get readable > user representation of an object. > > > But for simple classes or debug aims it is tediously to code these > methods. And Python has very powerful reflection. I be

Re: Frustration debugging serial code

2010-05-07 Thread MRAB
William R. Wing (Bill Wing) wrote: On May 7, 2010, at 10:18 PM, MRAB wrote: William R. Wing (Bill Wing) wrote: See comments in-line. On May 7, 2010, at 3:23 PM, MRAB wrote: William R. Wing (Bill Wing) wrote: On May 7, 2010, at 2:08 PM, MRAB wrote: [byte -byte- byte] The X10 controller

Re: is there a functional assert(x==y, 'error msg')

2010-05-07 Thread Vincent Davis
On Fri, May 7, 2010 at 8:38 PM, James Mills wrote: > On Sat, May 8, 2010 at 12:04 PM, Vincent Davis > wrote: > >> Is there a functional assert(x==y, 'error msg') ? >> I can only find the assert that is used like; >> assert x==y, 'error msg' >> > > What about: > > def assertfunc(expr, msg): >a

Re: Frustration debugging serial code

2010-05-07 Thread William R. Wing (Bill Wing)
On May 7, 2010, at 10:18 PM, MRAB wrote: > William R. Wing (Bill Wing) wrote: >> See comments in-line. >> On May 7, 2010, at 3:23 PM, MRAB wrote: >>> William R. Wing (Bill Wing) wrote: On May 7, 2010, at 2:08 PM, MRAB wrote: [byte -byte- byte] > >> The X10 controller not only receives

Re: is there a functional assert(x==y, 'error msg')

2010-05-07 Thread James Mills
On Sat, May 8, 2010 at 12:04 PM, Vincent Davis wrote: > Is there a functional assert(x==y, 'error msg') ? > I can only find the assert that is used like; > assert x==y, 'error msg' > What about: def assertfunc(expr, msg): assert expr, msg cheers James -- http://mail.python.org/mailman/listi

Re: Frustration debugging serial code

2010-05-07 Thread MRAB
William R. Wing (Bill Wing) wrote: See comments in-line. On May 7, 2010, at 3:23 PM, MRAB wrote: William R. Wing (Bill Wing) wrote: On May 7, 2010, at 2:08 PM, MRAB wrote: William R. Wing (Bill Wing) wrote: Hello World - I'm new to both Python and this list, but here's hoping someone can sp

is there a functional assert(x==y, 'error msg')

2010-05-07 Thread Vincent Davis
Is there a functional assert(x==y, 'error msg') ? I can only find the assert that is used like; assert x==y, 'error msg' *Vincent Davis 720-301-3003 * vinc...@vincentdavis.net my blog | LinkedIn -- http://mail.python.org/mailm

Re: ConfigParser.get() defaults?

2010-05-07 Thread Tim Chase
On 05/07/2010 07:56 PM, Steven D'Aprano wrote: On Fri, 07 May 2010 15:05:53 -0500, Tim Chase wrote: With a normal dictionary, I can specify a default fallback value in the event the requested key isn't present: [...] However, with the ConfigParser object, there doesn't seem to be any way to do

Re: Help running Windows programs from Python

2010-05-07 Thread John Yeung
On May 7, 3:14 pm, Scott wrote: > I want to write a script to automate log archiving/compressing on a > Win2003 server. I have Python 2.6 installed. I am planning to use 7- > zip for compression (because I have been using it manually for a while > now). For now all operations will be local in the

Re: Frustration debugging serial code

2010-05-07 Thread William R. Wing (Bill Wing)
On May 7, 2010, at 4:12 PM, J. Cliff Dyer wrote: > On Fri, 2010-05-07 at 15:36 -0400, William R. Wing wrote: > >> >> Maybe I should have been more explicit. The first line in the Python >> file is: >> >> >> #!/usr/bin/env Python (alternatively #!/usr/bin/Python - same results >> either way).

Re: Frustration debugging serial code

2010-05-07 Thread William R. Wing (Bill Wing)
See comments in-line. On May 7, 2010, at 3:23 PM, MRAB wrote: > William R. Wing (Bill Wing) wrote: >> On May 7, 2010, at 2:08 PM, MRAB wrote: >>> William R. Wing (Bill Wing) wrote: Hello World - I'm new to both Python and this list, but here's hoping someone can spot my problem. >

Re: idiomatic way to collect and report multiple exceptions?

2010-05-07 Thread Chris Rebert
> On May 6, 2010, at 10:56 PM, Chris Rebert wrote: >> On Thu, May 6, 2010 at 8:50 PM, Ben Cohen wrote: >>> Is there a pythonic way to collect and display multiple exceptions at the >>> same time? >>> >>> For example let's say you're trying to validate the elements of a list and >>> you'd like to

Re: idiomatic way to collect and report multiple exceptions?

2010-05-07 Thread Steven D'Aprano
On Fri, 07 May 2010 14:28:05 -0700, Aahz wrote: > In article , Ben > Cohen wrote: >> >>eg -- I'd like to do something like this: >> >>errors = [] >>for item in data: >>try: >>process(item) >>except ValidationError as e: >>errors.append(e) >>raise MultipleValidationErrors(

Re: idiomatic way to collect and report multiple exceptions?

2010-05-07 Thread Ben Cohen
Many thanks for the excellent example!! You rock! Ben On May 6, 2010, at 10:56 PM, Chris Rebert wrote: > On Thu, May 6, 2010 at 8:50 PM, Ben Cohen wrote: >> Is there a pythonic way to collect and display multiple exceptions at the >> same time? >> >> For example let's say you're trying to va

Re: ConfigParser.get() defaults?

2010-05-07 Thread Steven D'Aprano
On Fri, 07 May 2010 15:05:53 -0500, Tim Chase wrote: > With a normal dictionary, I can specify a default fallback value in the > event the requested key isn't present: [...] > However, with the ConfigParser object, there doesn't seem to be any way > to do a similar [...] Sounds like a nice featu

Re: Picking a license

2010-05-07 Thread Ben Finney
Patrick Maupin writes: > On May 7, 5:33 pm, Ben Finney wrote: > > Since no-one is forcing anyone to take any of the actions permitted > > in the license, and since those actions would not otherwise be > > permitted under copyright law, it's both false and misleading to > > refer to them as “forc

Re: Picking a license

2010-05-07 Thread Patrick Maupin
On May 7, 5:33 pm, Ben Finney wrote: > Patrick Maupin writes: > > On May 6, 6:56 pm, Ben Finney wrote: > > > Er, no. Anyone who thinks that a copyleft license “forces” anyone to > > > do anything is mistaken about copyright law > > > Perhaps you feel "forces" is too loaded of a word. There is no

Re: Picking a license

2010-05-07 Thread Ben Finney
Patrick Maupin writes: > On May 6, 6:56 pm, Ben Finney wrote: > > Er, no. Anyone who thinks that a copyleft license “forces” anyone to > > do anything is mistaken about copyright law > > Perhaps you feel "forces" is too loaded of a word. There is no > question, however, that a copyright license

Re: Fast Efficient way to transfer an object to another list

2010-05-07 Thread Bryan
Gabriel Genellina wrote: > I'd do that in two steps: > > def transfer_stock(stock_code, old_list, new_list): >    # find the indexes to transfer >    indexes = [i for i,stock in enumerate(old_list) >               if stock.code==stock_code] >    # actually transfer them >    for index in reversed(i

Re: ConfigParser.get() defaults?

2010-05-07 Thread Jon Clements
On 7 May, 21:05, Tim Chase wrote: > With a normal dictionary, I can specify a default fallback value > in the event the requested key isn't present: > >    d = {} >    print d.get(42, 'Some default goes here') > > However, with the ConfigParser object, there doesn't seem to be > any way to do a si

Re: Extract a bordered, skewed rectangle from an image

2010-05-07 Thread David Bolen
"Paul Hemans" writes: > I am wondering whether there are any people here that have experience with > openCV and Python. If so, could you either give me some pointers on how to > approach this, or if you feel so inclined, bid on the project. There are 2 > problems: Can't offer actual services,

Re: idiomatic way to collect and report multiple exceptions?

2010-05-07 Thread Aahz
In article , Ben Cohen wrote: > >eg -- I'd like to do something like this: > >errors = [] >for item in data: >try: >process(item) >except ValidationError as e: >errors.append(e) >raise MultipleValidationErrors(*errors) First of all, please DO NOT post code with TABs in it

Re: List comprehension + lambdas - strange behaviour

2010-05-07 Thread Terry Reedy
On 5/7/2010 8:31 AM, Neil Cerutti wrote: On 2010-05-07, Terry Reedy wrote: On 5/6/2010 3:34 PM, Artur Siekielski wrote: Hello. I found this strange behaviour of lambdas, closures and list comprehensions: funs = [lambda: x for x in range(5)] [f() for f in funs] [4, 4, 4, 4, 4] You succumbe

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-07 Thread Antoine Pitrou
Le Fri, 07 May 2010 21:55:15 +0200, Giampaolo Rodolà a écrit : > Of course, but 30 seconds look a little bit too much to me, also because > (I might be wrong here) I noticed that a smaller timeout seems to result > in better performances. That's probably bogus. > Plus, if scheduled callbacks are

Re: Help running Windows programs from Python

2010-05-07 Thread j vickroy
Scott wrote: I want to write a script to automate log archiving/compressing on a Win2003 server. I have Python 2.6 installed. I am planning to use 7- zip for compression (because I have been using it manually for a while now). For now all operations will be local in the C: drive. As a total begi

Re: Frustration debugging serial code

2010-05-07 Thread J. Cliff Dyer
On Fri, 2010-05-07 at 15:36 -0400, William R. Wing wrote: > > Maybe I should have been more explicit. The first line in the Python > file is: > > > #!/usr/bin/env Python (alternatively #!/usr/bin/Python - same results > either way). > python should be lowercased when referring to the name of

Re: Frustration debugging serial code

2010-05-07 Thread J. Cliff Dyer
On Fri, 2010-05-07 at 15:36 -0400, William R. Wing wrote: > > Maybe I should have been more explicit. The first line in the Python > file is: > > > #!/usr/bin/env Python (alternatively #!/usr/bin/Python - same results > either way). > python should be lowercased when referring to the name of

Re: Help running Windows programs from Python

2010-05-07 Thread Mensanator
On May 7, 2:14 pm, Scott wrote: > I want to write a script to automate log archiving/compressing on a > Win2003 server. I have Python 2.6 installed. I am planning to use 7- > zip for compression (because I have been using it manually for a while > now). For now all operations will be local in the

ConfigParser.get() defaults?

2010-05-07 Thread Tim Chase
With a normal dictionary, I can specify a default fallback value in the event the requested key isn't present: d = {} print d.get(42, 'Some default goes here') However, with the ConfigParser object, there doesn't seem to be any way to do a similar cp = ConfigParser(...) # ... print

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-07 Thread Giampaolo Rodolà
2010/5/7 Antoine Pitrou : > Le Fri, 07 May 2010 16:36:44 +0200, Giampaolo Rodolà a écrit : >> You can easily avoid this by setting a lower timeout when calling >> asyncore.loop(), like 1 second or less (for example, Twisted uses 0.001 >> secs). >> Actually there's no reason for asyncore to have suc

Re: Frustration debugging serial code

2010-05-07 Thread Grant Edwards
On 2010-05-07, Grant Edwards wrote: > William R. Wing (Bill Wing) wrote: >> Hello World - >> I'm new to both Python and this list, but here's hoping someone can spot >> my problem. >> >> System: Mac OS-X, 10.6.3 (Intel dual quad processor) >> Using Python 2.6.1, and pyserial-2.5_rc2-py2.6 >> >

Re: Frustration debugging serial code

2010-05-07 Thread Grant Edwards
William R. Wing (Bill Wing) wrote: > Hello World - > I'm new to both Python and this list, but here's hoping someone can spot > my problem. > > System: Mac OS-X, 10.6.3 (Intel dual quad processor) > Using Python 2.6.1, and pyserial-2.5_rc2-py2.6 > > The following snippet of code is designed to

Re: Frustration debugging serial code

2010-05-07 Thread William R. Wing
On May 7, 2010, at 2:08 PM, MRAB wrote: > William R. Wing (Bill Wing) wrote: >> Hello World - >> I'm new to both Python and this list, but here's hoping someone can spot my >> problem. >> System: Mac OS-X, 10.6.3 (Intel dual quad processor) >> Using Python 2.6.1, and pyserial-2.5_rc2-py2.6 >> Th

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-07 Thread Paul Moore
On 7 May 2010 15:36, Giampaolo Rodolà wrote: > You can easily avoid this by setting a lower timeout when calling > asyncore.loop(), like 1 second or less (for example, Twisted uses > 0.001 secs). Thanks, that's what I was considering. > Actually there's no reason for asyncore to have such a high

Re: Frustration debugging serial code

2010-05-07 Thread MRAB
William R. Wing (Bill Wing) wrote: On May 7, 2010, at 2:08 PM, MRAB wrote: William R. Wing (Bill Wing) wrote: Hello World - I'm new to both Python and this list, but here's hoping someone can spot my problem. System: Mac OS-X, 10.6.3 (Intel dual quad processor) Using Python 2.6.1, and pyse

Help running Windows programs from Python

2010-05-07 Thread Scott
I want to write a script to automate log archiving/compressing on a Win2003 server. I have Python 2.6 installed. I am planning to use 7- zip for compression (because I have been using it manually for a while now). For now all operations will be local in the C: drive. As a total beginner I'm having

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-07 Thread Antoine Pitrou
Le Fri, 07 May 2010 16:36:44 +0200, Giampaolo Rodolà a écrit : > You can easily avoid this by setting a lower timeout when calling > asyncore.loop(), like 1 second or less (for example, Twisted uses 0.001 > secs). > Actually there's no reason for asyncore to have such a high default > timeout (30 s

Re: Frustration debugging serial code

2010-05-07 Thread MRAB
William R. Wing (Bill Wing) wrote: Hello World - I'm new to both Python and this list, but here's hoping someone can spot my problem. System: Mac OS-X, 10.6.3 (Intel dual quad processor) Using Python 2.6.1, and pyserial-2.5_rc2-py2.6 The following snippet of code is designed to open a port v

Frustration debugging serial code

2010-05-07 Thread William R. Wing (Bill Wing)
Hello World - I'm new to both Python and this list, but here's hoping someone can spot my problem. System: Mac OS-X, 10.6.3 (Intel dual quad processor) Using Python 2.6.1, and pyserial-2.5_rc2-py2.6 The following snippet of code is designed to open a port via a KeySpan USB-to-serial converter

Re: Broken pipe

2010-05-07 Thread cerr
On May 7, 9:45 am, Ron Eggler wrote: > -- > Ron Eggler > Suite# 1804 > 1122 Gilford St > Vancouver, BC V6G 2P5 > Canada > (778) 230-9442 > > > > > > > On Thu, May 6, 2010 at 11:11 PM, Ron Eggler wrote: > > > On May 6, 2010 10:37:14 pm Chris Rebert wrote: > > >> On Thu, May 6, 2010 at 10:27 PM, ce

Re: Broken pipe

2010-05-07 Thread Ron Eggler
-- Ron Eggler Suite# 1804 1122 Gilford St Vancouver, BC V6G 2P5 Canada (778) 230-9442 > On Thu, May 6, 2010 at 11:11 PM, Ron Eggler wrote: > > On May 6, 2010 10:37:14 pm Chris Rebert wrote: > >> On Thu, May 6, 2010 at 10:27 PM, cerr wrote: > >> > Hi There, > >> > > >> > I'm very new to Python a

Re: Cross-platform file paths

2010-05-07 Thread utabintarbo
On May 7, 11:23 am, cassiope wrote: > > normpath will convert forward slashes to backslashes on WinXX systems, > but > does not seem to do the reverse on posix systems...so try changing > your > string to use forward slashes.  Also- is the path otherwise the same > on > your Linux system? > > HTH.

Re: py3 tkinter acceps bytes. why?

2010-05-07 Thread Matthias Kievernagel
Me: >> If I don't want bytes to get passed to tkinter >> I just have to raise an exception in AsObj, no? >> Or is it even sufficient to just remove the bytes case? Martin v. Loewis wrote: > But why would you want that? There are commands which legitimately > return bytes, e.g. the file and network

Re: Cross-platform file paths

2010-05-07 Thread cassiope
On May 7, 7:32 am, utabintarbo wrote: > Until now, I have used the UNC under Windows (XP) to allow my program > to access files located on a Samba-equipped *nix box (eg. > os.path.normpath(r"\\serverFQDN\sharename\dir\filename")). When I try > to open this file under Linux (Red Hat 5), I get a fil

Re: fast regex

2010-05-07 Thread Patrick Maupin
On May 6, 9:44 pm, james_027 wrote: > On May 6, 11:33 pm, John Bokma wrote: > > > james_027 writes: > > > I was working with regex on a very large text, really large but I have > > > time constrained. Does python has any other regex library or string > > > manipulation library that works really

Re: Picking a license

2010-05-07 Thread Patrick Maupin
On May 6, 6:56 pm, Ben Finney wrote: > a...@pythoncraft.com (Aahz) writes: > > In article <4be05d75.7030...@msn.com>, > > Rouslan Korneychuk   wrote: > > > >The only question I have now is what about licensing? Is that > > >something I need to worry about? Should I go with LGPL, MIT, or > > >somet

Re: Classes: nested functions vs. private methodes

2010-05-07 Thread Steven D'Aprano
On Thu, 06 May 2010 12:40:16 +0200, Richard Lamboj wrote: > Thank you for the nice sample, but what is with multiple inheritance in > your sample? I mean the super call. Why not _MyClass.blah(self, arg). super() should work correctly when you have more complicated multiple inheritance, while cal

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-07 Thread Giampaolo Rodolà
You can easily avoid this by setting a lower timeout when calling asyncore.loop(), like 1 second or less (for example, Twisted uses 0.001 secs). Actually there's no reason for asyncore to have such a high default timeout (30 seconds). I think this should be signaled on the bug tracker. --- Giampao

Re: CGI python 3 write RAW BINARY

2010-05-07 Thread Dodo
Le 01/05/2010 12:52, Dodo a écrit : Le 30/04/2010 17:52, Antoine Pitrou a écrit : Le Thu, 29 Apr 2010 23:37:32 +0200, Dodo a écrit : I don't get a thing. Now with the fix : All browsers shows a different thing, but not the image! http://ddclermont.homeip.net/misc/python/ If I save it to co

Cross-platform file paths

2010-05-07 Thread utabintarbo
Until now, I have used the UNC under Windows (XP) to allow my program to access files located on a Samba-equipped *nix box (eg. os.path.normpath(r"\\serverFQDN\sharename\dir\filename")). When I try to open this file under Linux (Red Hat 5), I get a file not found error. Is there a cross-platform m

Re: Re: column selection

2010-05-07 Thread mannu jha
On Fri, 07 May 2010 18:58:59 +0530 wrote >mannu jha wrote: > On Thu, 06 May 2010 18:54:59 +0530 wrote > >> mannu jha wrote: >> > > >> I tried with this: >> > > > > >> for line in open('1.txt'): >> > > >> columns = line.split() >> > > >> print column

Re: Movable Python or ActivePython

2010-05-07 Thread python
Balzer, > I just need test a few python scripts. I recommend you look at Movable Python or Portable Python. Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: idiomatic way to collect and report multiple exceptions?

2010-05-07 Thread Steven D'Aprano
On Thu, 06 May 2010 21:56:10 -0700, Chris Rebert wrote: [...] > Output from example: > Traceback (most recent call last): > File "tmp.py", line 35, in > multiple_err.do_raise() > File "tmp.py", line 25, in do_raise > raise self > __main__.MultipleValidationErrors: See the following exc

Re: pyjamas 0.7 released

2010-05-07 Thread lkcl
On May 2, 7:16 am, Wolfgang Strobl wrote: > lkcl : > > > at least _some_ input would be good!  the knowledge doesn't have to > >be there: just the bugreports saying "there's a problem and here's > >exactly how you reproduce it" would be a start! > >> So please make it simpler for more people to he

Re: Movable Python or ActivePython

2010-05-07 Thread balzer
wrote in message news:mailman.2732.1273237281.23598.python-l...@python.org... Balzer, I took a look at the zip version of ActiveState's Python. There's a related thread in on this mailing list where I asked if the zip files are missing the Microsoft VC runtime files required by the Python in

Re: Movable Python or ActivePython

2010-05-07 Thread python
Balzer, I took a look at the zip version of ActiveState's Python. There's a related thread in on this mailing list where I asked if the zip files are missing the Microsoft VC runtime files required by the Python interpreter. According to Trent from ActiveState, this is indeed the case. I recomm

Re: Re: column selection

2010-05-07 Thread Dave Angel
Dave Angel wrote: mannu jha wrote: I tried with this: for line in open('1.txt'): columns = line.split() print columns[0], columns[1] if not line: continue but it is showing error: nmru...@caf:~> python split.py 24 ALA Traceback (most recent call last): File "split.py",

Re: importing modules

2010-05-07 Thread Jean-Michel Pichavant
Richard Lamboj wrote: Am Friday 07 May 2010 13:50:15 schrieb Jean-Michel Pichavant: Richard Lamboj wrote: Hello, I have a question about importing python modules. I have modul package, with submodules. So how can a submodul access a modul that is on level upper? Is there something l

Re: Movable Python or ActivePython

2010-05-07 Thread balzer
"Sridhar Ratnakumar" wrote in message news:mailman.2638.1273083585.23598.python-l...@python.org... On 2010-05-05, at 5:47 AM, balzer wrote: I want Python pack that can run without being installed, mostly for testing programs. As I read, Movable Python can run without being installed. It ne

Re: List comprehension + lambdas - strange behaviour

2010-05-07 Thread Neil Cerutti
On 2010-05-07, Terry Reedy wrote: > On 5/6/2010 3:34 PM, Artur Siekielski wrote: >> Hello. >> I found this strange behaviour of lambdas, closures and list >> comprehensions: >> > funs = [lambda: x for x in range(5)] > [f() for f in funs] >> [4, 4, 4, 4, 4] > > You succumbed to lambda hypno

Re: fast regex

2010-05-07 Thread Tim Chase
[your reply appears to have come only to me instead of the mailing list; CC'ing c.l.p in reply] On 05/06/2010 10:12 PM, James Cai wrote: When you say "This does a replacement for every word in the input corpus (possibly with itself), but only takes one pass through the source text. " It sounds

Re: importing modules

2010-05-07 Thread Richard Lamboj
Am Friday 07 May 2010 13:50:15 schrieb Jean-Michel Pichavant: > Richard Lamboj wrote: > > Hello, > > > > I have a question about importing python modules. > > > > I have modul package, with submodules. So how can a submodul access a > > modul that is on level upper? > > > > Is there something lik

Re: Django as exemplary design

2010-05-07 Thread Aahz
In article <2010050619481239450-tomfsess...@gmailcom>, TomF wrote: > >I don't doubt it. But I'm not really interested in line (micro) level >code issues at the moment. Not that my code couldn't stand being >improved, but I'm more interested in seeing how medium/large OO python >systems are de

Re: importing modules

2010-05-07 Thread Jean-Michel Pichavant
Richard Lamboj wrote: Hello, I have a question about importing python modules. I have modul package, with submodules. So how can a submodul access a modul that is on level upper? Is there something like "import ../../blah"? I don't mean something like this: "import bla.blub.moep" Kind Re

listing exported functions in a DLL

2010-05-07 Thread NickGB
is there a way using ctypes to list the exported functions of a DLL? This is what I was hoping to do... from ctypes import * myDLL = windll.some_dll # what is this method? does it exist? list_of_exported_functions = myDLL.list_exported_functions() -- http://mail.python.org/mailman/listinfo/p

Re: importing modules

2010-05-07 Thread Andi Albrecht
Richard Lamboj schrieb: > > Hello, > > I have a question about importing python modules. > > I have modul package, with submodules. So how can a submodul access a modul > that is on level upper? > > Is there something like "import ../../blah"? I don't mean something like > this: "import bla.blu

Re: importing modules

2010-05-07 Thread Alex Hall
I have a main folder. Inside that I have a "modes" package (subfolder holding __init__.py) as well as a "misc" package. When modes has to import helpers.py from misc, I use this: from .misc import helpers The period makes Python look up one level for misc, then go into it to find helpers. On 5/7/1

importing modules

2010-05-07 Thread Richard Lamboj
Hello, I have a question about importing python modules. I have modul package, with submodules. So how can a submodul access a modul that is on level upper? Is there something like "import ../../blah"? I don't mean something like this: "import bla.blub.moep" Kind Regards, Richi -- http://

ActivePython - how to configure portable framework?

2010-05-07 Thread balzer
I downloaded ActivePython-2.6.5.12-win32-x86.zip, it contains two folders and 3 files: SystemFolder INSTALLDIR sh2.py install.bat _install.py Anyone know how to configure this Python environment as "portable application" to work with it without installation, to set a fully-functional Python

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-07 Thread Paul Moore
On 6 May, 20:58, Thomas Heller wrote: > If you look at the source code for time.sleep(), which CAN be interrupted > by pressing Ctrl-C, you will find that it is carefully programmed to be > interruptible (sp?).  Which is not the case for select.select(), obviously. Thanks - given this, would it b

Re: No module named server

2010-05-07 Thread Thomas Lehmann
On 7 Mai, 10:02, Thomas Lehmann wrote: > > Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit > > Also after installing Python 3.1.2 the problem is still there. I know the problem. Reading a book about a simple cgi web server the descriptions says to use httpd.py as name for the

Re: No module named server

2010-05-07 Thread Andi Albrecht
Thomas Lehmann schrieb: > Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit > (Intel)] on win32 > > Script: > from http.server import HTTPServer, CGIHTTPRequestHandler > > Result: > Traceback (most recent call last): > File "http.py", line 1, in > from http.server import H

Re: No module named server

2010-05-07 Thread Thomas Lehmann
> Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit Also after installing Python 3.1.2 the problem is still there. -- http://mail.python.org/mailman/listinfo/python-list

Re: fast regex

2010-05-07 Thread Helmut Jarausch
On 05/06/10 16:52, james_027 wrote: > hi, > > I was working with regex on a very large text, really large but I have > time constrained. Does python has any other regex library or string > manipulation library that works really fast? Have a look at http://www.egenix.com/products/python/mxBase/mx

No module named server

2010-05-07 Thread Thomas Lehmann
Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12) [MSC v.1500 32 bit (Intel)] on win32 Script: from http.server import HTTPServer, CGIHTTPRequestHandler Result: Traceback (most recent call last): File "http.py", line 1, in from http.server import HTTPServer, CGIHTTPRequestHandler File "F:

Re: Python - MySQL fetching values

2010-05-07 Thread Kurian Thayil
On Thu, May 6, 2010 at 2:42 PM, Chris Rebert wrote: > On Thu, May 6, 2010 at 1:47 AM, Kurian Thayil > wrote: > > > the expected output is 05:35:05. > > > > Now, here is code snippet, > > > > cursor1=getconnect1.cursor() > > getrows=cursor1.execute("""SELECT > > T