Re: What's "the standard" for code docs?

2008-02-15 Thread John Nagle
Preston Landers wrote: > Hey guys and gals. What are all the cool kids using these days to > document their code? HTML. Text-only docs are so last-cen. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Help Parsing an HTML File

2008-02-15 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > I have a single unicode file that has descriptions of hundreds of > objects. The file fairly resembles HTML-EXAMPLE pasted below. > > I need to parse the file in such a way to extract data out of the html > and to come up with a tab separated file that would look like O

Re: XML pickle

2008-02-15 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > On Feb 15, 11:10 am, [EMAIL PROTECTED] wrote: Can you use set( '{ss}Type' ) somehow? >>> What is 'ss' here? A prefix? >>> What about actually reading the tutorial? >>> http://codespeak.net/lxml/tutorial.html#namespaces And any way to make this look closer t

Where can I get the module MyUtils?

2008-02-15 Thread Python_Doctor
I inherited a piece of python code which imports "MyUtils" i.e. it has a line: import MyUtils When I execute the code I get: ImportError: No module named MyUtils I assume the code is looking for another module called MyUtils.py. Is this a standard Python module? Where can I download this module

Re: Solve a Debate

2008-02-15 Thread Steve Holden
Dan Bishop wrote: > On Feb 15, 10:24 am, nexes <[EMAIL PROTECTED]> wrote: >> Alright so me and my friend are having argument. >> >> Ok the problem we had been asked a while back, to do a programming >> exercise (in college) >> That would tell you how many days there are in a month given a >> specif

Re: Hairy brainstorm

2008-02-15 Thread castironpi
On Feb 15, 8:04 pm, [EMAIL PROTECTED] wrote: > Hold the future holds effectively nothing for single-threaded > programs; single-core PUs have reached the point of diminishing > returns of circuit size and IC design; thinking multi-threaded's the > way to go. > > Recognizing that even in event-drive

Re: Passing a callable object to Thread

2008-02-15 Thread Paul Rubin
Jeff Schwab <[EMAIL PROTECTED]> writes: > > The idea is that a 2-tuple (of numbers, say) is a pair of numbers, a > > 3-tuple is three numbers, and a 1-tuple is one number. That would > > mean a number and a 1-tuple of numbers are the same thing, not > > separate types. > > No, that doesn't follow

Re: Passing a callable object to Thread

