Re: ANN: NUCULAR B3 Full text indexing (now on Win32 too)

2008-02-14 Thread Jarek Zgoda
Paul Rubin napisał(a): >> ANNOUNCE: NUCULAR Fielded Full Text Indexing, BETA 3 > > Oh cool, I wondered if anything was going on with this. I'm still > using Solr/Lucene while Nucular matures, which sounds to be moving > along nicely. Did you (or anyone else) compare Nucular with Solr and Sphinx

Re: ANN: NUCULAR B3 Full text indexing (now on Win32 too)

2008-02-14 Thread Paul Rubin
Jarek Zgoda <[EMAIL PROTECTED]> writes: > Did you (or anyone else) compare Nucular with Solr and Sphinx > feature-by-feature? Nucular when I looked at it was in an early alpha release and looked interesting and promising, but was nowhere near as built-out as Solr. It may be closer now; I haven't y

Re: Is there any Generic RSS/ATOM generator in Python?

2008-02-14 Thread Torsten Bronger
Hallöchen! Stefan Behnel writes: > Torsten Bronger wrote: > >> Terran Melconian writes: >> >> [...] >> >> Maybe I understand you wrongly but there *is* a general XML >> generator with ElementTree. I wouldn't generate XML directly but >> using ElementTree to generate Atom. I did it myself thre

Re: Python equivt of __FILE__ and __LINE__

2008-02-14 Thread alain
On Feb 14, 1:50 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 13 Feb 2008 13:07:31 -0200, alain <[EMAIL PROTECTED]> escribió: > > > There exists an undocumented builtin called __file__, but > > unfortunately no corresponding __line__ > > There is no __file__ builtin AFAIK; but there

Re: Floating point bug?

2008-02-14 Thread Diez B. Roggisch
Preston Landers schrieb: > [EMAIL PROTECTED]([EMAIL PROTECTED])@2008.02.13 15:13:20 -0800: >> Not a bug. All languages implementing floating point numbers have the >> same issue. Some just decide to hide it from you. Please read >> http://docs.python.org/tut/node16.html and particularly >> http://d

Re: Cannot understand error message

