Re: max(), sum(), next()

2008-09-06 Thread Steven D'Aprano
On Sat, 06 Sep 2008 00:33:25 -0400, Manu Hack wrote: > Actually it's even more natural to state sum([x]) = x, and this way you > can never conclude that sum([]) = 0 from there. But what you can say is that for any list L, sum(L) = sum(L + [0]). Therefore sum([]) = sum([] +[0]) = 0 -- Steven

wxPython problem

2008-09-06 Thread Peter Anderson
I am trying to teach myself how to program in Python and use wxPython for GUIs. I am using PyScripter, IDLE and EditPlus as my IDEs. I have experienced an odd problem where I run a script once and it runs fine. Run it again and I get an error and the script fails. If the script is run directly

Re: max(), sum(), next()

2008-09-06 Thread Manu Hack
On Sat, Sep 6, 2008 at 12:57 AM, castironpi <[EMAIL PROTECTED]> wrote: > On Sep 5, 9:20 pm, "Manu Hack" <[EMAIL PROTECTED]> wrote: >> On Fri, Sep 5, 2008 at 1:04 PM, castironpi <[EMAIL PROTECTED]> wrote: >> > On Sep 5, 3:28 am, "Manu Hack" <[EMAIL PROTECTED]> wrote: >> >> On Thu, Sep 4, 2008 at 4:2

Re: embed python in ms-word?

2008-09-06 Thread Gerhard Häring
oyster wrote: > In my ms-word documnet, there are some calculation whihc I have to > change due to different argumnet. is there any way to embed python > code in word, so that I can write the following as a macro or > something else, then the result (i.e. 2) is shown in the word > documnet? > > de

Re: wxPython problem

2008-09-06 Thread Stef Mientki
Peter Anderson wrote: I am trying to teach myself how to program in Python and use wxPython for GUIs. I am using PyScripter, IDLE and EditPlus as my IDEs. I have experienced an odd problem where I run a script once and it runs fine. Run it again and I get an error and the script fails. If the

Cancel instance create

2008-09-06 Thread Aigars Aigars
Good day, I want MyClass to perform some tests and if them fail, I do not want instance to be created. But in code I wrote instance is created and also has parameters, that it should not have in case of tests failure. Is there a way to perform tests in MyClass.__init__ and set instance to None

Re: use str as variable name

2008-09-06 Thread Fredrik Lundh
Marco Bizzarri wrote: Just a question: "generic functions" are not meant in the sense of "generic functions" of CLOS, am I right? >> it's meant in exactly that sense: len(L) means "of all len() implementations available to the runtime, execute the most specific code we have for the object L".

Re: Cancel instance create

2008-09-06 Thread Fredrik Lundh
Aigars Aigars wrote: I want MyClass to perform some tests and if them fail, I do not want instance to be created. But in code I wrote instance is created and also has parameters, that it should not have in case of tests failure. Is there a way to perform tests in MyClass.__init__ and set in

Re: Cancel instance create

2008-09-06 Thread Mohamed Yousef
ًWhat about no Constructor , and a custom instancing function that can return either None or the instance wanted -- http://mail.python.org/mailman/listinfo/python-list

Re: Cancel instance create

2008-09-06 Thread Diez B. Roggisch
Mohamed Yousef schrieb: ًWhat about no Constructor , and a custom instancing function that can return either None or the instance wanted That doesn't solve the underlying problem - the instance is created. Just because it wasn't *returned*, doesn't mean it isn't there. Diez -- http://mail.py

Re: Cancel instance create

2008-09-06 Thread Aigars Aigars
I do not want code outside my class to perform tests and decide to create instance or not. Fredrik Lundh's advice to rise exception works perfectly. Thanks to all, Aigars Quoting Mohamed Yousef : ًWhat about no Constructor , and a custom instancing function that can return either None or the ins

Re: quake like multicoloured text

2008-09-06 Thread Durand
On Sep 5, 10:32 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 05 Sep 2008 16:24:08 -0300, Durand <[EMAIL PROTECTED]> escribió: > > > > > > > I'm wondering how I could render text with PIL in which different > > parts of the text are different characters. This is for a game stats > >

Re: max(), sum(), next()