2008-02-15 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> Why not? They seem intuitive to me. I would find it weird if you >> couldn't have 0-tuple, and even weirder if you couldn't have a >> 1-tuple. Maybe my brain has been warped by too much C++ code. > > The idea is that a 2-tuple (of

Re: Passing a callable object to Thread

2008-02-15 Thread Paul Rubin
Jeff Schwab <[EMAIL PROTECTED]> writes: > Why not? They seem intuitive to me. I would find it weird if you > couldn't have 0-tuple, and even weirder if you couldn't have a > 1-tuple. Maybe my brain has been warped by too much C++ code. The idea is that a 2-tuple (of numbers, say) is a pair of

Re: returning regex matches as lists

2008-02-15 Thread Jonathan Lukens
On Feb 15, 8:31 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 15 Feb 2008 19:25:59 -0200, Jonathan Lukens > <[EMAIL PROTECTED]> escribió: > > > > >> What would you like to see instead? > > > I had mostly just expected that there was some method that would > > return each entire match

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Paul Rubin
Jeff Schwab <[EMAIL PROTECTED]> writes: > > They really do not. The extended real line can be modelled in set > > theory, but the "infinity" in it is not a cardinal as we would > > normally treat them in set theory. > > Georg Cantor disagrees. Whether Aleph 1 is the cardinality of the set > of r

Re: Passing a callable object to Thread

2008-02-15 Thread Jeff Schwab
Steve Holden wrote: > Paul Rubin wrote: >> Steve Holden <[EMAIL PROTECTED]> writes: >>> Assuming you're right, what alternative would you suggest? Would it >>> allow parenthesized expressions to retain their customary meaning? >> >> It is kind of weird that there is even such a thing as a 1-tuple.

Re: Solve a Debate

2008-02-15 Thread Dan Bishop
On Feb 15, 10:24 am, nexes <[EMAIL PROTECTED]> wrote: > Alright so me and my friend are having argument. > > Ok the problem we had been asked a while back, to do a programming > exercise (in college) > That would tell you how many days there are in a month given a > specific month. > > Ok I did my

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Jeff Schwab
Paul Rubin wrote: > Mark Dickinson <[EMAIL PROTECTED]> writes: >>> But the IEEE standard only supports one of them, aleph(0). >>> Technically two: plus and minus aleph(0). >> Not sure that alephs have anything to do with it. > > They really do not. The extended real line can be modelled in set >

Re: Passing a callable object to Thread

2008-02-15 Thread Steve Holden
Paul Rubin wrote: > Steve Holden <[EMAIL PROTECTED]> writes: >> Assuming you're right, what alternative would you suggest? Would it >> allow parenthesized expressions to retain their customary meaning? > > It is kind of weird that there is even such a thing as a 1-tuple. I agree that zero-length

Re: Passing a callable object to Thread

2008-02-15 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > Assuming you're right, what alternative would you suggest? Would it > allow parenthesized expressions to retain their customary meaning? It is kind of weird that there is even such a thing as a 1-tuple. -- http://mail.python.org/mailman/listinfo/python-l

Re: Passing a callable object to Thread

2008-02-15 Thread Carsten Haese
On Fri, 2008-02-15 at 19:21 -0800, Benjamin wrote: > You could type args=tuple("data/w7/"). That will produce an 8-tuple containing single-character strings, not a 1-tuple containing one string. -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mailman/listinfo/pyth

Re: RELEASED Python 2.5.2, release candidate 1

2008-02-15 Thread Anthony Baxter
On Feb 15, 2008 11:27 AM, Terry Reedy <[EMAIL PROTECTED]> wrote: > So, thanks to Martin for trying on the release manager role, and looking > forward to [ANN] Python 2.5.2 released. Hear, hear! Thanks to Martin for getting this out, and apologies from me that it didn't happen sooner. -- http://ma

Re: Passing a callable object to Thread

2008-02-15 Thread Benjamin
On Feb 15, 6:51 pm, skawaii <[EMAIL PROTECTED]> wrote: > On Feb 15, 7:23 pm, Paul Rubin wrote: > > > t = th.Thread(target=tribalwars.populate_all_tribes, args=("data/w7/",)) > > Thanks, that did it. After playing around in the interpreter a bit, I > realize now that args

Re: Passing a callable object to Thread

2008-02-15 Thread Steve Holden
skawaii wrote: > On Feb 15, 7:23 pm, Paul Rubin wrote: >> t = th.Thread(target=tribalwars.populate_all_tribes, args=("data/w7/",)) > > Thanks, that did it. After playing around in the interpreter a bit, I > realize now that args=("data/w7/") doesn't create a tuple, like

Re: Help Parsing an HTML File

2008-02-15 Thread 7stud
On Feb 15, 2:28 pm, [EMAIL PROTECTED] wrote: > Hello Python Community, > > It'd be great if someone could provide guidance or sample code for > accomplishing the following: > > I have a single unicode file that has  descriptions of hundreds of > objects. The file fairly resembles HTML-EXAMPLE paste

Re: Solve a Debate

2008-02-15 Thread castironpi
On Feb 15, 12:32 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-02-15, Ivan Van Laningham <[EMAIL PROTECTED]> wrote: > > > Lookup tables are always significantly faster than a bunch of > > ifs. > > Mostly always.  It depends on what you mean by "lookup table", > and it depends on how the la

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Paul Rubin
Mark Dickinson <[EMAIL PROTECTED]> writes: > > But the IEEE standard only supports one of them, aleph(0). > > Technically two: plus and minus aleph(0). > > Not sure that alephs have anything to do with it. They really do not. The extended real line can be modelled in set theory, but the "infinit

Re: seperate directory for .pyc files

2008-02-15 Thread Jeff Schwab
Amit Gupta wrote: > Python'ites > > Is there an environment variable or some settings, that python can use > to know the directory name for dumping .pyc files. > > Not a hard-requirement, I just don't like pyc files alongwith py files > in my work area. Does this help? # ls.py import subprocess

Hairy brainstorm

2008-02-15 Thread castironpi
Hold the future holds effectively nothing for single-threaded programs; single-core PUs have reached the point of diminishing returns of circuit size and IC design; thinking multi-threaded's the way to go. Recognizing that even in event-driven programs, order of execution is important, what does a

Re: call 'the following function' using decorators

2008-02-15 Thread castironpi
> > > > I assert it's easier to write: > > > > > start_new_thread( this_func ) > > > > def thrA(): > > > >     normal_suite() > > > > > than > > > > > def thrA(): > > > >     normal_suite() > > > > start_new_thread( thrA ) > > > > > If you don't, stop reading. Nothing beats if forkthread(): but wh

Re: seperate directory for .pyc files

2008-02-15 Thread Gabriel Genellina
En Fri, 15 Feb 2008 23:11:28 -0200, Amit Gupta <[EMAIL PROTECTED]> escribió: > Is there an environment variable or some settings, that python can use > to know the directory name for dumping .pyc files. No. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: sockets -- basic udp client

2008-02-15 Thread Gabriel Genellina
En Fri, 15 Feb 2008 20:24:19 -0200, 7stud <[EMAIL PROTECTED]> escribió: > My question pertains to this example: > > #!/usr/bin/env python > > import socket, sys, time > > host = sys.argv[1] > textport = sys.argv[2] > > s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) > try: > port = int(

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Mark Dickinson
On Feb 15, 7:59 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 15 Feb 2008 14:35:34 -0500, Steve Holden wrote: > >> I don't understand: why would +INF not be equal to itself? Having INF > >> == INF be True seems like something that makes sense both > >> mathematically

Re: returning regex matches as lists

2008-02-15 Thread Gabriel Genellina
En Fri, 15 Feb 2008 19:25:59 -0200, Jonathan Lukens <[EMAIL PROTECTED]> escribió: >> What would you like to see instead? > > I had mostly just expected that there was some method that would > return each entire match as an item on a list. I have this pattern: > import re corporate_nam

Re: Floating point bug?

2008-02-15 Thread Jeff Schwab
Steven D'Aprano wrote: > On Fri, 15 Feb 2008 10:55:47 -0800, Zentrader wrote: > >> I disagree with this statement >> But that doesn't change the fact that it will expose the same >> rounding-errors as floats do - just for different numbers. The >> example used has no rounding errors. > > Of cour

Re: returning regex matches as lists

2008-02-15 Thread Gabriel Genellina
En Fri, 15 Feb 2008 17:07:21 -0200, Jonathan Lukens <[EMAIL PROTECTED]> escribió: > I am in the last phase of building a Django app based on something I > wrote in Java a while back. Right now I am stuck on how to return the > matches of a regular expression as a list *at all*, and in particula

seperate directory for .pyc files

2008-02-15 Thread Amit Gupta
Python'ites Is there an environment variable or some settings, that python can use to know the directory name for dumping .pyc files. Not a hard-requirement, I just don't like pyc files alongwith py files in my work area. Thanks A -- http://mail.python.org/mailman/listinfo/python-list

Re: Assignment saves time?

2008-02-15 Thread Steven D'Aprano
On Fri, 15 Feb 2008 12:51:19 -0800, rpglover64 wrote: > I ran it in an interactive python shell, which might have made a > difference. > > import timeit > time1=timeit.Timer('s=len(li); s==1000', 'li=range(1000)') > time2=timeit.Timer('len(li)==1000', 'li=range(1000)') > store=min(time1.repeat(5)

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Steven D'Aprano
On Fri, 15 Feb 2008 14:35:34 -0500, Steve Holden wrote: >> I don't understand: why would +INF not be equal to itself? Having INF >> == INF be True seems like something that makes sense both >> mathematically and computationally. >> [...] > > There are an uncountable number of infinities, all d

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Steven D'Aprano
On Thu, 14 Feb 2008 20:09:38 -0800, John Nagle wrote: > For Python, I'd suggest throwing a Python exception on all errors > recognized by the FPU, except maybe underflow. If you're doing such > serious number-crunching that you really want to handle NANs, you're > probably not writing in Python a

Re: Floating point bug?

2008-02-15 Thread Steven D'Aprano
On Fri, 15 Feb 2008 10:55:47 -0800, Zentrader wrote: > I disagree with this statement > But that doesn't change the fact that it will expose the same > rounding-errors as floats do - just for different numbers. The > example used has no rounding errors. Of course it does. Three thirds equals one

Re: Error messages when using the Console Module

2008-02-15 Thread Gabriel Genellina
En Fri, 15 Feb 2008 11:59:07 -0200, peter <[EMAIL PROTECTED]> escribió: > I am developing code using the effbot Console module, which gives > control over the Windows terminal settings. My problem is that while > this module redirects standard output to a new console window, it > seems to redir

Re: Passing a callable object to Thread

2008-02-15 Thread skawaii
On Feb 15, 7:23 pm, Paul Rubin wrote: > t = th.Thread(target=tribalwars.populate_all_tribes, args=("data/w7/",)) Thanks, that did it. After playing around in the interpreter a bit, I realize now that args=("data/w7/") doesn't create a tuple, like I thought it would. I h

Re: Passing a callable object to Thread

2008-02-15 Thread Paul Rubin
skawaii <[EMAIL PROTECTED]> writes: > >>> t = th.Thread(target=tribalwars.populate_all_tribes, args=("data/w7/")) > TypeError: populate_all_tribes() takes exactly 1 argument (8 given) > > Can anybody clue me in on what I'm doing wrong? Does my function need > to have a different signature (i.e. *a

Passing a callable object to Thread

2008-02-15 Thread skawaii
I'm trying to execute a function in its own thread, due to this method taking a very long time to complete. I really don't see the need to inherit the Thread class, as basically every online example shows (at least the ones I found), nor do I want to. I want to pass the method into the Thread const

Re: linux disc space

2008-02-15 Thread Jeff Schwab
Steve Holden wrote: > Jeff Schwab wrote: >> I'm not sure how superuser-only space would be reserved in the first >> place. I don't see anything relevant in the fdisk man page. > > The UFS and ext2 filesystem space allocation routines become very > inefficient when free space gets too low, so fo

Re: Assignment saves time?

2008-02-15 Thread Gabriel Genellina
En Fri, 15 Feb 2008 18:51:19 -0200, <[EMAIL PROTECTED]> escribió: > I ran it in an interactive python shell, which might have made a > difference. > > import timeit > time1=timeit.Timer('s=len(li); s==1000', 'li=range(1000)') > time2=timeit.Timer('len(li)==1000', 'li=range(1000)') > store=min(time

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Mark Dickinson
On Feb 15, 5:27 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > True enough, but aren't they of indeterminate magnitude? Since infinity > == infinity + delta for any delta, comparison for equality seems a > little specious. The equality is okay; it's when you start trying to apply arithmetic laws l

Re: scary thought for consideration

2008-02-15 Thread Guilherme Polo
2008/2/15, Blubaugh, David A. <[EMAIL PROTECTED]>: > > > > To All, > > > I am wondering as far as the integration of MyHDL with Python 2.5, if there > might be any potential version incompatibility issues? What I mean is will > MyHDL not operate correctly, if it is executed with a Python 2.5 versi

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Steve Holden
Mark Dickinson wrote: > On Feb 15, 2:35 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> There are an uncountable number of infinities, all different. > > If you're talking about infinite cardinals or ordinals in set theory, > then yes. But that hardly seems relevant to using floating-point as a >

Re: Email Directly from python

2008-02-15 Thread Daniel Folkes
You could always just set up a gmail account and use that SMTP. Thats what I do. Then all you have to do is google search for "gmail smtp python" and get some easy code. You can even send attatchments really easy. -Daniel Folkes brad wrote: > I'd like to send email directly from within python

sockets -- basic udp client

2008-02-15 Thread 7stud
My question pertains to this example: #!/usr/bin/env python import socket, sys, time host = sys.argv[1] textport = sys.argv[2] s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: port = int(textport) except ValueError: # That didn't work. Look it up instread. port = socket.ge

Re: linux disc space

2008-02-15 Thread Jeff Schwab
Christian Heimes wrote: > Jeff Schwab wrote: >> I'm not sure how superuser-only space would be reserved in the first >> place. I don't see anything relevant in the fdisk man page. > > man mkfs > > :) Thank you. Looks like the feature is only supported by particular file systems. I don't see

scary thought for consideration

2008-02-15 Thread Blubaugh, David A.
To All, I am wondering as far as the integration of MyHDL with Python 2.5, if there might be any potential version incompatibility issues? What I mean is will MyHDL not operate correctly, if it is executed with a Python 2.5 version not a Python 2.4? I will be testing to see if this possibility i

Re: linux disc space

2008-02-15 Thread Steve Holden
Jeff Schwab wrote: > I'm not sure how superuser-only space would be reserved in the first > place. I don't see anything relevant in the fdisk man page. The UFS and ext2 filesystem space allocation routines become very inefficient when free space gets too low, so for regular uses the filesystem

Re: Help Parsing an HTML File

2008-02-15 Thread Mike Driscoll
On Feb 15, 3:28 pm, [EMAIL PROTECTED] wrote: > Hello Python Community, > > It'd be great if someone could provide guidance or sample code for > accomplishing the following: > > I have a single unicode file that has descriptions of hundreds of > objects. The file fairly resembles HTML-EXAMPLE paste

Re: linux disc space

2008-02-15 Thread Matthew Woodcraft
In article <[EMAIL PROTECTED]>, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Available space is how much you can actually access as a non-root user. > Apparently (thank you Jean-Paul), space can be reserved for superuser > use only; such space is "free," but not "available." > I'm not sure how su

Re: linux disc space

2008-02-15 Thread Christian Heimes
Jeff Schwab wrote: > I'm not sure how superuser-only space would be reserved in the first > place. I don't see anything relevant in the fdisk man page. man mkfs :) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Help Parsing an HTML File

2008-02-15 Thread Tim Chase
> I need to parse the file in such a way to extract data out of the html > and to come up with a tab separated file that would look like OUTPUT- > FILE below. BeautifulSoup[1]. Your one-stop-shop for all your HTML parsing needs. What you do with the parsed data, is an exercise left to the reade

Help Parsing an HTML File

2008-02-15 Thread egonslokar
Hello Python Community, It'd be great if someone could provide guidance or sample code for accomplishing the following: I have a single unicode file that has descriptions of hundreds of objects. The file fairly resembles HTML-EXAMPLE pasted below. I need to parse the file in such a way to extra

Re: returning regex matches as lists

2008-02-15 Thread Jonathan Lukens
> What would you like to see instead? I had mostly just expected that there was some method that would return each entire match as an item on a list. I have this pattern: >>> import re >>> corporate_names = >>> re.compile(u'(?u)\\b([А-Я]{2,}\\s+)([<<"][а-яА-Я]+)(\\s*-?[а-яА-Я]+)*([>>"])') >>> t

Re: XML pickle

2008-02-15 Thread castironpi
On Feb 15, 2:58 pm, [EMAIL PROTECTED] wrote: > > In Economics, they call it "Economy to Scale"- the effect, and the > > point, and past it, where the cost to produce N goods on a supply > > curve on which 0 goods costs 0 exceeds that on one on which 0 goods > > costs more than 0: the opposite of di

Re: Floating point bug?

2008-02-15 Thread Mark Dickinson
On Feb 15, 3:30 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > The point is that all numbering systems with a base + precision will > have (rational) values they can't exactly represent. Q\R is of course > out of the question by definition This 'Decimal is exact' myth has been appearing o

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Mark Dickinson
On Feb 15, 2:35 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > There are an uncountable number of infinities, all different. If you're talking about infinite cardinals or ordinals in set theory, then yes. But that hardly seems relevant to using floating-point as a model for the doubly extended rea

Re: XML pickle

2008-02-15 Thread castironpi
> In Economics, they call it "Economy to Scale"- the effect, and the > point, and past it, where the cost to produce N goods on a supply > curve on which 0 goods costs 0 exceeds that on one on which 0 goods > costs more than 0: the opposite of diminishing returns.  Does the > benefit of encapsulati

Re: Assignment saves time?

2008-02-15 Thread rpglover64
I ran it in an interactive python shell, which might have made a difference. import timeit time1=timeit.Timer('s=len(li); s==1000', 'li=range(1000)') time2=timeit.Timer('len(li)==1000', 'li=range(1000)') store=min(time1.repeat(5)) call=min(time2.repeat(5)) store=min(min(time1.repeat(5)),store) cal

Re: Assignment saves time?

2008-02-15 Thread rpglover64
I ran it in an interactive python shell, which might have made a difference. import timeit time1=timeit.Timer('s=len(li); s==1000', 'li=range(1000)') time2=timeit.Timer('len(li)==1000', 'li=range(1000)') store=min(time1.repeat(5)) call=min(time2.repeat(5)) store=min(min(time1.repeat(5)),store) cal

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Grant Edwards
On 2008-02-15, Carl Banks <[EMAIL PROTECTED]> wrote: >> For Python, I'd suggest throwing a Python exception on all >> errors recognized by the FPU, except maybe underflow. If >> you're doing such serious number-crunching that you really >> want to handle NANs, you're probably not writing in Pytho

Re: Floating point bug?

2008-02-15 Thread Diez B. Roggisch
Zentrader schrieb: >> That's a misconception. The decimal-module has a different base (10 >> instead of 2), and higher precision. But that doesn't change the fact >> that it will expose the same rounding-errors as floats do - just for >> different numbers. >> >> >>> import decimal as d >> >>> d =

Re: Pop-up Menu of a Graphics Image?

2008-02-15 Thread W. Watson
I want to allow a user who is looking at a graphic to be able to right-click on the graphic to produce a menu of choices. Does the PIL have something, a class or whatever? What in Tkinter would be useful for this purpose? GTK? Jon "Fluffy" Saul wrote: > On Fri, Feb 15, 2008 at 9:55 AM, W. Watso

Re: returning regex matches as lists

2008-02-15 Thread John Machin
On Feb 16, 6:07 am, Jonathan Lukens <[EMAIL PROTECTED]> wrote: > I am in the last phase of building a Django app based on something I > wrote in Java a while back. Right now I am stuck on how to return the > matches of a regular expression as a list *at all*, and in particular > given that the reg

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Carl Banks
On Feb 14, 11:09 pm, John Nagle <[EMAIL PROTECTED]> wrote: > You also need to think about how conditionals interact with > quiet NANs. Properly, comparisons like ">" have three possibilities: > True, False, and "raise". Many implementations don't do that well, > which means that you lose tri

Re: mmap and shared memory

2008-02-15 Thread Ryan Smith-Roberts
On Feb 11, 3:41 pm, Matias Surdi <[EMAIL PROTECTED]> wrote: > Suppose I've a process P1, which generates itself a lot of data , for > example 2Mb. > Then, I've a process P2 which must access P1 shared memory and, > probably, modify this data. > To accomplish this, I've been digging around python's

Re: linux disc space

2008-02-15 Thread Jeff Schwab
DataSmash wrote: > On Feb 15, 1:32 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Chris wrote: >>> On Feb 15, 7:10 pm, DataSmash <[EMAIL PROTECTED]> wrote: I simply want to capture the free disc space in a variable so that I can compare changes. I'm aware of a few commands like "df -h" or

Re: Looking for a Python Program/Tool That Will Add Line Numbers to a txt File

2008-02-15 Thread Jeff Schwab
W. Watson wrote: > See Subject. It's a simple txt file, each line is a Python stmt, but I > need up to four digits added to each line with a space between the > number field and the text. Perhaps someone has already done this or > there's a source on the web for it. I'm not yet into files with P

Re: linux disc space

2008-02-15 Thread DataSmash
On Feb 15, 1:32 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Chris wrote: > > On Feb 15, 7:10 pm, DataSmash <[EMAIL PROTECTED]> wrote: > >> I simply want to capture the free disc space in a variable so that I > >> can compare changes. I'm aware of a few commands like "df -h" or "du - > >> k", but

Re: Accessing Oracle/Access database py2.4

2008-02-15 Thread M.-A. Lemburg
On 2008-02-15 17:06, Ahmed, Shakir wrote: > I was used import odbc to connect oracle or access table before, now I > switched to python 2.4 and is giving me error message. I appreciate any > help on that. The win32 odbc module is very old and no longer maintained. If you're looking for a reliab

Re: QOTW: Re: dream hardware

2008-02-15 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 14, 10:50 pm, [EMAIL PROTECTED] (Aahz) wrote: >> In article <[EMAIL PROTECTED]>, >> Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> >>> On Tue, 12 Feb 2008 10:05:59 -0800, castironpi wrote: What is dream hardware for the Python interpreter? >>> I'm not sure tha

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Jeff Schwab
Steve Holden wrote: > Mark Dickinson wrote: >> On Feb 14, 11:09 pm, John Nagle <[EMAIL PROTECTED]> wrote: >>> You also need to think about how conditionals interact with >>> quiet NANs. Properly, comparisons like ">" have three possibilities: >> >> True. There was a recent change to Decimal

Re: [OT] Looking for a Python Program/Tool That Will Add Line Numbers to a txt File

2008-02-15 Thread Steve Holden
I'll see your IBM 650 and raise you a Univac 418 with a FastRand drum. regards Steve W. Watson wrote: > Good grief! You go a long way back. Want to try for an IBM 650 with a drum > memory? > > Gabriel Genellina wrote: >> En Thu, 14 Feb 2008 04:54:56 -0200, W. Watson <[EMAIL PROTECTED]> >> es

Re: Looking for a Python Program/Tool That Will Add Line Numbers to a txt File

2008-02-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: >> See Subject. It's a simple txt file, each line is a Python stmt, but I need >> up to four digits added to each line with a space between the number field >> and the text. Perhaps someone has already done this or there's a source on >> the web for it. I'm not yet into fil

Re: linux disc space

2008-02-15 Thread Jean-Paul Calderone
On Fri, 15 Feb 2008 11:32:09 -0800, Jeff Schwab <[EMAIL PROTECTED]> wrote: >Chris wrote: >> On Feb 15, 7:10 pm, DataSmash <[EMAIL PROTECTED]> wrote: >>> I simply want to capture the free disc space in a variable so that I >>> can compare changes. I'm aware of a few commands like "df -h" or "du - >

Re: QOTW: Re: dream hardware

2008-02-15 Thread castironpi
On Feb 14, 10:50 pm, [EMAIL PROTECTED] (Aahz) wrote: > In article <[EMAIL PROTECTED]>, > Steven D'Aprano  <[EMAIL PROTECTED]> wrote: > > >On Tue, 12 Feb 2008 10:05:59 -0800, castironpi wrote: > > >> What is dream hardware for the Python interpreter? > > >I'm not sure that the Python interpreter act

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Steve Holden
Mark Dickinson wrote: > On Feb 14, 11:09 pm, John Nagle <[EMAIL PROTECTED]> wrote: >> You also need to think about how conditionals interact with >> quiet NANs. Properly, comparisons like ">" have three possibilities: > > True. There was a recent change to Decimal to make comparisons (other

Re: linux disc space

2008-02-15 Thread Jeff Schwab
Chris wrote: > On Feb 15, 7:10 pm, DataSmash <[EMAIL PROTECTED]> wrote: >> I simply want to capture the free disc space in a variable so that I >> can compare changes. I'm aware of a few commands like "df -h" or "du - >> k", but I can't figure out how to capture those values as a variable. >> I al

Re: XML pickle

2008-02-15 Thread castironpi
On Feb 15, 12:07 pm, [EMAIL PROTECTED] wrote: > On Feb 15, 11:10 am, [EMAIL PROTECTED] wrote: > > > > > Can you use set( '{ss}Type' ) somehow? > > > > What is 'ss' here? A prefix? > > > > What about actually reading the tutorial? > > > >http://codespeak.net/lxml/tutorial.html#namespaces > > > > > A

Re: linux disc space

2008-02-15 Thread Chris
On Feb 15, 7:10 pm, DataSmash <[EMAIL PROTECTED]> wrote: > I simply want to capture the free disc space in a variable so that I > can compare changes. I'm aware of a few commands like "df -h" or "du - > k", but I can't figure out how to capture those values as a variable. > I also looked at os.sta

Re: Floating point bug?

2008-02-15 Thread Jeff Schwab
Zentrader wrote: > I disagree with this statement > But that doesn't change the fact that it will expose the same > rounding-errors as floats do - just for different numbers. > The example used has no rounding errors. I think we're using the term "rounding error" to mean different things. If t

returning regex matches as lists

2008-02-15 Thread Jonathan Lukens
I am in the last phase of building a Django app based on something I wrote in Java a while back. Right now I am stuck on how to return the matches of a regular expression as a list *at all*, and in particular given that the regex has a number of groupings. The only method I've seen that returns a

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Grant Edwards
On 2008-02-15, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On Feb 15, 1:38 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: >> On 2008-02-15, Mark Dickinson <[EMAIL PROTECTED]> wrote: >> >> >> If you're doing such serious number-crunching that you really >> >> want to handle NANs, you're probably not w

Re: Floating point bug?

2008-02-15 Thread Zentrader
I disagree with this statement But that doesn't change the fact that it will expose the same rounding-errors as floats do - just for different numbers. The example used has no rounding errors. For anything less that 28 significant digits it rounds to 1.0. With floats 1.0/3 yields 0.3

Re: Solve a Debate

2008-02-15 Thread Quentin Gallet-Gilles
If the data becomes much bigger, change your way of storing it, not the code. You don't want to code hundreds of "if - elif - else" because you have hundreds of different data, right ? TheDailyWTF is full of horror stories like this, by the way ;-) Data growth shouldn't result in modification in lo

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Mark Dickinson
On Feb 15, 1:38 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-02-15, Mark Dickinson <[EMAIL PROTECTED]> wrote: > > >> If you're doing such serious number-crunching that you really > >> want to handle NANs, you're probably not writing in Python > >> anyway. > Some dodgy quoting here: that

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Grant Edwards
On 2008-02-15, Mark Dickinson <[EMAIL PROTECTED]> wrote: >> If you're doing such serious number-crunching that you really >> want to handle NANs, you're probably not writing in Python >> anyway. I disagree completely. I do a lot of number crunching in Python where I want IEEE NaN and Inf behavio

Re: What's "the standard" for code docs?

2008-02-15 Thread Jeff Schwab
Preston Landers wrote: > Hey guys and gals. What are all the cool kids using these days to > document their code? My goal is to create in-line documentation of > each package/module/class/method and create some semi-nice looking (or > at least usable) packaged documentation from it, in HTML and/o

Re: Solve a Debate

2008-02-15 Thread Grant Edwards
On 2008-02-15, Ivan Van Laningham <[EMAIL PROTECTED]> wrote: > Lookup tables are always significantly faster than a bunch of > ifs. Mostly always. It depends on what you mean by "lookup table", and it depends on how the language implements things. If you by "lookup table" you mean a linearly in

Re: Looking for a Python Program/Tool That Will Add Line Numbers to a txt File

2008-02-15 Thread [EMAIL PROTECTED]
> See Subject. It's a simple txt file, each line is a Python stmt, but I need > up to four digits added to each line with a space between the number field > and the text. Perhaps someone has already done this or there's a source on > the web for it. I'm not yet into files with Python. A sudden need

Re: Turn off ZeroDivisionError?

2008-02-15 Thread Mark Dickinson
On Feb 14, 11:09 pm, John Nagle <[EMAIL PROTECTED]> wrote: > You also need to think about how conditionals interact with > quiet NANs. Properly, comparisons like ">" have three possibilities: True. There was a recent change to Decimal to make comparisons (other than !=, ==) with NaNs do the

Re: Solve a Debate

2008-02-15 Thread Ivan Van Laningham
Hi All-- Lookup tables are always significantly faster than a bunch of ifs. Metta, Ivan On Fri, Feb 15, 2008 at 10:10 AM, Tim Chase <[EMAIL PROTECTED]> wrote: > > Ok the problem we had been asked a while back, to do a programming > > exercise (in college) > > That would tell you how many days t

RE: Solve a Debate

2008-02-15 Thread Reedick, Andrew
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of nexes > Sent: Friday, February 15, 2008 11:25 AM > To: python-list@python.org > Subject: Solve a Debate > > Alright so me and my friend are having argument. > > Ok the problem we had been asked

Re: XML pickle

2008-02-15 Thread castironpi
On Feb 15, 11:10 am, [EMAIL PROTECTED] wrote: > > > Can you use set( '{ss}Type' ) somehow? > > > What is 'ss' here? A prefix? > > > What about actually reading the tutorial? > > >http://codespeak.net/lxml/tutorial.html#namespaces > > > > And any way to make this look > > > closer to the original? >

Re: a question in python curses modules

2008-02-15 Thread Marc 'BlackJack' Rintsch
On Fri, 15 Feb 2008 15:10:12 +, Sion Arrowsmith wrote: > Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >>When the interpreter shuts down it has to remove objects. Everything you >>need in a `__del__()` method must be referenced by that object to be sure >>that it is still there and not

Re: How do I execute a command from within python and wait on that command?

2008-02-15 Thread Matt Nordhoff
Rafael Sachetto wrote: > os.system(command) > > or > > proc = popen2.Popen3(command) > proc.wait() I don't know about "cleanly terminat[ing] the command shell", but you should use the subprocess module now, not any of the other functions scattered around. -- -- http://mail.python.org/mailman/l

Re: How do I execute a command from within python and wait on that command?

2008-02-15 Thread Rafael Sachetto
os.system(command) or proc = popen2.Popen3(command) proc.wait() 2008/2/15, black_13 <[EMAIL PROTECTED]>: > how do i exec a command (such as xcopy) from with win32 python and > wait on that command > to come to completion? and also cleanly terminate the command shell? > thanks > black_13 > >

  1   2   >