2008-02-14 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : > On Wed, 13 Feb 2008 17:29:59 +, Bill Davy wrote: > >> The following code produces an error message (using Idle with Py 2.4 and >> 2.5). "There's an error in your program: EOL while scanning >> single-quoted string". It comes just after "s = ''" (put there to try >

Re: OT: Speed of light

2008-02-14 Thread Dotan Cohen
On 14/02/2008, Erik Max Francis <[EMAIL PROTECTED]> wrote: > Bjoern Schliessmann wrote: > > > eV has a advantages some "kilogram force" hasn't: It's on completely > > different order of magnitude. People aren't happy writing 81.8 aJ > > (Attojoule = 1e-15 Joule), instead they prefer > > 511 keV

Re: ANN: NUCULAR B3 Full text indexing (now on Win32 too)

2008-02-14 Thread Jarek Zgoda
Paul Rubin napisał(a): >> Did you (or anyone else) compare Nucular with Solr and Sphinx >> feature-by-feature? > > Nucular when I looked at it was in an early alpha release and looked > interesting and promising, but was nowhere near as built-out as Solr. > It may be closer now; I haven't yet had

Re: How to access object attributes given a string

2008-02-14 Thread Santiago Romero
> >> You are using a scripting language.. why not use python directly? > > > I just want to execute an small set of commands (PLAYSOUND, PLAYMUSIC, > > WALKTO, PLAYERSAY, SLEEP and a couple more) ... do you think I can > > write python code inside my object.exec (list attribute) loaded from a > > f

Re: Regular Expression for Prime Numbers (or How I came to fail at them, and love the bomb)

2008-02-14 Thread cokofreedom
> hmm... interesting > > here is another way you can find prime > numbershttp://love-python.blogspot.com/2008/02/find-prime-number-upto-100-nu... > Sadly that is pretty slow though... If you don't mind readability you can make the example I gave into five lines. def p(_): if _<3:return[2]if _=

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-14 Thread Dotan Cohen
On 14/02/2008, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Wed, 13 Feb 2008 22:13:51 +, I V wrote: > > > On Mon, 11 Feb 2008 14:07:49 -0800, Erik Max Francis wrote: > >> experience. The notion of impetus -- where an object throw moves in a > >> straight line until it runs out of impetus

Re: ANN: NUCULAR B3 Full text indexing (now on Win32 too)

2008-02-14 Thread Paul Rubin
Jarek Zgoda <[EMAIL PROTECTED]> writes: > > I don't know what Sphinx is. > http://www.sphinxsearch.com/ Thanks, looks interesting, maybe not so good for what I'm doing, but worth looking into. There is also Xapian which again I haven't looked at much, but which has fancier PIR (probabilistic info

Re: Floating point bug?

2008-02-14 Thread Jeff Schwab
Dennis Lee Bieber wrote: > On Wed, 13 Feb 2008 17:49:08 -0800, Jeff Schwab <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> If you need a pretty string for use in code: >> >> >>> def pretty_fp(fpnum, prec=8): >> ... return ('%.8f' % fpnum).rstrip('0') >> .

Re: Floating point bug?

2008-02-14 Thread Christian Heimes
Dennis Lee Bieber wrote: > What's wrong with just > > str(0.3) > > that's what "print" invokes, whereas the interpreter prompt is using > > repr(0.3) > No, print invokes the tp_print slot of the float type. Some core types have a special handler for print. The tp_print slot

Re: OT: Speed of light

2008-02-14 Thread Bjoern Schliessmann
Erik Max Francis wrote: > A couple of problems here. 1 eV = 1.602 x 10^-19 J. Also, the > atto-prefix is 10^-18, not 10^-15. So 511 keV = 81.9 fJ > (femtojoules). Miscount on my side; thanks for pointing that out. Regards, Björn -- BOFH excuse #330: quantum decoherence -- http://mail

Multimedia message

2008-02-14 Thread 8172691950
-- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-14 Thread Steven D'Aprano
On Thu, 14 Feb 2008 10:35:09 +0200, Dotan Cohen wrote: >> If they asked an archer to fire an arrow through a distant window, he'd >> aim slightly above it. You can't spend dozens of hours every week >> shooting arrows at targets without learning to compensate for gravity. > > You are forgetting

Re: Cannot understand error message

2008-02-14 Thread Bill Davy
"Chris" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It doesn't like all that text in the previous one... > > Just before s = '' you have 4 double quotes to close to doc-string > instead of 3. Doh. I had put in the s = '' to see if I could force IDLE to say something more, and

Re: Email Directly from python

2008-02-14 Thread Martin P. Hellwig
Dennis Lee Bieber wrote: > The first response to the query was to invoke the command line > "mail" utility of a Unix type OS. THAT program is, what I believe, was > meant by "mail will invoke a smtp server"... Not "mail" as a general > concept, but the utility command... Ah yes I see that n

Re: Coverage.py reporting and UML tools - what exists already?

2008-02-14 Thread Juha S.
Ricardo Aráoz wrote: > J Peyret wrote: > >> I got coverage.py to work after somewhat of a difficult start... >> >> Hint: if moving your code from Windows to Linux and if running >> 'coverage.py -r mymodule.py' causes SyntaxError/SyntaxException, the >> 'flip' utility is your friend to deal with

Re: Cannot understand error message

2008-02-14 Thread Bruno Desthuilliers
Bill Davy a écrit : (snip) > Doh. (snip) > Interesting that some colourers work better than others. It must be quite a > challenge. > > IDLE did not offer a full traceback just a pop-up. Mmm... That sure is bad. Isn't there an option to get a better behaviour? Anyway, just trying to run you

Re: Cannot understand error message

2008-02-14 Thread Bruno Desthuilliers
Dennis Lee Bieber a écrit : > On Wed, 13 Feb 2008 17:29:59 -, "Bill Davy" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> The colouring in IDLE does not indicate a bad string. >> > I don't use IDLE, but PythonWin's editor identified it quite easily > after I paste

Re: Cannot understand error message

2008-02-14 Thread Bill Davy
"Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Bill Davy a écrit : > (snip) >> Doh. > > (snip) > >> Interesting that some colourers work better than others. It must be >> quite a challenge. >> >> IDLE did not offer a full traceback just a pop-up. > > Mmm... T

Re: Time line for OJS migration

2008-02-14 Thread Guilherme Polo
2008/2/14, Maurice Ling <[EMAIL PROTECTED]>: > Hi Guilherme > > I've seen the site, it looks pretty good. > > Just wondering if you foresee any problems in moving the whole > installation to another server? If not, perhaps you can try to migrate > the documents (instructions for authors etc) to

Re: Regular Expression for Prime Numbers (or How I came to fail at them, and love the bomb)

2008-02-14 Thread bearophileHUGS
cokofree: > Sadly that is pretty slow though... It's quadratic, and it's not even short, you can do (quadratic still): print [x for x in range(2, 100) if all(x%i for i in range(2, x))] In D you can write similar code. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

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

2008-02-14 Thread John Machin
On Feb 14, 6:13 pm, Chris <[EMAIL PROTECTED]> wrote: > On Feb 14, 8:54 am, "W. Watson" <[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. Perhap

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-14 Thread Dotan Cohen
On 14/02/2008, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Thu, 14 Feb 2008 10:35:09 +0200, Dotan Cohen wrote: > > >> If they asked an archer to fire an arrow through a distant window, he'd > >> aim slightly above it. You can't spend dozens of hours every week > >> shooting arrows at targe

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

2008-02-14 Thread Chris
On Feb 14, 1:29 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Feb 14, 6:13 pm, Chris <[EMAIL PROTECTED]> wrote: > > > > > On Feb 14, 8:54 am, "W. Watson" <[EMAIL PROTECTED]> wrote: > > > > See Subject. It's a simple txt file, each line is a Python stmt, but I > > > need > > > up to four digits a

Re: Is there any Generic RSS/ATOM generator in Python?

2008-02-14 Thread js
Trivial? More than XML::Atom::Feed? http://search.cpan.org/~miyagawa/XML-Atom-0.28/lib/XML/Atom/Feed.pm On 2/14/08, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Hallöchen! > > > Terran Melconian writes: > > > On 2008-02-11, js <[EMAIL PROTECTED]> wrote: > > > >> Is there any de-fact standard R

Re: Is there any Generic RSS/ATOM generator in Python?

2008-02-14 Thread Torsten Bronger
Hallöchen! js writes: > Trivial? > More than XML::Atom::Feed? > http://search.cpan.org/~miyagawa/XML-Atom-0.28/lib/XML/Atom/Feed.pm Excerpt from my code: root = ElementTree.Element("feed", xmlns="http://www.w3.org/2005/Atom";) ElementTree.SubElement(root, "id").text = self.id Elemen

Parallel port control with USB->Parallel converter

2008-02-14 Thread Soren
Hi, I want to control some motors using the parallel port.. however, my laptop does not have any parallel ports (very few do). What I do have is a USB->Parallel converter... I thought about using PyParallel, but the USB->Parallel converterdoesn't actually map to the LPT port .. and PyParallel

Re: Cannot understand error message

2008-02-14 Thread Bruno Desthuilliers
Bill Davy a écrit : > "Bruno Desthuilliers" <[EMAIL PROTECTED]> > wrote in message news:[EMAIL PROTECTED] (snip) >>> Many thanks for the help. Must get a bigger screen and new eyes. >> Or a better code editor. > > I just grabbed what was on the shelf. Is there a Python plug-in for MSVC? > ;-)

Re: Is there any Generic RSS/ATOM generator in Python?

2008-02-14 Thread Stefan Behnel
Torsten Bronger wrote: > js writes: > >> Trivial? >> More than XML::Atom::Feed? >> http://search.cpan.org/~miyagawa/XML-Atom-0.28/lib/XML/Atom/Feed.pm > > Excerpt from my code: > > root = ElementTree.Element("feed", xmlns="http://www.w3.org/2005/Atom";) > ElementTree.SubElement(root, "id

Re: Floating point bug?

2008-02-14 Thread Bruno Desthuilliers
Christian Heimes a écrit : > Dennis Lee Bieber wrote: >> What's wrong with just >> >> str(0.3) >> >> that's what "print" invokes, whereas the interpreter prompt is using >> >> repr(0.3) >> > > No, print invokes the tp_print slot of the float type. Some core types > have a special h

Re: Regular Expression for Prime Numbers (or How I came to fail at them, and love the bomb)

2008-02-14 Thread Henry
> > > There's no finite state machine involved here, since this isn't a > > regular expression in the strictest sense of the term---it doesn't > > translate to a finite state machine, since backreferences are > > involved. > > > > Mark > > > What is it? > The language of strings of 1s whose lengt

Exception on keypress

2008-02-14 Thread Michael Goerz
Hi, I'm writing a command line program that watches a file, and recompiles it when it changes. However, there should also be a possibility of doing a complete clean restart (cleaning up temp files, compiling some dependencies, etc.). Since the program is in an infinite loop, there are limited

Re: Parallel port control with USB->Parallel converter

2008-02-14 Thread Diez B. Roggisch
Soren wrote: > Hi, > > I want to control some motors using the parallel port.. however, my > laptop does not have any parallel ports (very few do). What I do have > is a USB->Parallel converter... I thought about using PyParallel, but > the USB->Parallel converterdoesn't actually map to the L

Re: Coverage.py reporting and UML tools - what exists already?

2008-02-14 Thread Bruno Desthuilliers
J Peyret a écrit : (snip first question) > > Second question: > > I'd like a basic UML tool to draw up some interaction diagrams > (Collaboration/Sequence) on some of my hairier pieces of code. I > think of it more as documentation/brainstorming diagrams than anything > else. I.e. something tha

Re: Is there any Generic RSS/ATOM generator in Python?

2008-02-14 Thread Torsten Bronger
Hallöchen! Stefan Behnel writes: > Torsten Bronger wrote: > >> [...] >> >> Excerpt from my code: >> >> root = ElementTree.Element("feed", xmlns="http://www.w3.org/2005/Atom";) >> ElementTree.SubElement(root, "id").text = self.id >> ElementTree.SubElement(root, "title").text = self.t

Re: Is there any Generic RSS/ATOM generator in Python?

2008-02-14 Thread Stefan Behnel
Torsten Bronger wrote: > Stefan Behnel writes: > >> Torsten Bronger wrote: >> >>> [...] >>> >>> Excerpt from my code: >>> >>> root = ElementTree.Element("feed", xmlns="http://www.w3.org/2005/Atom";) >>> ElementTree.SubElement(root, "id").text = self.id >>> ElementTree.SubElement(root,

Re: Is there any Generic RSS/ATOM generator in Python?

2008-02-14 Thread Torsten Bronger
Hallöchen! Stefan Behnel writes: > [...] > > The E factory is a small module with one main class. Adding that > to your code base doesn't give you any dependencies... Yes, but just for creating five elements? ;-) Tschö, Torsten. -- Torsten Bronger, aquisgrana, europa vetus

Re: Is there any Generic RSS/ATOM generator in Python?

2008-02-14 Thread js
Great... I guess I should have learned more about ElementTree. In anyway, Thanks all. You all convinced me, really. On 2/14/08, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Torsten Bronger wrote: > > js writes: > > > >> Trivial? > >> More than XML::Atom::Feed? > >> http://search.cpan.org/~miya

Re: CGI with URL problem

2008-02-14 Thread rodmc
Thanks for your reply, no one is running locally on my PC and the other as the default user which occurs when the script is run through a browser. Best, rod -- http://mail.python.org/mailman/listinfo/python-list

Running CGI from within CGI

2008-02-14 Thread rodmc
I am new to using Python as a CGI platform, so please excuse me if this is a dumb question. Anyway I have written a series of web forms (with Python scripts) which allow the user input but also retrieve data from a database. The data entry stage works fine however retrieving data is a little more

Re: Running CGI from within CGI

2008-02-14 Thread Bruno Desthuilliers
rodmc a écrit : > I am new to using Python as a CGI platform, so please excuse me if > this is a dumb question. > > Anyway I have written a series of web forms (with Python scripts) > which allow the user input but also retrieve data from a database. The > data entry stage works fine however retri

Re: ANN: NUCULAR B3 Full text indexing (now on Win32 too)

2008-02-14 Thread Aaron Watters
On Feb 14, 3:50 am, Paul Rubin wrote: > The main thing killing most of the search apps that I'm involved with > is disk latency. If Aaron is listening, I might suggest offering a > config option to redundantly recording the stored search fields with > every search term i

Re: Floating point bug?

2008-02-14 Thread Christian Heimes
Bruno Desthuilliers wrote: > I Must have miss something... Yeah, You have missed the beginning of the third sentence: "The tp_print slot is not available from Python code". The tp_print slot is only available in C code and is part of the C definition of a type. Hence tp_ as type. Search for float

Re: Floating point bug?

2008-02-14 Thread Duncan Booth
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > I Must have miss something... Perhaps you missed the part where Christian said "The tp_print slot is not available from Python code"? -- http://mail.python.org/mailman/listinfo/python-list

Re: Running CGI from within CGI

2008-02-14 Thread rodmc
Thanks for the details, is execfile full of security issues or something? You are right about exploring templates, I may explore that later. However I need to integrate the forms in with another system, which will not be using templates. I suspect I may have taken the long way round but I suppose

Re: Parallel port control with USB->Parallel converter

2008-02-14 Thread Soren
Hey Diez, thanks for your answer! > You could try and see how far you get with pyusb, the wrapping for libusb. > However, any decent usb2-adapter should register itself as device > of the mapped kind. For example, usb2serial-converters appear as > COMx:-ports. That was my thought too, and that's

Re: Parallel port control with USB->Parallel converter

2008-02-14 Thread c d saunter
Soren, I don't know about the USB parallel port converters but there are variousways you can add USB connectivity yourself. A simple way are the USB devices from FTDI (http://www.ftdichip.com/FTProducts.htm) Either the FT232R or the FT245R. These are both single chip solutions that

Re: Floating point bug?

2008-02-14 Thread Bruno Desthuilliers
Christian Heimes a écrit : > Bruno Desthuilliers wrote: >> I Must have miss something... > > Yeah, You have missed the beginning of the third sentence: "The tp_print > slot is not available from Python code". oops, my bad ! I missed the "not" !-) -- http://mail.python.org/mailman/listinfo/pytho

Re: Parallel port control with USB->Parallel converter

2008-02-14 Thread c d saunter
Doh! It's been a while since I used these. I was slightly wrong; actually both the 232 and 245 devices can be accessed either via a serial port interface (COMx on windows, /dev/??? on linux etc.) or via a direct API. The 245 provides a parallel FIFO and the 232 a serial data link, so you'd wa

InstanceType tests in Python-3.0

2008-02-14 Thread Robin Becker
I'm in the process of porting some code. I have 2.x code that looks like this t = type(e) if t==InstanceType: return f0(e) elif t in (float,int): return f1(e) else: return str(e) In python 3.0 everything has been unified and people say use attributes to tell what should be done in su

Re: Running CGI from within CGI

2008-02-14 Thread Bruno Desthuilliers
rodmc a écrit : (top-post corrected - rod, please learn to quote, thanks !-) > On Feb 14, 3:26 pm, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: >> rodmc a écrit : (snip) >>> However I would like to execute a script instead so calling for >>> example myscript.py - thus populating the existing for

Re: Floating point bug?

2008-02-14 Thread Duncan Booth
Christian Heimes <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers wrote: >> I Must have miss something... > > Yeah, You have missed the beginning of the third sentence: "The tp_print > slot is not available from Python code". The tp_print slot is only > available in C code and is part of the C d

Re: InstanceType tests in Python-3.0

2008-02-14 Thread Steven D'Aprano
On Thu, 14 Feb 2008 15:26:08 +, Robin Becker wrote: > I'm in the process of porting some code. I have 2.x code that looks like > this > > t = type(e) > if t==InstanceType: > return f0(e) > elif t in (float,int): > return f1(e) > else: > return str(e) What happens if e is an insta

dictionary of operators

2008-02-14 Thread rbossy
Hi, In the standard library module "operator", it would be nice to have a dictionary mapping operators strings with their respective functions. Something like: { '+': add, '-': sub, 'in': contains, 'and': and_, 'or': or_, ... } Rationale: Recently I had to implemen

Re: SAGE for FPGA development

2008-02-14 Thread Bill Hart
David, I see that if MyHDL was in SAGE, then it could be used to do what you suggest. But why not get a python interpreter and still do what you suggest. I don't see the advantage to putting it into SAGE. Who else would use it? Is there a large group of mathematicians who have access to FPGA hardw

SAGE for FPGA development

2008-02-14 Thread Blubaugh, David A.
Bill, The potential idea that I had in store for SAGE would be to first be able to develop complicated algorithms onto hardware. What I mean by this is to take for example, a FFT and then be able to map the entire algorithm into hardware, in a reasonable amount of time. It currently takes a few

Re: Exception on keypress

2008-02-14 Thread bockman
On 14 Feb, 14:27, Michael Goerz <[EMAIL PROTECTED]> wrote: > Hi, > > I'm writing a command line program that watches a file, and recompiles > it when it changes. However, there should also be a possibility of doing > a complete clean restart (cleaning up temp files, compiling some > dependencies, e

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

2008-02-14 Thread W. Watson
Thanks. I found this to work: input_file=open('junkin.txt','r') output_file=open('junkout.txt','w') for (line_cnt, each_line) in enumerate(input_file): output_file.write('%4d '%(line_cnt+1)+each_line) output_file.close() input_file.close() I removed the print, but ran into trouble with zfill

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

2008-02-14 Thread J Peyret
On Feb 14, 8:50 am, "W. Watson" <[EMAIL PROTECTED]> wrote: (snip) > I thought this might be more difficult judging by a long ago experience with > Java. (snip) +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

How to tell if I'm being run from a shell or a module

2008-02-14 Thread dg . google . groups
Hi all, Is there any standard way to tell if the user is running from a module or from an interactive shell like IDLE or IPython? The best I've come up with so far is for a function to look at getouterframes(currentframe())[1][1] (the filename in the frame record of the frame that called the funct

Re: Floating point bug?

2008-02-14 Thread Jeff Schwab
Christian Heimes wrote: > Dennis Lee Bieber wrote: >> What's wrong with just >> >> str(0.3) >> >> that's what "print" invokes, whereas the interpreter prompt is using >> >> repr(0.3) >> > > No, print invokes the tp_print slot of the float type. Some core types > have a special hand

Re: How to tell if I'm being run from a shell or a module

2008-02-14 Thread Jeff
Conventionally, you use: if __name__ == '__main__': # do something as a script -- http://mail.python.org/mailman/listinfo/python-list

Copying weakrefs

2008-02-14 Thread Rick Harris
I am working with an object, Context, that maintains an identity map by using the weakref.WeakValueDictionary. I would like to clone this Context object (and objects that may have a Context object) using copy.deepcopy(). When I try to do this, the deep copy operation recurses down to the WeakValueD

Re: Regular Expression for Prime Numbers (or How I came to fail at them, and love the bomb)

2008-02-14 Thread castironpi
On Feb 14, 5:26 am, [EMAIL PROTECTED] wrote: > cokofree: > > > Sadly that is pretty slow though... > > It's quadratic, and it's not even short, you can do (quadratic still): > > print [x for x in range(2, 100) if all(x%i for i in range(2, x))] > > In D you can write similar code. > Bye, > bearophil

Re: InstanceType tests in Python-3.0

2008-02-14 Thread Christian Heimes
Robin Becker wrote: > except that unfortunately python 3.0 doesn't have type.InstanceType and > module > types doesn't have those old style ones any more :( Old style classes and hence InstanceType are gone in py3k. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: InstanceType tests in Python-3.0

2008-02-14 Thread Robin Becker
Steven D'Aprano wrote: > On Thu, 14 Feb 2008 15:26:08 +, Robin Becker wrote: > >> I'm in the process of porting some code. I have 2.x code that looks like >> this >> >> t = type(e) >> if t==InstanceType: >> return f0(e) >> elif t in (float,int): >> return f1(e) >> else: >> return s

Re: Floating point bug?

2008-02-14 Thread Gabriel Genellina
En Thu, 14 Feb 2008 15:22:41 -0200, Jeff Schwab <[EMAIL PROTECTED]> escribió: > Christian Heimes wrote: >> No, print invokes the tp_print slot of the float type. Some core types >> have a special handler for print. The tp_print slot is not available >> from Python code and most people don't know

Re: How to tell if I'm being run from a shell or a module

2008-02-14 Thread Chris
On Feb 14, 7:21 pm, [EMAIL PROTECTED] wrote: > Hi all, > > Is there any standard way to tell if the user is running from a module > or from an interactive shell like IDLE or IPython? The best I've come > up with so far is for a function to look at > getouterframes(currentframe())[1][1] (the filenam

Re: How to tell if I'm being run from a shell or a module

2008-02-14 Thread Jeff McNeil
Check to see what the value of '__name__' is, for example: if __name__ == '__main__': execute_interactive_code() else: I_am_just_a_lowly_module() The value of __name__ will correspond to the name of your module: $ cat a.py print __name__ $ $ python Python 2.5.1 (r251:54863, Oct 30 2007, 1

RE: SAGE for FPGA development

2008-02-14 Thread Blubaugh, David A.
Bill, Let me first say that my FPGA experiences are of the following nature: 1.) Developed control algorithms onto a FPGA that were utilized to control a switch-reluctance motor (three-phase as well six-phase). 2.) I am currently in the process of developing a specialized Multidimensional F

Re: XML pickle

2008-02-14 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > On Feb 14, 12:45 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> Readability of the Pickle module. Can one export to XML, from cost of >>> speed and size, to benefit of user-readability? >> Regarding pickling to XML, lxml.objectify can do tha

Re: Getting Wireless Signal Strength / Windows XP

2008-02-14 Thread Tim Golden
[Somehow got stuck in my outbox... ] [EMAIL PROTECTED] wrote: > Hello, > > I'm looking for a way to get wireless signal strength on Windows XP > with Python. I see there's a library for Linux, but I can't find > anything for windows. However, I see that using WMI I can access it in > theory at lea

Re: SAGE for FPGA development

2008-02-14 Thread Stef Mientki
Blubaugh, David A. wrote: > Bill, > > > Let me first say that my FPGA experiences are of the following nature: > > 1.) Developed control algorithms onto a FPGA that were utilized to > control a switch-reluctance motor (three-phase as well six-phase). > > 2.) I am currently in the process of dev

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