2008-09-06 Thread Ken Starks
castironpi wrote: On Sep 5, 9:20 pm, "Manu Hack" <[EMAIL PROTECTED]> wrote: On Fri, Sep 5, 2008 at 1:04 PM, castironpi <[EMAIL PROTECTED]> wrote: On Sep 5, 3:28 am, "Manu Hack" <[EMAIL PROTECTED]> wrote: On Thu, Sep 4, 2008 at 4:25 PM, castironpi <[EMAIL PROTECTED]> wrote: On Sep 4, 2:42 pm,

Re: max(), sum(), next()

2008-09-06 Thread Ken Starks
castironpi wrote: On Sep 5, 9:20 pm, "Manu Hack" <[EMAIL PROTECTED]> wrote: On Fri, Sep 5, 2008 at 1:04 PM, castironpi <[EMAIL PROTECTED]> wrote: On Sep 5, 3:28 am, "Manu Hack" <[EMAIL PROTECTED]> wrote: On Thu, Sep 4, 2008 at 4:25 PM, castironpi <[EMAIL PROTECTED]> wrote: On Sep 4, 2:42 pm,

Re: embed python in ms-word?

2008-09-06 Thread oyster
in fact, during my work, I often write documnets in ms-word. But the doc has many numbers in it, which need to be calculated and to be modified frequently. Is there a method to write a ms-word add-in, so that 1.I can type in the calculation steps in some program language, please have a look at htt

Re: why is self not passed to id()?

2008-09-06 Thread Ruediger
I found following solution to the problem. Instead of assigning id directly to __hash__ it has to be wrapped with an instancemethod object. It is somehow strange that this doesn't happen automatically and it is also strange that instancemethod isn't exposed in the type module. However it can easi

Re: embed python in ms-word?

2008-09-06 Thread Diez B. Roggisch
oyster schrieb: in fact, during my work, I often write documnets in ms-word. But the doc has many numbers in it, which need to be calculated and to be modified frequently. Is there a method to write a ms-word add-in, so that 1.I can type in the calculation steps in some program language, please

Re: running python as a dameon

2008-09-06 Thread Michael Palmer
On Sep 5, 9:56 pm, Sean Davis <[EMAIL PROTECTED]> wrote: > > What I want > > to do is to provide the python NLP program as a service to any other > > PHP/Java/Ruby process request. So the mapping is > > > http -> apache -> PHP/Java/Ruby/... -> Python NLP > > Why not use a simple CGI script or wsgi

How to bring subprocess to the foreground?

2008-09-06 Thread dudeja . rajat
Hi, I've a batch file that I open with the subprocess .Popen() . When this batch file is run I want to bring it to the foreground. Please suggest how can I do this? Regards, Rajat -- http://mail.python.org/mailman/listinfo/python-list

Re: How to bring subprocess to the foreground?

2008-09-06 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: Hi, I've a batch file that I open with the subprocess .Popen() . When this batch file is run I want to bring it to the foreground. Please suggest how can I do this? You can't. You can capture the stdout using the pipe-arguments, and in your main-process, read that

Re: wxPython problem

2008-09-06 Thread Peter Anderson
Stef Mientki said: In PyScripter, you should run wxPython in the plain remote machine (not the wxPython remote),and you should set "reset before run flag" or reset the remote machine each time yourself. Stef, Thanks for the help! It has taken several hours to find and install the correct vers

Re: max(), sum(), next()

2008-09-06 Thread Mel
Steven D'Aprano wrote: > On Sat, 06 Sep 2008 00:33:25 -0400, Manu Hack wrote: > >> Actually it's even more natural to state sum([x]) = x, and this way you >> can never conclude that sum([]) = 0 from there. > > But what you can say is that for any list L, sum(L) = sum(L + [0]). > > Therefore sum

Canonical way to build Python 2.6/svn on MacIntel/MacOSX10.5 with icc 32bits 10.1.014

2008-09-06 Thread Mathieu Prevot
Hi, I would like to build Python (svn) on Macosx 10.5 with icc in /opt/intel/cc (32 bit). Can you help me to determine the right way to do this ? I got a prototype with: export CC=icc export CXX=icpc export CFLAGS="-w" ./configure --with-framework-name=PythonIntel 1) It seems to be unsufficient

Re: How to bring subprocess to the foreground?

2008-09-06 Thread dudeja . rajat
On Sat, Sep 6, 2008 at 3:13 PM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: >> >> Hi, >> >> I've a batch file that I open with the subprocess .Popen() . When this >> batch file is run I want to bring it to the foreground. >> >> Please suggest how can I do this? > > You

[matplotlib] Overlapping axis text

