Re: What do you want in a new web framework?

2006-08-29 Thread Steve Holden
Alex Martelli wrote: [...] > > > [...] youtube says: The url contained a malformed video id. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb

Re: Coding style and else statements

2006-08-29 Thread Steve Holden
Carl Banks wrote: [...] > However, I have rare cases where I do choose to use the else (ususally > in the midst of a complicated piece of logic, where it's be more > distracting than concise). In that case, I'd do something like this: > > def foo(thing): > if thing: > return thing+1 >

Re: The lib email parse problem...

2006-08-29 Thread 叮叮当当
yes, the special is i must choose exactly one section to destruct, instead of processing all subparts. John Machin 写道: > Tim Roberts wrote: > > "" <[EMAIL PROTECTED]> wrote: > > > > >i know how to use email module lib. > > > > > >the question is about how to handle the rfc 1521 mime > > >mul

Re: [ANN] NumPy 1.0b4 now available

2006-08-29 Thread Travis E. Oliphant
Bruce Who wrote: > Hi, Travis > > I can pack my scripts into an executable with py2exe, but errors occur > once it runs: I suspect you need to force-include the numpy/core/_internal.py file by specifying it in your setup.py file as explained on the py2exe site. That module is only imported by t

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-29 Thread Tim Peters
[/T] >> OTOH, current versions of Python (and Perl) [/F] > just curious, but all this use of (& Perl) mean that the Perl folks have > implemented timsort ? A remarkable case of independent harmonic convergence: http://mail.python.org/pipermail/python-dev/2002-July/026946.html Come to think

Re: The lib email parse problem...

2006-08-29 Thread John Machin
Tim Roberts wrote: > "" <[EMAIL PROTECTED]> wrote: > > >i know how to use email module lib. > > > >the question is about how to handle the rfc 1521 mime > >mulitpart/alternitave part . > > > >i know emai can handle mulitpart , but the subpart alternative is > >special . > > No, it's not. A m

Re: refering to base classes

2006-08-29 Thread Steve Holden
glenn wrote: > Hi Roberto > >>If you want dog.voice() to just print "voice: bark", you just have to omit >>the voice method for the dog class: it will be inherited from creature. >> > > I would have thought this would be correct, but in this case, plus in > others im playin with, I get this issue

Re: The lib email parse problem...

2006-08-29 Thread Tim Roberts
"" <[EMAIL PROTECTED]> wrote: >i know how to use email module lib. > >the question is about how to handle the rfc 1521 mime >mulitpart/alternitave part . > >i know emai can handle mulitpart , but the subpart alternative is >special . No, it's not. A multipart/alternative section is construc

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-29 Thread Fredrik Lundh
Tim Peters wrote: > OTOH, current versions of Python (and Perl) just curious, but all this use of (& Perl) mean that the Perl folks have implemented timsort ? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to let a loop run for a while before checking for break condition?

2006-08-29 Thread Matimus
Claudio Grondi wrote: > Sometimes it is known in advance, that the time spent in a loop will be > in order of minutes or even hours, so it makes sense to optimize each > element in the loop to make it run faster. > One of instructions which can sure be optimized away is the check for > the break c

Re: Allowing ref counting to close file items bad style?

2006-08-29 Thread Fredrik Lundh
Dan wrote: > Is this discouraged?: > > for line in open(filename): > > > That is, should I do this instead?: > > fileptr = open(filename) > for line in fileptr: > > fileptr.close() depends on the use case; in a small program that you know will only read

Re: Firewire comms using Python?

2006-08-29 Thread Tim Roberts
"Fraggle69" <[EMAIL PROTECTED]> wrote: > >Does anyone have any idea of how I can use Python to get images from my >firewire camera?? >I am using python under winXP pro You can try http://videocapture.sourceforge.net. The web page focuses on USB webcams, but if it's using a standard XP interf

Re: unicode "table of character" implementation in python

2006-08-29 Thread Tim Roberts
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >In any case, somebody pointed you to the Unicode code blocks. I think >these are Asian scripts (I may have missed some): > >0530..058F; Armenian >0590..05FF; Hebrew >... This is a fabulously useful list, Martin. Did you get this from a web page? Ca

Re: Naming conventions (was: Re: refering to base classes)

2006-08-29 Thread Jean-Paul Calderone
On Wed, 30 Aug 2006 14:22:16 +1000, Ben Finney <[EMAIL PROTECTED]> wrote: >"glenn" <[EMAIL PROTECTED]> writes: > >> Bruno Desthuilliers wrote: >> > It might be better to use newstyle classes if you can. Also, the >> > convention is to use CamelCase for classes names (unless you have >> > a strong r

Releasing GIL in unknown state

2006-08-29 Thread Farshid Lashkari
Hi, Is there a proper way for C code to ensure that the GIL is released? I know about PyGILState_Ensure and PyGILState_Release, but that is to ensure the GIL is acquired. I have some extension code that does heavy processing and I want to release the GIL, but the code can't be sure that the GI

Naming conventions (was: Re: refering to base classes)

2006-08-29 Thread Ben Finney
"glenn" <[EMAIL PROTECTED]> writes: > Bruno Desthuilliers wrote: > > It might be better to use newstyle classes if you can. Also, the > > convention is to use CamelCase for classes names (unless you have > > a strong reason to do otherwise). Note that this style is more correctly called TitleCase

Re: Issues with Installer written in Python for Linux

2006-08-29 Thread Stephan Kuhagen
[EMAIL PROTECTED] wrote: > I am undertaking writing an installer for a software package using > Python. It is exclusively for Linux. Because this is an installer and > has to run on numerous Linux distros, it is presenting some unique > challenges. I had the same problem to solve as you, and I ho

Re: Allowing ref counting to close file items bad style?

2006-08-29 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I disagree, somewhat. No, you shouldn't count on the "ref count" per > se going to 0. And you shouldn't count on the file object being GC'd > _immediately_ after the last reference is destroyed. You should be able > to rely on it being GC'd at som

Re: Allowing ref counting to close file items bad style?

2006-08-29 Thread [EMAIL PROTECTED]
Paul Rubin wrote: > Dan <[EMAIL PROTECTED]> writes: > > Is this discouraged?: > > > > for line in open(filename): > > > > Yes. > > > Can I count on the ref count going to zero to close the file? > > You really shouldn't. It's a CPython artifact. I disagree, somewhat. No, you shoul

Re: Allowing ref counting to close file items bad style?

2006-08-29 Thread Dan
Paul Rubin wrote: > Dan <[EMAIL PROTECTED]> writes: >> Is this discouraged?: >> >> for line in open(filename): >> > > Yes. Well, not what I wanted to hear, but what I expected. Thanks, Dan -- dedded att verizon dott net -- http://mail.python.org/mailman/listinfo/python-list

Re: refering to base classes

2006-08-29 Thread glenn
Hi Roberto > If you want dog.voice() to just print "voice: bark", you just have to omit > the voice method for the dog class: it will be inherited from creature. > I would have thought this would be correct, but in this case, plus in others im playin with, I get this issue: ---

Re: block a network port

2006-08-29 Thread Butternut Squash
abcd wrote: > Larry Bates wrote: >> This is not really a Python question. Blocking ports is a function >> of your firewall solution. >> > > > ok, no of any python solutions? or command-line firewalls? So now you're question is how to write a firewall in python? You can probably bind to all

Re: block a network port

2006-08-29 Thread alex23
abcd wrote: > ok, no of any python solutions? or command-line firewalls? You did try searching Google for "python firewall", right? http://www.google.com.au/search?q=python+firewall The very first entry is a pointer to a solution for Windows. You really need to provide more information if you

Re: refering to base classes

2006-08-29 Thread glenn
Bruno Desthuilliers wrote: > glenn wrote: > > hi - Im quite new to python, wondering if anyone can help me understand > > something about inheritance here. In this trivial example, how could I > > modify the voice method of 'dog' to call the base class 'creatures' > > voice method from with in i

Re: refering to base classes

2006-08-29 Thread glenn
Chaz Ginger wrote: > Chaz Ginger wrote: > > glenn wrote: > >> hi - Im quite new to python, wondering if anyone can help me understand > >> something about inheritance here. In this trivial example, how could I > >> modify the voice method of 'dog' to call the base class 'creatures' > >> voice me

Re: block a network port

2006-08-29 Thread abcd
Larry Bates wrote: > This is not really a Python question. Blocking ports is a function > of your firewall solution. > ok, no of any python solutions? or command-line firewalls? -- http://mail.python.org/mailman/listinfo/python-list

Re: Allowing ref counting to close file items bad style?

2006-08-29 Thread Paul Rubin
Dan <[EMAIL PROTECTED]> writes: > Is this discouraged?: > > for line in open(filename): > Yes. > Can I count on the ref count going to zero to close the file? You really shouldn't. It's a CPython artifact. > I understand that the upcoming 'with' statement will obviate this > qu

Re: What do you want in a new web framework?

2006-08-29 Thread Alex Martelli
Peter Maas <[EMAIL PROTECTED]> wrote: > Cliff Wells wrote: > > On Wed, 2006-08-23 at 22:13 +0200, Peter Maas wrote: > >> Alex Martelli wrote: > [...] > >>> I have already suggested to the BDFL that he can remedy this situation > >>> in Py3k: all he has to do, of course, is to add a LOT more keywor

Allowing ref counting to close file items bad style?

2006-08-29 Thread Dan
Is this discouraged?: for line in open(filename): That is, should I do this instead?: fileptr = open(filename) for line in fileptr: fileptr.close() Can I count on the ref count going to zero to close the file? How about a write case? For example:

Re: TNEF decoder

2006-08-29 Thread hg
Simon Forman wrote: > David Isaac wrote: >> I'm aware of >> http://cheeseshop.python.org/pypi/pytnef/ >> but it uses the tnef utility, and I'd like a pure Python solution >> (along the lines of http://www.freeutils.net/source/jtnef/ ). >> >> Is there one? >> >> Thanks, >> Alan Isaac > > A place I

Re: TNEF decoder

2006-08-29 Thread Simon Forman
David Isaac wrote: > I'm aware of > http://cheeseshop.python.org/pypi/pytnef/ > but it uses the tnef utility, and I'd like a pure Python solution > (along the lines of http://www.freeutils.net/source/jtnef/ ). > > Is there one? > > Thanks, > Alan Isaac A place I once worked at had a project that

Re: Questoin about outlook calendar

2006-08-29 Thread Roger Upole
"Gallagher, Tim (NE)" wrote : > import win32com.client > import time > import datetime > > outlook = win32com.client.Dispatch("Outlook.Application") > namespace = outlook.GetNamespace("MAPI") > appointments = namespace.GetDefaultFolder(9).Items > > #print appointments.count > x = 4 # This is a nu

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-29 Thread Robert Kern
alf wrote: > Fredrik Lundh wrote: >> http://www.catb.org/~esr/faqs/smart-questions.html#writewell >> >> > > and means? It's his signature. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret i

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-29 Thread alf
Fredrik Lundh wrote: > > http://www.catb.org/~esr/faqs/smart-questions.html#writewell > > and means? -- http://mail.python.org/mailman/listinfo/python-list

Re: Variables in nested functions

2006-08-29 Thread Ben Cartwright
[EMAIL PROTECTED] wrote: > Is it possible to change the value of a variable in the outer function > if you are in a nested inner function? The typical kludge is to wrap the variable in the outer function inside a mutable object, then pass it into the inner using a default argument: def outer():

Re: NumPy 1.0b4 now available

2006-08-29 Thread [EMAIL PROTECTED]
Robert Kern wrote: > [EMAIL PROTECTED] wrote: > > Travis E. Oliphant wrote: > >> The 4th beta release of NumPy 1.0 has just been made available. > >> > >> NumPy 1.0 represents the culmination of over 18 months of work to unify > >> the Numeric and Numarray array packages into a single best-of-breed

Variables in nested functions

2006-08-29 Thread zero . maximum
Is it possible to change the value of a variable in the outer function if you are in a nested inner function? For example: def outer(): a = "outer" def inner(): print a a = "inner" # I'm trying to change the outer 'a' here, # but this st

Re: subprocess woes

2006-08-29 Thread Simon Forman
Dennis Lee Bieber wrote: > On Tue, 29 Aug 2006 18:17:47 +0530, km <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > ##code start ## > > import subprocess as sp > > x = 'GSQIPSHYWKKNLWYYSHEIDGGCHNMW' > > p0 = sp.Popen(["echo",x], stdout=sp.PIPE) > > Why use this

Re: Coding style and else statements

2006-08-29 Thread Carl Banks
tobiah wrote: > def foo(thing): > if thing: > return thing + 1 > else: > return -1 > > def foo(thing): > if thing: > return thing + 1 > return -1 > > Obviously both do the same thing. The first is > possibly clearer, while the secon

Re: newbe question about removing items from one file to another file

2006-08-29 Thread Simon Forman
[EMAIL PROTECTED] wrote: > Anthra Norell wrote: > > Dexter, > > > > I looked at the format specification. It contains an example: > > > > --- > > > > ; > > ; test.csd - a Csound structured data file > > > > > > -W -d -o tone.wav > > > > > > ;opt

Re: Split with python

2006-08-29 Thread Gabriel Genellina
At Tuesday 29/8/2006 20:31, tobiah wrote: >> I have a csv file which is has a field that has something like: >> But then this fails if there are commas in the data. I could split and join on '","' but then that fails when 'x' is either the first or last field. Are there tools in the csv module

Re: Split with python

2006-08-29 Thread bearophileHUGS
Norman Khine: > I have a csv file which is has a field that has something like: > "text (xxx)" > "text (text) (yyy)" > "text (text) (text) (zzz)" > > I would like to split the last '(text)' out and put it in a new column, > so that I get: > "text","(xxx)" > "text (text)","(yyy)" > "text (text) (tex

Re: How to let a loop run for a while before checking for breakcondition?

2006-08-29 Thread matt
IMHO you're better off avoiding all this... It makes the code unnecessarily complicated when you're not sure if this is a performance bottleneck or not... Common advice is to write the code as simple as possible first, then go back and optimize as needed using the profiler. This is where extendi

Re: Split with python

2006-08-29 Thread John Machin
tobiah wrote: > Of course, fixing the csv file takes a little more work. It sounds like the > test lines given were just one of the fields, and there are > the quotes to worry about. > [snip] > > But then this fails if there are commas in the > data. I could split and join on '","' but then > t

Re: NumPy 1.0b4 now available

2006-08-29 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Travis E. Oliphant wrote: >> The 4th beta release of NumPy 1.0 has just been made available. >> >> NumPy 1.0 represents the culmination of over 18 months of work to unify >> the Numeric and Numarray array packages into a single best-of-breed >> array package for Python. >

Re: newbe question about removing items from one file to another file

2006-08-29 Thread [EMAIL PROTECTED]
Anthra Norell wrote: > Dexter, > > I looked at the format specification. It contains an example: > > --- > > ; > ; test.csd - a Csound structured data file > > > -W -d -o tone.wav > > > ;optional section > Before 4.10 ;these two statements c

Re: Split with python

2006-08-29 Thread tobiah
Tim Chase wrote: > Norman Khine wrote: >> Hello, >> I have a csv file which is has a field that has something like: >> >> text.csv >> "text (xxx)" >> "text (text) (yyy)" >> "text (text) (text) (zzz)" >> >> I would like to split the last '(text)' out and put it in a new >> column, so that I get: >

Re: python for flash drives

2006-08-29 Thread Fuzzyman
Putty wrote: > Is there such a thing as a special version of python that I can run > more efficiently from a flash drive? I'll be at college for hours > every day with hours of free time for the next few months, but the only > computers at my disposal are windows PCs that use GoBack to auto-rever

Re: NumPy 1.0b4 now available

2006-08-29 Thread [EMAIL PROTECTED]
Travis E. Oliphant wrote: > The 4th beta release of NumPy 1.0 has just been made available. > > NumPy 1.0 represents the culmination of over 18 months of work to unify > the Numeric and Numarray array packages into a single best-of-breed > array package for Python. > > NumPy supports all the featu

question about SOAPpy

2006-08-29 Thread m.banaouas
Hello Pythoneers: I would like to ask you a simple question: Are you satisfied by SOAPpy module? Actually, I use this module since a year and i immediately found it very well-implemented, corresponding to dynamic "meta-data" discovering nature of SOAP/WSDL. BUT i read sometimes threads saying

Re: Split with python

2006-08-29 Thread John Machin
Tim Chase wrote: > Norman Khine wrote: > > Hello, > > I have a csv file which is has a field that has something like: > > > > text.csv > > "text (xxx)" > > "text (text) (yyy)" > > "text (text) (text) (zzz)" > > > > I would like to split the last '(text)' out and put it in a new column, > > so that

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-29 Thread Tim Peters
[Joachim Durchholz] > Wikipedia says it's going from 2NlogN to N. If a sort is massively > dominated by the comparison, that could give a speedup of up to 100% > (approximately - dropping the logN factor is almost irrelevant, what > counts is losing that factor of 2). [Gabriel Gen

Python for Windows

2006-08-29 Thread mistral
I need compile code written in Python. I use Windows 98SE. Should I download Python for Windows installer? http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi Will the msi installer modify registry or other system files? Does it possible install Python not touching registry and system files? t

Re: Max OSX and Excel

2006-08-29 Thread John Machin
Jorge Vargas wrote: > On 28 Aug 2006 15:50:57 -0700, John Machin <[EMAIL PROTECTED]> wrote: > > Jorge Vargas wrote: > > > On 8/28/06, Johanna Pfalz <[EMAIL PROTECTED]> wrote: > > > > To be more specific, I'm interested in reading in certain rows and > > > > columns > > > > from an excel spreadshe

Re: python for flash drives

2006-08-29 Thread tobiah
You could always get an mp3 player that windows can see as a drive letter. I'll bet the I/O would be quite fast. Plus, you would be getting an mp3 player. If money is a concern, check out used ones on ebay. Putty wrote: > Is there such a thing as a special version of python that I can run > mo

Re: block a network port

2006-08-29 Thread Larry Bates
abcd wrote: > any ideas on how to block a network port from being used, or one that > is currently in use? For example, say I want to block port 23 from > being used. by used, I mean allowing connections to or from it. > > thanks in advance. > This is not really a Python question. Blocking por

Re: Coding style and else statements

2006-08-29 Thread Tal Einat
Bruno Desthuilliers wrote: > Sam Pointon a écrit : > > Bruno Desthuilliers wrote: > > > >>foo = lambda thing: thing and thing + 1 or -1 > > > > > > The and ... or trick is buggy (what if thing == -1?) > > Yes, true - Should be: > foo2 = lambda t: t != -1 and (t and t+1 or -1) or 0 > Actually, the

Re: time.clock() going backwards??

2006-08-29 Thread Ralf Muschall
Grant Edwards wrote: > This is a _Microsoft_Product_. There doesn't have to be a > reason for something to be done in a half-assed manner. No, it is a quantum effect. If the energy of a clock has a lower bound, there must be a nonzero probability for it to run backwards. See <[EMAIL PROTECTED]

Re: Extending the dict class

2006-08-29 Thread chosechu
Bruno Desthuilliers wrote: > It's usually possible to modify third-parts classes behaviour on the fly > (googling for 'monkey-patching' should get you started). But true, this > doesn't work with builtins. I guess this stems from the fact that Python dictionaries are C creatures and they are them

Re: What do you want in a new web framework?

2006-08-29 Thread Peter Maas
[EMAIL PROTECTED] wrote: >> Here is another remedy: he adds one of the frameworks to the standard >> library :) >> >> Peter Maas, Aachen > > But there are already 3 ;-) > > http://docs.python.org/lib/module-BaseHTTPServer.html > http://docs.python.org/lib/module-SimpleHTTPServer.html > http://doc

Re: What do you want in a new web framework?

2006-08-29 Thread Peter Maas
Cliff Wells wrote: > On Wed, 2006-08-23 at 22:13 +0200, Peter Maas wrote: >> Alex Martelli wrote: [...] >>> I have already suggested to the BDFL that he can remedy this situation >>> in Py3k: all he has to do, of course, is to add a LOT more keywords. >> Here is another remedy: he adds one of the f

Re: Generator chaining?

2006-08-29 Thread Gabriel Genellina
At Tuesday 29/8/2006 16:41, John Doe wrote: This is sort of a feature request/idea: Chaining generators. If you have two lists (or tuples) and you add them, the result is a concatenation of the two. I think it would be nice if it was possible to do something similar with generators. The best wa

Re: python for flash drives

2006-08-29 Thread Maciej Dziardziel
Putty wrote: > Is there such a thing as a special version of python that I can run > more efficiently from a flash drive? google for movable python (or similar) -- Maciej "Fiedzia" Dziardziel ([EMAIL PROTECTED]) In the land of the blind, the one eyed man is king. -- http://mail.python.org/mai

Re: Generator chaining?

2006-08-29 Thread Duncan Booth
John Doe wrote: > This is sort of a feature request/idea: Chaining generators. > > If you have two lists (or tuples) and you add them, the result is a > concatenation of the two. > I think it would be nice if it was possible to do something similar with > generators. The best way to explain is by

Re: Generator chaining?

2006-08-29 Thread Jean-Paul Calderone
On Tue, 29 Aug 2006 22:41:37 +0300, John Doe <[EMAIL PROTECTED]> wrote: >This is sort of a feature request/idea: Chaining generators. > >If you have two lists (or tuples) and you add them, the result is a >concatenation of the two. >I think it would be nice if it was possible to do something simila

ANN: Wing IDE 2.1.2 released

2006-08-29 Thread Wingware Announce
Hi, We're happy to announce version 2.1.2 of Wing IDE, an advanced development environment for the Python programming language. This is a bugfix release that improves support for Python 2.5 (2.5c1 is required) and fixes a number of bugs. The release can be downloaded from: http://wingware.com/

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-29 Thread Joachim Durchholz
Tim Peters schrieb: > [Joachim Durchholz] Wikipedia says it's going from 2NlogN to N. If a sort is massively dominated by the comparison, that could give a speedup of up to 100% (approximately - dropping the logN factor is almost irrelevant, what counts is losing that factor of

Generator chaining?

2006-08-29 Thread John Doe
This is sort of a feature request/idea: Chaining generators. If you have two lists (or tuples) and you add them, the result is a concatenation of the two. I think it would be nice if it was possible to do something similar with generators. The best way to explain is by code example: def add_gener

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-29 Thread Tim Peters
[Joachim Durchholz] >>> Wikipedia says it's going from 2NlogN to N. If a sort is massively >>> dominated by the comparison, that could give a speedup of up to 100% >>> (approximately - dropping the logN factor is almost irrelevant, what >>> counts is losing that factor of 2). [Gabriel Genellina] >

block a network port

2006-08-29 Thread abcd
any ideas on how to block a network port from being used, or one that is currently in use? For example, say I want to block port 23 from being used. by used, I mean allowing connections to or from it. thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Desktop Notification/Alerts In Python

2006-08-29 Thread bugnthecode
Chaos wrote: > alex23 wrote: > > Chaos wrote: > > > I am looking for ways to have a Desktop Alert, like the one most IM > > > Messengers have (MSN, AIM) at the lower right above the taskbar. Can > > > anyone point me to the right resources to use? I get these alerts from gmail-notify. It's for li

Re: sys.argv[0] doesn't always contain the full path of running script.

2006-08-29 Thread Eyal Lotem
>> How can I find where exactly the current python script is running? >> ... >> That means sys.argv[0] doesn't always contain the full path of >> running script. > sys.path[0] is the script directory, combined with sys.argv[0] you can > find the full path to the script. > (Note that in some rare ca

Re: unit test for a printing method

2006-08-29 Thread Marco Wahl
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: >>> >>> why are you trying to reinvent doctest ? >> >> The OP asked for unit test. This could be read that >> the OP wants to use module unittest. > > http://docs.python.org/lib/doctest-unittest-api.html Ahh, that's good to know that doctests can be

Questoin about outlook calendar

2006-08-29 Thread Gallagher, Tim (NE)
I am trying to pull all my information from outlook calendar so I can send calendar information to my phone via email. I have created a python script that will gather Outlook Calendar information and display it. I am new to python and this is something that I am working on so I can get better.

Re: sys.argv[0] doesn't always contain the full path of running script.

2006-08-29 Thread Miki
Hello Max, > How can I find where exactly the current python script is running? > ... > That means sys.argv[0] doesn't always contain the full path of > running script. sys.path[0] is the script directory, combined with sys.argv[0] you can find the full path to the script. (Note that in some rare

Re: Pros/Cons of Turbogears/Rails?

2006-08-29 Thread Bruno Desthuilliers
Adam Jones wrote: > Bruno Desthuilliers wrote: >> Paul Boddie wrote: >>> Ray wrote: >> (snip) We're a Java shop so our developers are trained in Java, Struts, Tomcat, etc. Any switch to a dynamic language will be a huge change. However it baffles me that they are open to at leas

python for flash drives

2006-08-29 Thread Putty
Is there such a thing as a special version of python that I can run more efficiently from a flash drive? I'll be at college for hours every day with hours of free time for the next few months, but the only computers at my disposal are windows PCs that use GoBack to auto-revert every reboot. So I'

Re: Split with python

2006-08-29 Thread Tim Chase
Norman Khine wrote: > Hello, > I have a csv file which is has a field that has something like: > > text.csv > "text (xxx)" > "text (text) (yyy)" > "text (text) (text) (zzz)" > > I would like to split the last '(text)' out and put it in a new column, > so that I get: > > new_test.csv > "text","

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-29 Thread Joachim Durchholz
Gabriel Genellina schrieb: > At Tuesday 29/8/2006 07:50, Joachim Durchholz wrote: > >> Wikipedia says it's going from 2NlogN to N. If a sort is massively >> dominated by the comparison, that could give a speedup of up to 100% >> (approximately - dropping the logN factor is almost irrelevant, what

Re: eval() woes

2006-08-29 Thread rdrink
Thanks everyone for you thoughtful replies... And yes Simon you are right... I do need to learn how to read 'tracebacks' (and de-bugging tools in general)... but you are the first person to give me a step-by-step explination, thank you. And LOL you all caught my dropped single-quote ;-) but

Re: Pros/Cons of Turbogears/Rails?

2006-08-29 Thread Adam Jones
Bruno Desthuilliers wrote: > Paul Boddie wrote: > > Ray wrote: > (snip) > >> We're a Java shop so > >> our developers are trained in Java, Struts, Tomcat, etc. Any switch to > >> a dynamic language will be a huge change. However it baffles me that > >> they are open to at least a PoC in Rails. but

Split with python

2006-08-29 Thread Norman Khine
Hello, I have a csv file which is has a field that has something like: text.csv "text (xxx)" "text (text) (yyy)" "text (text) (text) (zzz)" I would like to split the last '(text)' out and put it in a new column, so that I get: new_test.csv "text","(xxx)" "text (text)","(yyy)" "text (text) (tex

Re: ntp in python

2006-08-29 Thread Janto Dreijer
Janto Dreijer wrote: > Jeremy Sanders wrote: > > Janto Dreijer wrote: > > > > > I want to measure the packet delivery delays over various network > > > links. For this I need to synchronise the times of the sender and > > > receiver, either against NTP or eachother. > > > > Couldn't you just use NT

SOAP web services

2006-08-29 Thread Yusnel Rojas
I'm trying to make the wsdl asociated with this sample but I cannot make it workimport SOAPpydef doUpper(word):    return word.upper()server = SOAPpy.SOAPServer(("", 8000)) server.registerFunction(doUpper)server.registerFunction(who)server.serve_forever()can anyone tell me how to do this?anyone

Issues with Installer written in Python for Linux

2006-08-29 Thread [EMAIL PROTECTED]
c.l.p- I am undertaking writing an installer for a software package using Python. It is exclusively for Linux. Because this is an installer and has to run on numerous Linux distros, it is presenting some unique challenges. First off, I have begun this project by writing a text mode only interface

sys.argv[0] doesn't always contain the full path of running script.

2006-08-29 Thread gmax2006
Hi, I use RedHat linux. How can I find where exactly the current python script is running? I use this code: #test.py import os,sys print sys.argv os.chdir(os.path.dirname(sys.argv[0])) It doesn't work when I run this command from the directory that test.py is located: python test.py That me

Re: about daemons and IPC

2006-08-29 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: > Hey people! > For the first time I'm doing a client/server application, and I'm > really confused with IPC stuff. [...] > Any suggestions? http://pyro.sourceforge.net depending on your needs --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: distributing modules to machines

2006-08-29 Thread Fredrik Lundh
r1pp3r wrote: > What I would like to do is have the system update itself on demand. In > other words, pass pickled objects (the code comprising the server) down > the pipeline to the server, have them copied to the right place, and > then restart the server which can then invoke the new code. sho

Re: Desktop Notification/Alerts In Python

2006-08-29 Thread Chaos
alex23 wrote: > Chaos wrote: > > I am looking for ways to have a Desktop Alert, like the one most IM > > Messengers have (MSN, AIM) at the lower right above the taskbar. Can > > anyone point me to the right resources to use? > > Under Windows, they're called "balloon tips". Here's a thread from a

Re: ntp in python

2006-08-29 Thread Janto Dreijer
Jeremy Sanders wrote: > Janto Dreijer wrote: > > > I want to measure the packet delivery delays over various network > > links. For this I need to synchronise the times of the sender and > > receiver, either against NTP or eachother. > > Couldn't you just use NTP itself to get the delivery delay? Y

Re: How ahead are you guys in the (Python) real world?

2006-08-29 Thread [EMAIL PROTECTED]
Ray wrote: > Since I haven't used Python at work, I am using Python 2.5 right now. > However I wonder, how fast are you guys moving from version to version > at work? As an illustration my ex-company just moved to Java 5, which > was released around... what, 2-3 years ago? (While I am running Java

SWIG wrapper/Python2.5c1 problem

2006-08-29 Thread andrew . gregory
If compiling a SWIG wrapper with MinGW 3.2.3 (Windows) get the following compilation error: pyprog_wrap.cxx: In function `int SWIG_Python_ConvertFunctionPtr(PyObject*, void**, swig_type_info*)': pyprog_wrap.cxx:2051: invalid conversion from `const char*' to `char*' Extract from wrapper: /* Co

distributing modules to machines

2006-08-29 Thread r1pp3r
I'm in the the process of designing a build system written in python. It runs from a central server with various build machines hosting server processes, written in Python. Pyro is the chosen RPC mechanism. What I would like to do is have the system update itself on demand. In other words, pass pic

Re: How to let a loop run for a while before checking for break condition?

2006-08-29 Thread Fredrik Lundh
Sorin Schwimmer wrote: > I am thinking on something in the following form: > > > import time > import thread > > delay=True > > def fn() > global delay > time.sleep() > delay=False > > thread.start_new_thread(fn,()) > > while delay: > > > ... if the loop calls out to python funct

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-29 Thread DH
Fredrik Lundh wrote: > alf wrote: > >> ok, let me clarify, by M$ I meant Micro$oft. > > http://www.catb.org/~esr/faqs/smart-questions.html#writewell > > > And by /F, you mean fuck off? http://www.libervis.com/blogs/15/Jastiv/eric_raymond_and_the_rtfm_jerks http://www.codinghorror.com/blog/ar

Re: refering to base classes

2006-08-29 Thread Chaz Ginger
Jason wrote: > Chaz Ginger wrote: >> Chaz Ginger wrote: >>> glenn wrote: hi - Im quite new to python, wondering if anyone can help me understand something about inheritance here. In this trivial example, how could I modify the voice method of 'dog' to call the base class 'creatures'

Re: How to let a loop run for a while before checking for break condition?

2006-08-29 Thread Hendrik van Rooyen
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: 8<- Here are some more results, three runs without, and three with a comment in the body of the interesting loop: (a summary follows the detail) > python junk.py 0x501 Loop 1 Elapsed time is: 31.2168951035 L

Re: refering to base classes

2006-08-29 Thread Jason
Chaz Ginger wrote: > Chaz Ginger wrote: > > glenn wrote: > >> hi - Im quite new to python, wondering if anyone can help me understand > >> something about inheritance here. In this trivial example, how could I > >> modify the voice method of 'dog' to call the base class 'creatures' > >> voice meth

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-29 Thread Fredrik Lundh
alf wrote: > ok, let me clarify, by M$ I meant Micro$oft. http://www.catb.org/~esr/faqs/smart-questions.html#writewell -- http://mail.python.org/mailman/listinfo/python-list

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-29 Thread Gabriel Genellina
At Tuesday 29/8/2006 07:50, Joachim Durchholz wrote: Wikipedia says it's going from 2NlogN to N. If a sort is massively dominated by the comparison, that could give a speedup of up to 100% (approximately - dropping the logN factor is almost irrelevant, what counts is losing that factor of 2).

  1   2   >