2008-02-14 Thread Gabriel Genellina
En Thu, 14 Feb 2008 04:54:56 -0200, W. Watson <[EMAIL PROTECTED]> escribió: > 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

Re: XML pickle

2008-02-14 Thread castironpi
On Feb 14, 12:45 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Hi, > > [EMAIL PROTECTED] wrote: > > Readability of the Pickle module.  Can one export to XML, from cost of > > speed and size, to benefit of user-readability? > > Regarding pickling to XML, lxml.objectify can do that: > > http://codes

Re: Floating point bug?

2008-02-14 Thread Duncan Booth
Jeff Schwab <[EMAIL PROTECTED]> wrote: > Christian Heimes wrote: >> Dennis Lee Bieber wrote: >>> What's wrong with just >>> >>> str(0.3) >>> >>> that's what "print" invokes, whereas the interpreter prompt is using >>> >>> repr(0.3) >>> >> >> No, print invokes the tp_print slot of

Re: Dynamic method parameter access?

2008-02-14 Thread Dennis Kempin
Chris schrieb: > On Feb 12, 9:38 pm, Dennis Kempin <[EMAIL PROTECTED]> wrote: >> Hello, >> >> I have a set of some objects. With these objects I want to call a Python >> method. But the writer of the method shall have the option to select >> from these objects as method parameter. >> >> At the mome