2008-09-06 Thread Durand
I got a really annoying problem with datetime graphs. The problem is that with a long range time graph, the text on the x axis keeps overlapping like here: http://durand.zephyrhosting.net/tremcs/graph_all.png Would there be any way to fix this? I was thinking of rotating the text so that there was

Re: Overlapping axis text

2008-09-06 Thread Durand
Err...made a mistake there. days= WeekdayLocator() # every monday months = MonthLocator() # every month That doesn't change my question though. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Calling global functions from a class?

2008-09-06 Thread Robert Dailey
HI, I have the following python script: def __normalizePath( path ): return osp.abspath( osp.normpath( path ) ) class AbsolutePath: def __init__( self, root="" ): _root = __normalizePath( root ) When I create an AbsolutePath object, I get the following error: NameError: globa

Want to display a message box while subprocess is running

2008-09-06 Thread dudeja . rajat
Hi, I m using subprocess module and using the Popen call. While the subprocess if running, I want to display a tkMessageBox(). Does some one has a sample code for this? Thanks and regards, Rajat -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling global functions from a class?

2008-09-06 Thread Fredrik Lundh
Robert Dailey wrote: I have the following python script: def __normalizePath( path ): return osp.abspath( osp.normpath( path ) ) class AbsolutePath: def __init__( self, root="" ): _root = __normalizePath( root ) When I create an AbsolutePath object, I get the following er

Failure in building ctypes with intel icc

2008-09-06 Thread Mathieu Prevot
Hi, I got this error in compilation, and I don't know how to solve it: *** WARNING: renaming "_ctypes" since importing it failed: dlopen(build/lib.macosx-10.3-i386-2.6/_ctypes.so, 2): Symbol not found: ___builtin_dwarf_cfa Referenced from: /Users/mathieuprevot/svn/python/build/lib.macosx-10.3-i

Re: Cancel instance create

2008-09-06 Thread Terry Reedy
Fredrik Lundh wrote: Aigars Aigars wrote: I want MyClass to perform some tests and if them fail, I do not want instance to be created. If you do not want the instance created at all, you would have to write a custom .__new__ method, but that is tricky, something I would have to look up ho

Re: How to bring subprocess to the foreground?

2008-09-06 Thread Paul Boddie
On 6 Sep, 17:58, [EMAIL PROTECTED] wrote: > > I though of displayin an information message on the screen through > tkMessageBox while the subprocess is running, I did it using: > > try: > testing = subprocess.Popen([batchFilePath], \ >shell = True) >

Re: why is self not passed to id()?

2008-09-06 Thread Terry Reedy
Ruediger wrote: I found following solution to the problem. Instead of assigning id directly to __hash__ it has to be wrapped with an instancemethod object. It is somehow strange that this doesn't happen automatically and it is also strange that instancemethod isn't exposed in the type module.

Re: max(), sum(), next()