Re: XML pickle

2008-02-14 Thread castironpi
On Feb 14, 12:31 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Feb 14, 12:45 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] wrote: > >>> Readability of the Pickle module.  Can one export to XML, from cost of > >>> speed and size, to benefit of u

Re: Floating point bug?

2008-02-14 Thread robinsiebler
I did try searching, but I never found what I was looking for. This thread has been very useful and informative. Thanks for all your help! I was able to fix my problem. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Copying weakrefs

2008-02-14 Thread Rick Harris
On Feb 14, 12:31 pm, Rick Harris <[EMAIL PROTECTED]> wrote: > I am working with an object, Context, that maintains an identity map > by using the weakref.WeakValueDictionary. I would like to clone this > Context object (and objects that may have a Context object) using > copy.deepcopy(). When I try

Outlook .NK2 record processing

2008-02-14 Thread babycode
How do I process records in MS Outlook.NK2 files? -- http://mail.python.org/mailman/listinfo/python-list

Re: Copying weakrefs

2008-02-14 Thread Rick Harris
On Feb 14, 12:31 pm, Rick Harris <[EMAIL PROTECTED]> wrote: > I am working with an object, Context, that maintains an identity map > by using the weakref.WeakValueDictionary. I would like to clone this > Context object (and objects that may have a Context object) using > copy.deepcopy(). When I try

Re: Dynamic method parameter access?

2008-02-14 Thread Peter Otten
Dennis Kempin wrote: > Chris schrieb: >> On Feb 12, 9:38 pm, Dennis Kempin <[EMAIL PROTECTED]> wrote: >>> Hello, >>> >>> I have a set of some objects. With these objects I want to call a Python >>> method. But the writer of the method shall have the option to select >>> from these objects as metho

Re: XML pickle

2008-02-14 Thread Stefan Behnel
Hi, [EMAIL PROTECTED] wrote: > Stefan Behnel wrote: >> What I meant was: please state what you are trying to do. What you describe >> are the environmental conditions and possible solutions that you are >> thinking of, but it doesn't tell me what problem you are actually trying >> to solve. http:

Re: pyinstall and matplotlib

2008-02-14 Thread John Henry
Thank you for the response. I am having trouble using the script. I am assuming the TUI is the application this script was developed for and did my best to replace that with the name of my own. To make things simple, let's say we take one of the sample matplotlib program MULTICOLOR.PY and place

Re: mmap and shared memory

2008-02-14 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Nikita the Spider wrote: > > In article <[EMAIL PROTECTED]>, > > Jeff Schwab <[EMAIL PROTECTED]> wrote: > > > >> greg wrote: > >>> Carl Banks wrote: > In C you can use the mmap call to request a specific physical loca

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