2008-09-06 Thread Mensanator
On Sep 5, 10:45�pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 05 Sep 2008 22:20:06 -0400, Manu Hack wrote: > > On Fri, Sep 5, 2008 at 1:04 PM, castironpi <[EMAIL PROTECTED]> wrote: > [The rest of this is (mostly) aimed at Mensanator, Ok, I see where you're coming f

Re: How to bring subprocess to the foreground?

2008-09-06 Thread dudeja . rajat
On Sat, Sep 6, 2008 at 6:53 PM, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 6 Sep, 17:58, [EMAIL PROTECTED] wrote: >> >> I though of displayin an information message on the screen through >> tkMessageBox while the subprocess is running, I did it using: >> >> try: >> testing = subprocess

How to run PyOS_InputHook from python code (i.e. yield to event loops)

2008-09-06 Thread Ville M. Vainio
Background: PyOS_InputHook is something that gets run when python is doing raw_input. TkInter and friends use it to run their event loops, so that their events are handled while python is doing raw_input. What I'd like to do is run the same function without having to do raw_input. I.e. I'd like to

Re: running python as a dameon

2008-09-06 Thread kaer
On 6 sep, 15:44, Michael Palmer <[EMAIL PROTECTED]> wrote: > On Sep 5, 9:56 pm, Sean Davis <[EMAIL PROTECTED]> wrote: > > > > > > What I want > > > to do is to provide the python NLP program as a service to any other > > > PHP/Java/Ruby process request. So the mapping is > > > > http -> apache -> P

Re: List of modules available for import inside Python?

2008-09-06 Thread clurker
Michele Simionato wrote: > On Aug 28, 6:21 am, ssecorp <[EMAIL PROTECTED]> wrote: >> Is there a way to view all the modules I have available for import >> from within Python? >> Like writing in the interpreter: > > Try: > help() > help> modules > Please wait a moment while I gather a list o

Re: running python as a dameon

2008-09-06 Thread kaer
On 6 sep, 22:16, kaer <[EMAIL PROTECTED]> wrote: > On 6 sep, 15:44, Michael Palmer <[EMAIL PROTECTED]> wrote: > > > > > On Sep 5, 9:56 pm, Sean Davis <[EMAIL PROTECTED]> wrote: > > > > > What I want > > > > to do is to provide the python NLP program as a service to any other > > > > PHP/Java/Ruby p

How to merge a module into a package w/ distutils?

2008-09-06 Thread skip
The bsddb module is on the way out (deprecated in 2.6, gone in 3.0). That leaves Python without a cross-platform dbm module to sit underneath anydbm and shelve. I figured it might be useful to base something on top of sqlite3, which is cross-platform. The result is available in the Python sandbo

String/Number Conversion

2008-09-06 Thread Andreas Hofmann
Hello Folks! I've got a little problem here, which which really creeps me out at the moment. I've got some strings, which only contain numbers plus eventually one character as si-postfix (k for kilo, m for mega, g for giga). I'm trying to convert those strings to integers, with this function:

Re: String/Number Conversion

2008-09-06 Thread josh logan
On Sep 6, 5:04 pm, Andreas Hofmann <[EMAIL PROTECTED]> wrote: > Hello Folks! > > I've got a little problem here, which which really creeps me out at the > moment. > I've got some strings, which only contain numbers plus eventually one > character as si-postfix (k for kilo, m for mega, g for giga).

Re: How to write verbose scripts

2008-09-06 Thread Lie
On Sep 3, 6:31 pm, Uwe Schmitt <[EMAIL PROTECTED]> wrote: > On 2 Sep., 18:55, Steven D'Aprano <[EMAIL PROTECTED] > > > > cybersource.com.au> wrote: > > I find myself writing command line tools in Python where I wish to > > include "verbose" output to stdout. > > > I start with a helper function: >

Re: String/Number Conversion

2008-09-06 Thread Wojtek Walczak
On Sat, 06 Sep 2008 23:04:14 +0200, Andreas Hofmann wrote: Hi, > I've got a little problem here, which which really creeps me out at the > moment. > I've got some strings, which only contain numbers plus eventually one > character as si-postfix (k for kilo, m for mega, g for giga). I'm trying

Re: String/Number Conversion

2008-09-06 Thread John Machin
On Sep 7, 7:04 am, Andreas Hofmann <[EMAIL PROTECTED]> wrote: > Hello Folks! > > I've got a little problem here, which which really creeps me out at the > moment. > I've got some strings, which only contain numbers plus eventually one > character as si-postfix (k for kilo, m for mega, g for giga).

Re: String/Number Conversion

2008-09-06 Thread John Machin
On Sep 7, 7:29 am, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > On Sat, 06 Sep 2008 23:04:14 +0200, Andreas Hofmann wrote: > >                  if mult is 1: > >                            ^^ > You're testing for identity, not for equality. > Change it to "if mult == 1". Is it alright now? > Althou

Re: String/Number Conversion

2008-09-06 Thread bearophileHUGS
Andreas Hofmann, there are several problems in your code: > if type(value) is str: Better to use isinstance() and to compare it with basestring instead. > value.upper() This does nothing, python strings are immutable, so they don't get changed in-place, so you have to

modules path

2008-09-06 Thread Python
Hi there, I moved a few modules into the modules folder (on OSX: /opt/local/lib/ python2.5/site-packages/). They don't show up though when I start IDLE... Is there a way to reload the modules folders in sys.path without logging out and back in? something like "source .cshrc" in a shell...

Re: String/Number Conversion

2008-09-06 Thread Andreas Hofmann
Thanks a lot, I got it working now. Thanks also to the other guys, your numerous hints were really valuable! Kind regards, Andy John Machin schrieb: On Sep 7, 7:04 am, Andreas Hofmann <[EMAIL PROTECTED]> wrote: Hello Folks! I've got a little problem here, which which really creeps me out at t

RE: Xpath for HTML processing

2008-09-06 Thread bruce
Hi Astley I can probably help here. Can you tell me exactly what you're trying to accomplish. the xpath query that you listed can be processed using libxml2dom (and a fewo other libs) are you looking to parse a web page, an xml doc, etc... let me know, and we'll see if we can help -Origi

Directory creation

2008-09-06 Thread srinivasan srinivas
Can someone tell me is there any module available to create directories?? I tried os, tempfile. I was facing some issues with os.mkdir(). The mode setting was not proper with this method. I created the directory 'stdin' with '0700' mode using os.mkdir() method. $> ls -alR stdin/ stdin/: total 1

found a bug with smtpd, where can i report this?

2008-09-06 Thread Marcus.CM
Hi, Where should i report the bug? smtpd bug. Marcus.CM -- http://mail.python.org/mailman/listinfo/python-list

Learning Python

2008-09-06 Thread James Pilling
Hi im currently starting to learn python in sixth form at school any tips? GET FREE 5GB EMAIL - Check out spam free email with many cool features! Visit http://www.inbox.com/email to find out more! -- http://mail.python.org/mailman/listi

Re: max(), sum(), next()

2008-09-06 Thread Hendrik van Rooyen
"David C. Ullrich" wrote: >Think about all the previously elected female or black >presidents of the US. Which one was the tallest? The current King of France? - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: atomic section in code

2008-09-06 Thread Hendrik van Rooyen
Fredrik Lundh wrote: >sounds like he wants/needs non-cooperative, mandatory locking. Could one get there using ctypes to disable interrupts? Cross Platform? I can think of lots of hassles, starting with permissions to use the privileged instructions. - Hendrik -- http://mail.python.org/mai

Use BeautifulSoup to delete certain tag while keeping its content

2008-09-06 Thread Jackie Wang
Dear all, I have the following html code: Center Bank Los Angeles, CA Salisbury Bank and Trust Company Lakeville, CT How should I delete the 'font' tags while keeping the content inside? Ideally I want to get: Center Bank Los Angeles, CA Salisbury

Multicore-programming?

2008-09-06 Thread cnb
If I buy a multicore computer and I have really intensive program. How would that be distributed across the cores? Will algorithms always have to be programmed and told specifically to run on several cores so if not told it will only utilize one core? So is the free lunch really over or is this j

Cathing several potential errors?

2008-09-06 Thread cnb
if i do try: something except TypeError, IndexError: pass only the first error will get caught. I dont want to use Exception and catch all errors, but just 2. how can i do that? -- http://mail.python.org/mailman/listinfo/python-list

Re: modules path

2008-09-06 Thread John Machin
On Sep 7, 8:03 am, Python <[EMAIL PROTECTED]> wrote: > Hi there, > > I moved a few modules into the modules folder (on OSX: /opt/local/lib/ > python2.5/site-packages/). > They don't show up though when I start IDLE... > > Is there a way to reload the modules folders in sys.path without   > logging

Re: String/Number Conversion

2008-09-06 Thread Scott David Daniels
Andreas Hofmann wrote: I've got some strings, which only contain numbers plus eventually one character as si-postfix (k for kilo, m for mega, g for giga). I'm trying to convert those strings to integers, with this function: Why bother to always switch the case if you only use a few values? Als

Re: Cathing several potential errors?

2008-09-06 Thread Wojtek Walczak
On Sat, 6 Sep 2008 15:13:45 -0700 (PDT), cnb wrote: > if i do > try: > something > except TypeError, IndexError: > pass Parenthesize them: except (TypeError, IndexError): -- Regards, Wojtek Walczak, http://tosh.pl/gminick/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Cathing several potential errors?

2008-09-06 Thread John Machin
On Sep 7, 8:13 am, cnb <[EMAIL PROTECTED]> wrote: > if i do > try: >     something > except TypeError, IndexError: >     pass > > only the first error will get caught. I dont want to use Exception and > catch all errors, but just 2. how can i do that? The syntax for what you can have between "exce

Re: Learning Python

2008-09-06 Thread subeen
On Sep 6, 3:17 pm, James Pilling <[EMAIL PROTECTED]> wrote: > Hi im currently starting to learn python in sixth form at school any tips? > Just pickup a good book and make sure you code all the examples and exercises yourself, even if it seems easy. Have fun with Python! regards, Subeen. http://l

Re: Multicore-programming?

2008-09-06 Thread Terry Reedy
cnb wrote: If I buy a multicore computer and I have really intensive program. How would that be distributed across the cores? Will algorithms always have to be programmed and told specifically to run on several cores so if not told it will only utilize one core? I believe that has always bee

Re: Cathing several potential errors?

2008-09-06 Thread Gary Josack
cnb wrote: if i do try: something except TypeError, IndexError: pass only the first error will get caught. I dont want to use Exception and catch all errors, but just 2. how can i do that? -- http://mail.python.org/mailman/listinfo/python-list what you're doing is assigning the value

Re: Multicore-programming?

2008-09-06 Thread Paul Boddie
On 7 Sep, 00:06, cnb <[EMAIL PROTECTED]> wrote: > If I buy a multicore computer and I have really intensive program. How > would that be distributed across the cores? It typically depends on how the work done by the program is performed. > Will algorithms always have to be programmed and told spe

Re: Multicore-programming?

2008-09-06 Thread John Machin
On Sep 7, 8:06 am, cnb <[EMAIL PROTECTED]> wrote: > If I buy a multicore computer and I have really intensive program. How > would that be distributed across the cores? AFAIK, a single process wouldn't be distributed automatically. > Will algorithms always have to be programmed and told specifica

RE: Use BeautifulSoup to delete certain tag while keeping its content

2008-09-06 Thread bruce
hi jackie, if you don't mind... can i ask what you're looking to accomplish? are you looking to simply get the text/string data, or something else??? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Jackie Wang Sent: Saturday, September 06, 2008 8:12 AM To:

Re: Numeric literal syntax

2008-09-06 Thread Alan G Isaac
[EMAIL PROTECTED] writes: For Python 2.7/3.1 I'd now like to write a PEP regarding the underscores into the number literals, like: 0b_0101_, 268_435_456 etc. +1 on such a capability. -1 on underscore as the separator. On 9/1/2008 9:13 PM Ben Finney apparently wrote: When you proposed

Re: modules path

2008-09-06 Thread Python
On 7 sep 2008, at 00:25, John Machin wrote: On Sep 7, 8:03 am, Python <[EMAIL PROTECTED]> wrote: Hi there, I moved a few modules into the modules folder (on OSX: /opt/local/ lib/ python2.5/site-packages/). They don't show up though when I start IDLE... Is there a way to reload the modules

Re: Learning Python

2008-09-06 Thread Colin J. Williams
James Pilling wrote: Hi im currently starting to learn python in sixth form at school any tips? GET FREE 5GB EMAIL - Check out spam free email with many cool features! Visit http://www.inbox.com/email to find out more! There are sugges

Re: Seeking ideas for a cron implementation

2008-09-06 Thread Karthik Gurusamy
On Aug 22, 1:51 pm, Sean DiZazzo <[EMAIL PROTECTED]> wrote: > On Aug 22, 1:30 pm, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > I'm working on acronlike functionality for my application. > > The outer loops runs continuously waking every x seconds (say x=180, > > 300, ..). > > It

Re: Use BeautifulSoup to delete certain tag while keeping its content

2008-09-06 Thread Paul Boddie
On 6 Sep, 17:11, "Jackie Wang" <[EMAIL PROTECTED]> wrote: > > I have the following html code: > > > > Center Bank > > Los Angeles, CA > > > > > > Salisbury > Bank and Trust Company > > >Lakeville, CT > > > > > How should I delete the 'font' tags while keeping the

Setter Propertys' mro?

2008-09-06 Thread cipher
Whats the mro (method resolution order) of a setter property (__set__ on a descriptor). i seem to be experiencing some weird issue with them. for example >>> class test: ... def _test(self): ... return 4 ... def _stest(self):pass # dont change value ... def _dtest(self,value):pass ... p=prop

Re: found a bug with smtpd, where can i report this?

2008-09-06 Thread cipher
On Sep 5, 4:01 am, "Marcus.CM" <[EMAIL PROTECTED]> wrote: > Hi, > > Where should i report the bug? > smtpd bug. > > Marcus.CM http://bugs.python.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2008-09-06 Thread Peter Anderson
James, I have several Python books and am currently working my way through John Zelle's PYTHON PROGRAMMING: An Introduction to Computer Science (Publisher: Franklin, Beedle & Associates, ISBN-10: 1887902996, ISBN-13: 978-1887902991). I think this is a very good introduction to both Python AND

Re: Setter Propertys' mro?

2008-09-06 Thread Tommy Grav
On Sep 6, 2008, at 9:15 PM, cipher wrote: Whats the mro (method resolution order) of a setter property (__set__ on a descriptor). i seem to be experiencing some weird issue with them. for example class test: You have to use class test(object). Only new style classes accepts properties. C

Re: atomic section in code

2008-09-06 Thread Tim Roberts
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > >Fredrik Lundh wrote: > >>sounds like he wants/needs non-cooperative, mandatory locking. More accurately, he THINKS he wants/needs mandatory locking. We need to find out what he's really trying to accomplish before we can suggest something that i

Re: Determining Processor Vender

2008-09-06 Thread Tim Roberts
aha <[EMAIL PROTECTED]> wrote: > >Dose anyone know of a cross-platform method for determining the vendor >of a processor? Under linux I can check /proc/cpuinfo. What I'd like >to be able to do is determine if a processor is AMD or Intel, so that >I can use the appropriate numerical libraries for

Re: Multicore-programming?

2008-09-06 Thread Tim Roberts
cnb <[EMAIL PROTECTED]> wrote: > >So is the free lunch really over or is this just an overhyped >phenomena? Remember that your computer is not running one single program. An idle computer on either Windows or Linux typically has dozens of processes running. Even if all of those programs are sing

Re: Numeric literal syntax

2008-09-06 Thread Steven D'Aprano
On Sat, 06 Sep 2008 23:30:03 +, Alan G Isaac wrote: >> [EMAIL PROTECTED] writes: >> >>> For Python 2.7/3.1 I'd now like to write a PEP regarding the >>> underscores into the number literals, like: 0b_0101_, 268_435_456 >>> etc. >> >> +1 on such a capability. >> >> -1 on underscore as th

Re: max(), sum(), next()

2008-09-06 Thread Steven D'Aprano
On Sat, 06 Sep 2008 11:22:07 -0700, Mensanator wrote: [...] >> They could have decided that sum must take at least two arguments, >> because addition requires two arguments and it's meaningless to talk >> about adding a single number without talking about adding it to >> something else. But they

Re: Setter Propertys' mro?

2008-09-06 Thread Steven D'Aprano
On Sat, 06 Sep 2008 18:15:33 -0700, cipher wrote: > Whats the mro (method resolution order) of a setter property (__set__ on > a descriptor). > i seem to be experiencing some weird issue with them. for example > class test: Unless you're using Python 3, there's your problem right there. In

Mail delivery problems

2008-09-06 Thread Peter Anderson
In the last two days I have posted relies twice to the Python List. Each time my e-mail has listed successfully but I have received a reply like the following: This is an automatically generated Delivery Status Notification. Delivery to the following recipients failed. [EMAIL PROTECT

Re: Multicore-programming?

2008-09-06 Thread sturlamolden
On 7 Sep, 00:06, cnb <[EMAIL PROTECTED]> wrote: > If I buy a multicore computer and I have really intensive program. How > would that be distributed across the cores? Distribution of processes and threads across processors (cores or CPUs) is managed by the operating system. > Will algorithms al

Re: Multicore-programming?

2008-09-06 Thread sturlamolden
On 7 Sep, 06:24, sturlamolden <[EMAIL PROTECTED]> wrote: > - Psyco, a Python JIT compiler, will often speed up algorithmic code. > Using psyco require to change to your code. Typo. It should say "Using psyco does not require you to change your code." -- http://mail.python.org/mailman/listinfo/pyt

Re: Setter Propertys' mro?

2008-09-06 Thread cipher
On Sep 6, 9:10 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sat, 06 Sep 2008 18:15:33 -0700, cipher wrote: > > Whats the mro (method resolution order) of a setter property (__set__ on > > a descriptor). > > i seem to be experiencing some weird issue with them. for example

This group contains information about IT Requirements in USA as well as Hotlist of Candidates from the participating members

2008-09-06 Thread reddy
This group contains information about IT Requirements in USA as well as Hotlist of Candidates from the participating members CLICK & REGISTER U GET MORE DEDAILS * * http://homologie.blogspot.c

Re: delete an HTML tag while keeping its content

2008-09-06 Thread Stefan Behnel
[fixing the subject appropriately] Jackie Wang wrote: > How should I delete the 'font' tags while keeping the content inside? Amongst many other goodies for working with HTML, the Elements in lxml.html have a ".drop_tag()" method specifically for that purpose. http://codespeak.net/lxml/ Stefan