2008-02-14 Thread W. Watson
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]> > escribió: > >> See Subject. It's a simple txt file, each line is a Python stmt, but I >> need >> up to four digits a

RE: SAGE for FPGA development

2008-02-14 Thread Blubaugh, David A.
because labview is neither free nor open source. Labview is not the route to go for someone like me who has no real capital. David Blubaugh -Original Message- From: Stef Mientki [mailto:[EMAIL PROTECTED] Sent: Thursday, February 14, 2008 1:25 PM To: python-list@python.org Sub

Re: SAGE for FPGA development

2008-02-14 Thread Stef Mientki
Blubaugh, David A. wrote: > because labview is neither free nor open source. Labview is not the > route to go for someone like me who has no real capital. > > I thought you were doing your master thesis ? And LabView is almost for free, for people linked in anyway to an educational institut

RELEASED Python 2.5.2, release candidate 1

2008-02-14 Thread Martin v. Löwis
On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.5.2 (release candidate 1). This is the second bugfix release of Python 2.5. Python 2.5 is now in bugfix-only mode; no new features are being added. According to the release notes, over

Re: Is there a way to use .NET DLL from Python

2008-02-14 Thread Fuzzyman
On Feb 13, 6:58 pm, "Luis M. González" <[EMAIL PROTECTED]> wrote: > On 13 feb, 00:26, Dino Viehland <[EMAIL PROTECTED]> wrote: > > > >> Oh, I know what you mean. > > >> But that was exactly the reason for having a .DLLs folder, isn't it? > > >> When you place an assembly into this folder, you avoid

Re: How to tell if I'm being run from a shell or a module

2008-02-14 Thread dg . google . groups
Thanks for the replies, but it's not what I meant. What I want to be able to determine is whether or not the user is running from an interactive shell (like IPython or IDLE). Checking if __name__=='__main__' checks if the current module is the one being run, but suppose you have two modules A and B

Re: How to tell if I'm being run from a shell or a module

2008-02-14 Thread Gabriel Genellina
En Thu, 14 Feb 2008 19:09:10 -0200, <[EMAIL PROTECTED]> escribió: > Thanks for the replies, but it's not what I meant. What I want to be > able to determine is whether or not the user is running from an > interactive shell (like IPython or IDLE). Checking if > __name__=='__main__' checks if the

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

2008-02-14 Thread Jaap Spies
Gabriel Genellina wrote: > En Thu, 14 Feb 2008 04:54:56 -0200, W. Watson <[EMAIL PROTECTED]> > escribió: > >> 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

Req: PYTHON 2.4 PROGRAMMER(Direct Client)

2008-02-14 Thread sarosh
Friends , I need a Python Developer Please send resume with rate and contact to [EMAIL PROTECTED] Duration : Long term Location: NYC Interview : Immediately Rate: open Experience with: Required Skills: Python 2.4 or greater Twisted Matrix 2.5 Object Oriented Programming Threade

Re: InstanceType tests in Python-3.0

2008-02-14 Thread Steven D'Aprano
On Thu, 14 Feb 2008 17:21:20 +, Robin Becker wrote: > Steven D'Aprano wrote: >> On Thu, 14 Feb 2008 15:26:08 +, Robin Becker wrote: >> >>> I'm in the process of porting some code. I have 2.x code that looks >>> like this >>> >>> t = type(e) >>> if t==InstanceType: >>> return f0(e) >>>

  1   2   >