Re: Python Question About Compiling.

2006-11-29 Thread Gabriel G
At Thursday 30/11/2006 03:40, Scheol Service wrote: i know this. Is there better directions on how to use it? Have you tried it? What's your actual problem? See http://www.py2exe.org/ -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio

Re: Python Question About Compiling.

2006-11-29 Thread Fredrik Lundh
Scheol Service wrote: > Im just unsure on how to compile python code into .exe executionable > files. Is there a simple way to do this? typing "compile python code" into google gives you http://effbot.org/zone/python-compile.htm which gives you some background, and links to a bunch of bun

Re: Python Question About Compiling.

2006-11-29 Thread Gabriel Genellina
At Thursday 30/11/2006 02:02, Scheol Service wrote: Im just unsure on how to compile python code into .exe executionable files. Is there a simple way to do this? py2exe -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tu

XML blooming

2006-11-29 Thread Paddy
(That is bloom as in http://www.wmhelp.com/xmlpad2.htm ;-) Suddenly, OK, over a number of months, our design environment at work has sprouted a wealth of XML configuration files, DTD's etc. The time has come when I need to loose my XML cherry. So , I guess I need to learn Elementtree. In supporti

Python Question About Compiling.

2006-11-29 Thread Scheol Service
-- Forwarded message -- From: Scheol Service <[EMAIL PROTECTED]> Date: Nov 29, 2006 10:57 PM Subject: Python Question About Compiling. To: mailto:python-list@python.org Im just unsure on how to compile python code into .exe executionable files. Is there a simple way to do this? -

Re: Why are slice indices the way they are in python?

2006-11-29 Thread Terry Reedy
"Steve Bergman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >A couple of off the wall questions. > > It seems to me that there is usually a solid *reason* for things in > Python and I'm wondering about the rationale for the way slicing works Yes, see below. > my_string[2:5] > >

Re: About alternatives to Matlab

2006-11-29 Thread Bill Maxwell
On 16 Nov 2006 13:09:03 -0800, "sturlamolden" <[EMAIL PROTECTED]> wrote: ...SNIP... >To compare Matlab with NumPy we can e.g. use the D4 discrete wavelet >transform. I have here coded it in Matlab and Python/NumPy using Tim >Swelden's lifting scheme. > >First the Matlab version (D4_Transform.m):

Re: a quickie: range - x

2006-11-29 Thread rjtucke
Thanks, all- that helped. Ross -- http://mail.python.org/mailman/listinfo/python-list

Re: odict the Ordered Diction 0.2.2

2006-11-29 Thread jim-on-linux
Thanks for the post, Its become a part time job keeping up with updates. jim-on-linux http://www.inqvista.com On Wednesday 29 November 2006 09:41, Fuzzyman wrote: > After a break of almost a year there has been > an update to `odict the Ordered Dictionary >

Why are slice indices the way they are in python?

2006-11-29 Thread Steve Bergman
A couple of off the wall questions. It seems to me that there is usually a solid *reason* for things in Python and I'm wondering about the rationale for the way slicing works: my_string[2:5] gets you the 3rd through the 3rd through the 5th character of the string because indexing starts at 0 and

Re: a quickie: range - x

2006-11-29 Thread Paul Rubin
"rjtucke" <[EMAIL PROTECTED]> writes: > I want an iterable from 0 to N except for element m (<=M). > I could write > x = range(N) > x.remove(m) > but I want it in one expression. itertools.chain(xrange(0,m), xrange(m+1, N)) -- http://mail.python.org/mailman/listinfo/python-list

Re: Joining data from three different files to be written into three Columns

2006-11-29 Thread Dawn Abbott
No, two of the binary data files are integers and the third file is a float. The data is large and the binary saves time and space. On 11/29/06, Gabriel Genellina <[EMAIL PROTECTED]> wrote: At Wednesday 29/11/2006 23:07, Dawn Abbott wrote: >I have three files of binary data. I want to write

Re: a quickie: range - x

2006-11-29 Thread Steven D'Aprano
On Wed, 29 Nov 2006 19:42:16 -0800, rjtucke wrote: > I want an iterable from 0 to N except for element m (<=M). > I could write > x = range(N) > x.remove(m) > but I want it in one expression. Because the world will end if you can't? What's wrong with the solution you already have? If you need to

Re: a quickie: range - x

2006-11-29 Thread johnzenger
(x for x in xrange(N+1) if x != m) rjtucke wrote: > I want an iterable from 0 to N except for element m (<=M). > I could write > x = range(N) > x.remove(m) > but I want it in one expression. > > Thanks, > Ross -- http://mail.python.org/mailman/listinfo/python-list

a quickie: range - x

2006-11-29 Thread rjtucke
I want an iterable from 0 to N except for element m (<=M). I could write x = range(N) x.remove(m) but I want it in one expression. Thanks, Ross -- http://mail.python.org/mailman/listinfo/python-list

PythonTidy

2006-11-29 Thread Chuck Rhode
I couldn't find a routine to clean up, regularize, and reformat Python code, so I wrote one: http://www.lacusveris.com/PythonTidy/PythonTidy.python Now, I'm looking for beta-testers. Compensation is a bit on the low side. In fact it's limited to the satisfaction of helping out. Thanks. -- .

Re: Joining data from three different files to be written into three Columns

2006-11-29 Thread Gabriel Genellina
At Wednesday 29/11/2006 23:07, Dawn Abbott wrote: I have three files of binary data. I want to write the three binary data files to one file. I want the old files to each have their own column in the new file. This is what I have, f=open('relative_x.INT32','rb') a=array('l') a.fromfile(f,1

Re: How to detect what type a variable is?

2006-11-29 Thread Calvin Spealman
On 29 Nov 2006 07:36:26 -0800, Leandro Ardissone <[EMAIL PROTECTED]> wrote: > Hi, > > I want to know what type is a variable. > For example, I get the contents of an xml but some content is a list or > a string, and I need to know what type it is. > > Thanks > > -- > http://mail.python.org/mailman/

Re: [help] Is it true to call obj.__str__() while executing "print obj"?

2006-11-29 Thread Calvin Spealman
On 11/29/06, Tommy Zong <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > > > I am learning metaclass by reading "Metaclass programming in Python, Part > 2". I have a question as following and had tried to search from internet and > also have read the article "Unifying types and classes in Python 2.

Joining data from three different files to be written into three Columns

2006-11-29 Thread Dawn Abbott
I have three files of binary data. I want to write the three binary data files to one file. I want the old files to each have their own column in the new file. This is what I have, f=open('relative_x.INT32','rb') a=array('l') a.fromfile(f,10) g=open('relative_y.INT32','rb') b=array('l') b.from

PyLint syntax question

2006-11-29 Thread Brendon
Hi, This may seem like a stupid question, but I'd like to know anyway. How do I used pylint's --ignore option to prevent it from looking at some files? The documentation says you have to use a base name. What the heck is a base name? Are there any other ways to stop it looking at certain files

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread George Sakkis
Will McGugan wrote: > > #!/usr/bin/python -OO > > import math > > import sys > > import psyco > > > > psyco.full() > > > > def primes(): > > primes=[3] > > for x in xrange(5,1000,2): > > maxfact = int(math.sqrt(x)) > > flag=True > > for y in primes: > >

[help] Is it true to call obj.__str__() while executing "print obj"?

2006-11-29 Thread Tommy Zong
Hi, I am learning metaclass by reading "Metaclass programming in Python, Part 2". I have a question as following and had tried to search from internet and also have read the article "Unifying types and classes in Python 2.2" but failed to get satisfied answer. Could you please give me any comme

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread Gabriel Genellina
At Wednesday 29/11/2006 20:35, Steve Bergman wrote: BTW, strictly speaking, shouldn't I be adding something to the floating point sqrt result, before converting to int, to allow for rounding error? If it is supposed to be 367 but comes in at 366., don't I potentially classify a composit

Re: How to detect what type a variable is?

2006-11-29 Thread Dustan
Eduardo "EdCrypt" O. Padoan wrote: > > > > One might prefer to check for string-ness, as strings can > > duck-type somewhat like lists: > > > > my_list = ['my', 'brain', 'hurts'] > > my_string = 'Are you the brain specialist?' > > > > for test in [my_list, my_string]: > > try: > > fo

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread Steven D'Aprano
On Wed, 29 Nov 2006 15:35:39 -0800, Steve Bergman wrote: > BTW, strictly speaking, shouldn't I be adding something to the floating > point sqrt result, before converting to int, to allow for rounding > error? If you don't mind doing no more than one unnecessary test per candidate, you can just

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread dickinsm
On Nov 29, 6:59 pm, "Steve Bergman" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > BTW, can this code be made any more efficient? > > > I'm not sure, but the following code takes around 6 seconds on my > > 1.2Ghz iBook. How does it run on your machine? > > Hmm. Come to think of it,

for i in range() anti-pattern [was Re: trouble writing results to files]

2006-11-29 Thread Steven D'Aprano
On Wed, 29 Nov 2006 17:00:30 +0100, Fredrik Lundh wrote: > Neil Cerutti wrote: > >>> BTW, iterating over range(len(a)) is an anti-pattern in Python. >> >> Unless you're modifying elements of a, surely? > > and needs to run on a Python version that doesn't support enumerate. This isn't meant as

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread Steve Bergman
[EMAIL PROTECTED] wrote: > > BTW, can this code be made any more efficient? > > I'm not sure, but the following code takes around 6 seconds on my > 1.2Ghz iBook. How does it run on your machine? > > Hmm. Come to think of it, my algorithm isn't the sieve. Anyway, this is indeed fast as long as y

Re: About alternatives to Matlab

2006-11-29 Thread aap
John Henry wrote: > Bill Gates will have you jailed! :-) > > On a more serious note, is there any alternative to Simulink though? > It's called SciCos, and as far as I've seen it not only covers Simulink but also PowerSim. I found only 1 major disadvantage inSciLab, ... ... it has no ActiveX che

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread Steve Bergman
Will McGugan wrote: > Some trivial optimizations. Give this a whirl. I retimed and got 9.7 average for 3 runs on my version. Yours got it down to 9.2. 5% improvement. Not bad. (Inserting '2' at the beginning doesn't seem to impact performance much.;-) ) BTW, strictly speaking, shouldn't I b

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread dickinsm
> BTW, can this code be made any more efficient? I'm not sure, but the following code takes around 6 seconds on my 1.2Ghz iBook. How does it run on your machine? def smallPrimes(n): """Given an integer n, compute a list of the primes < n""" if n <= 2: return [] sieve = range

Re: SPE refuses.

2006-11-29 Thread SPE - Stani's Python Editor
Do you have python-wxversion installed? $sudo apt-get install python-wxversion Stani On 29 nov, 23:21, egbert <[EMAIL PROTECTED]> wrote: > On Wed, Nov 29, 2006 at 11:31:27AM -0800, SPE - Stani's Python Editor wrote:> > If wxPython is rightly installed, which means that "import wx" works > > fin

Re: utf - string translation

2006-11-29 Thread John Machin
Fredrik Lundh wrote: > John Machin wrote: > > > Another point: there are many non-latin1 characters that could be > > mapped to ASCII. For example: > > u"\u0141ukasziewicz".translate(unaccented_map()) > > doesn't work unless an entry is added to the no-decomposition table: > > 0x0141: u"L"

Re: Good script editor for Python on Mac OS 10.3

2006-11-29 Thread SPE - Stani's Python Editor
Install wxPython and than you can use SPE, a free Python IDE with UML, GUI builders, ... Stani Scott_Davies wrote: > Hi, > > I have an old Mac with OS X Panther installed. I also have the Python > language download file, but I haven't got a text/script editor to use > for it. Does anyone have a

Re: Detecting recursion loops

2006-11-29 Thread Ben Finney
robert <[EMAIL PROTECTED]> writes: > Carl Banks wrote: > > 2. Consider whether you're unwittingly trying to cover up a bug. > > ISTM no matter how problematic the input is, you should at least > > be able to make progress on it. Are you getting this error > > because, say, you're not incrementing

Re: Good script editor for Python on Mac OS 10.3

2006-11-29 Thread Stephen Eilert
Lou Pecora escreveu: > In article <[EMAIL PROTECTED]>, > "Scott_Davies" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > I have an old Mac with OS X Panther installed. I also have the Python > > language download file, but I haven't got a text/script editor to use > > for it. Does anyone have a re

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread Will McGugan
Beliavsky wrote: > > The number 1 is not generally considered to be a prime number -- see > http://mathworld.wolfram.com/PrimeNumber.html . > I stand corrected. -- blog: http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread Beliavsky
Will McGugan wrote: > Steve Bergman wrote: > > Just wanted to report a delightful little surprise while experimenting > > with psyco. > > The program below performs astonoshingly well with psyco. > > > > It finds all the prime numbers < 10,000,000 > > Actualy, it doesn't. You forgot 1 and 2. The n

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread Will McGugan
Steve Bergman wrote: > Just wanted to report a delightful little surprise while experimenting > with psyco. > The program below performs astonoshingly well with psyco. > > It finds all the prime numbers < 10,000,000 Actualy, it doesn't. You forgot 1 and 2. Will McGugan -- blog: http://www.will

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread Will McGugan
> #!/usr/bin/python -OO > import math > import sys > import psyco > > psyco.full() > > def primes(): > primes=[3] > for x in xrange(5,1000,2): > maxfact = int(math.sqrt(x)) > flag=True > for y in primes: > if y > maxfact: > break >

Re: ensuring valid latin-1

2006-11-29 Thread John Machin
Chris Curvey wrote: > Hey all, > > I'm trying to write something that will "fail fast" if one of my users > gives me non-latin-1 characters. So I tried this: > > >>> testString = "\x80" > >>> foo = unicode(testString, "latin-1") > >>> foo > u'\x80' > > I would have thought that that should have ra

Re: SPE refuses.

2006-11-29 Thread egbert
On Wed, Nov 29, 2006 at 11:31:27AM -0800, SPE - Stani's Python Editor wrote: > If wxPython is rightly installed, which means that "import wx" works > fine and "wx.VERSION" gives the right version, you can ignore the > wxPython warning. > In a Python shell the commands 'import wx' and 'wx.VERSION'

Re: utf - string translation

2006-11-29 Thread Fredrik Lundh
John Machin wrote: > Another point: there are many non-latin1 characters that could be > mapped to ASCII. For example: > u"\u0141ukasziewicz".translate(unaccented_map()) > doesn't work unless an entry is added to the no-decomposition table: > 0x0141: u"L", # LATIN CAPITAL LETTER L WITH STR

Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread Steve Bergman
Just wanted to report a delightful little surprise while experimenting with psyco. The program below performs astonoshingly well with psyco. It finds all the prime numbers < 10,000,000 Processor is AMD64 4000+ running 32 bit. Non psyco'd python version takes 94 seconds. psyco'd version takes 9.

Re: utf - string translation

2006-11-29 Thread John Machin
Fredrik Lundh wrote: > John Machin wrote: > > > 3. ... and to check for missing maps. The OP may be working only with > > French text, and may not care about Icelandic and German letters, but > > other readers who stumble on this (and miss past thread(s) on this > > topic) may like something done

ensuring valid latin-1

2006-11-29 Thread Chris Curvey
Hey all, I'm trying to write something that will "fail fast" if one of my users gives me non-latin-1 characters. So I tried this: >>> testString = "\x80" >>> foo = unicode(testString, "latin-1") >>> foo u'\x80' I would have thought that that should have raised an error, because \x80 is not a va

Re: Good script editor for Python on Mac OS 10.3

2006-11-29 Thread Stephen Hansen
If you're looking for something free, there's always IDLE. http://www.python.org/download/mac/ However, if you don't mind paying a little bit-- you should really look at TextMate at http://www.macromates.com/ It's .. the best editor ever :) I'm the envy of all my windows coworkers who I had prev

Re: type(foo) == function ?

2006-11-29 Thread Chris Mellon
On 11/29/06, Tom Plunket <[EMAIL PROTECTED]> wrote: > Erik Max Francis wrote: > > > In dynamically-typed languages in general, explicit typechecks are not > > a good idea, since they often preclude user-defined objects from being > > used. Instead, try performing the call and catch the resulting >

Re: type(foo) == function ?

2006-11-29 Thread Tom Plunket
Erik Max Francis wrote: > In dynamically-typed languages in general, explicit typechecks are not > a good idea, since they often preclude user-defined objects from being > used. Instead, try performing the call and catch the resulting > TypeError: Good point, although I need to figure out if

Re: Good script editor for Python on Mac OS 10.3

2006-11-29 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, Lou Pecora <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > "Scott_Davies" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > I have an old Mac with OS X Panther installed. I also have the Python > > language download file, but I haven't got a text/scri

Re: Python program that validates an url against w3c markup validator

2006-11-29 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, "yaru22" <[EMAIL PROTECTED]> wrote: > I'd like to create a program that validates bunch of urls against the > w3c markup validator (http://validator.w3.org/) and store the result in > a file. > > Since I don't know network programming, I have no idea how to start

Re: Re: Good script editor for Python on Mac OS 10.3

2006-11-29 Thread Timothy Grant
On 11/29/06, Lou Pecora <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > "Scott_Davies" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > I have an old Mac with OS X Panther installed. I also have the Python > > language download file, but I haven't got a text/script editor to use > > fo

Re: Good script editor for Python on Mac OS 10.3

2006-11-29 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, "Scott_Davies" <[EMAIL PROTECTED]> wrote: > Hi, > > I have an old Mac with OS X Panther installed. I also have the Python > language download file, but I haven't got a text/script editor to use > for it. Does anyone have a recommendation for a good Python text >

Re: type(foo) == function ?

2006-11-29 Thread Fredrik Lundh
Tom Plunket wrote: > I'd like to figure out if a given parameter is a function or not. http://effbot.org/pyref/callable -- http://mail.python.org/mailman/listinfo/python-list

Re: type(foo) == function ?

2006-11-29 Thread Erik Max Francis
Hi Tom. Tom Plunket wrote: > I'd like to figure out if a given parameter is a function or not. > > E.g. > type(1) > type(1) == int > True > > implies: > def foo(): > ... pass > ... type(foo) > type(foo) == function > Traceback (most recent call last): > File "",

Re: type(foo) == function ?

2006-11-29 Thread Chris Mellon
On 11/29/06, Tom Plunket <[EMAIL PROTECTED]> wrote: > I'd like to figure out if a given parameter is a function or not. > > E.g. > > >>> type(1) > > >>> type(1) == int > True > > implies: > > >>> def foo(): > ... pass > ... > >>> type(foo) > > >>> type(foo) == function > Traceback (most recent

type(foo) == function ?

2006-11-29 Thread Tom Plunket
I'd like to figure out if a given parameter is a function or not. E.g. >>> type(1) >>> type(1) == int True implies: >>> def foo(): ... pass ... >>> type(foo) >>> type(foo) == function Traceback (most recent call last): File "", line 1, in ? NameError: name 'function' is not defined Is th

Re: why would anyone use python when java is there?

2006-11-29 Thread Stephen Eilert
Score: -1 (Flamebait) gavino escreveu: > wtf -- http://mail.python.org/mailman/listinfo/python-list

Re: utf - string translation

2006-11-29 Thread Fredrik Lundh
John Machin wrote: > 3. ... and to check for missing maps. The OP may be working only with > French text, and may not care about Icelandic and German letters, but > other readers who stumble on this (and miss past thread(s) on this > topic) may like something done with \xde (capital thorn), \xfe

Re: libboost, python, and dijkstra shortest path

2006-11-29 Thread Roman Yakovenko
On 29 Nov 2006 11:35:52 -0800, Bytter <[EMAIL PROTECTED]> wrote: > Ok, found the solution here: http://www.osl.iu.edu/~dgregor/bgl-python/ > > But still cannot make anything that works... Anyone who has experience > in this area can help me with the following code: > > import boost as bgl > > graph

Re: pickle and infinity

2006-11-29 Thread Grant Edwards
On 2006-11-29, Bart Ogryczak <[EMAIL PROTECTED]> wrote: > > Fredrik Lundh wrote: >> Bart Ogryczak wrote: >> >> > I´ve got this problem with pickle, it seems it doesn´t handle >> > correctly infinite values (nor does Python return overflow/underflow >> > error). >> >> Python 2.X relies on the C libr

Good script editor for Python on Mac OS 10.3

2006-11-29 Thread Scott_Davies
Hi, I have an old Mac with OS X Panther installed. I also have the Python language download file, but I haven't got a text/script editor to use for it. Does anyone have a recommendation for a good Python text editor in OS 10.3? Thanks, Scott D. -- http://mail.python.org/mailman/listinfo/pyth

Re: utf - string translation

2006-11-29 Thread John Machin
Frederic Rentsch wrote: > Try this: > > from_characters = > '\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xff\xe7\xe8\xe9\xea\x

buildbot

2006-11-29 Thread Bryan
does anyone know if processes defined around buildbot would be similar to the one used by the mozilla seamonkey project which uses tinderbox? this link shows an example of an entire checkin cycle using tinderbox and it's quite detailed and gives a very good picture of what using the product would

Re: why would anyone use python when java is there?

2006-11-29 Thread gregarican
He trolls other groups as well. Smalltalk for example --> http://groups.google.com/group/comp.lang.smalltalk/browse_thread/thread/1c83e576be824633/927227555661a2cd?lnk=gst&q=gavino&rnum=1#927227555661a2cd. There are at least a dozen recent posts where he asks some obvious trollling line of question

Re: libboost, python, and dijkstra shortest path

2006-11-29 Thread Bytter
Ok, found the solution here: http://www.osl.iu.edu/~dgregor/bgl-python/ But still cannot make anything that works... Anyone who has experience in this area can help me with the following code: import boost as bgl graph = bgl.Graph() a = graph.add_vertex() b = graph.add_vertex() e = graph.add_edg

Re: SPE refuses.

2006-11-29 Thread SPE - Stani's Python Editor
If wxPython is rightly installed, which means that "import wx" works fine and "wx.VERSION" gives the right version, you can ignore the wxPython warning. Please cd do your site-packages directory and do "python SPE.py --debug" and see the error message. Stani On 29 nov, 19:51, egbert <[EMAIL PROT

Re: Surprise with special floating point values

2006-11-29 Thread prouleau001
On Nov 29, 1:11 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > While trying to use simplejson under Python 2.4.3 I have been > > investigating the handling of special floating point valuesnote that JSON > > doesn't support non-numeric floating point values, as can >

RE: Python work in UK

2006-11-29 Thread Sells, Fred
The technical director of Cabletron used to write applications in Python, then give the working product/code to the development group to convert. Perhaps you could build stuff in Python and outsource the conversion to India? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECT

Re: OODB vs RDBMS

2006-11-29 Thread Magnus Lycka
Thomas Guettler wrote: > Hi, > > most of the time I use ZODB/Durus to store my data. > > I like it, but I know that it has some weaknesses: > - only accesible from python > - I need to code your indexes for fast searching yourself. There are other features of relational database systems that I

SPE refuses.

2006-11-29 Thread egbert
According to apt-show-versions I have installed: python-wxgtk2.6 2.6.3.2.1.5 spe 0.8.2a+repack-1 However when I start SPE I get the message You need to install at least wxPython v2.5.4.1 to run SPE How do I tell SPE that I have the right wxPython ? e. -- Egbert Bouwman - Keizersgrach

Re: Detecting recursion loops

2006-11-29 Thread John Machin
robert wrote: > > the "bug" comes in from the I/O input. > Have you considered checking your input for valid values? Cheers, John -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle and infinity

2006-11-29 Thread Bart Ogryczak
Fredrik Lundh wrote: > Bart Ogryczak wrote: > > > I´ve got this problem with pickle, it seems it doesn´t handle > > correctly infinite values (nor does Python return overflow/underflow > > error). > > Python 2.X relies on the C library to serialize floats, and, as you've > noticed, some C librarie

Re: Detecting recursion loops

2006-11-29 Thread robert
Carl Banks wrote: > robert wrote: >> My code does recursion loops through a couple of functions. Due to >> problematic I/O input this leads sometimes to "endless" recursions and after >> expensive I/O to the Python recursion exception. >> What would be a good method to detect recursion loops and

Re: Detecting recursion loops

2006-11-29 Thread robert
Rob Wolfe wrote: > robert wrote: >> My code does recursion loops through a couple of functions. Due to >> problematic I/O input this leads sometimes to "endless" recursions and after >> expensive I/O to the Python recursion exception. >> What would be a good method to detect recursion loops and s

Re: Surprise with special floating point values

2006-11-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > While trying to use simplejson under Python 2.4.3 I have been > investigating the handling of special floating point values note that JSON doesn't support non-numeric floating point values, as can be seen by the "number" syntax description on this page: http://w

Re: pyxpcom

2006-11-29 Thread hg
Trent Mick wrote: > hg wrote: >> Trent Mick wrote: My need is as follows: I have developed an activex component to access a smart card on the client side / do some web site logon. Are xpcom / pyxpcom advanced/stable enough for such an implementation under Linux / Windo

Re: pickle and infinity

2006-11-29 Thread Fredrik Lundh
Bart Ogryczak wrote: > I´ve got this problem with pickle, it seems it doesn´t handle > correctly infinite values (nor does Python return overflow/underflow > error). Python 2.X relies on the C library to serialize floats, and, as you've noticed, some C libraries can produce values that they them

Re: Surprise with special floating point values

2006-11-29 Thread prouleau001
On Nov 29, 12:53 pm, [EMAIL PROTECTED] wrote: > Hi all, > > While trying to use simplejson under Python 2.4.3 I have been > investigating the handling of special floating point values and found > that both Python 2.4 and 2.5 return False when comparing a NaN with > itself. Although surprising,

Re: Detecting recursion loops

2006-11-29 Thread Bytter
Hi! I hope you are not trying to find infinite loops and I simply misunderstood your question. Because if you are, then forget it (Turing anyone?)... Infinite loops are impossible to find (minus some few, very specific situations). Cf. http://en.wikipedia.org/wiki/Halting_problem Cheers, Hugo F

Surprise with special floating point values

2006-11-29 Thread prouleau001
Hi all, While trying to use simplejson under Python 2.4.3 I have been investigating the handling of special floating point values and found that both Python 2.4 and 2.5 return False when comparing a NaN with itself. Although surprising, I imagine it could also be correct since NaN is not a numb

libboost, python, and dijkstra shortest path

2006-11-29 Thread Bytter
Hi everyone, I need to implement a very quick (performance-wise) Dijkstra shortest path in python, and found that libboost already has such thing. Problem is: I cannot find the installation package for my Python 2.4 under windows. Can someone please provide me instructions for installing libboost

Re: How to detect what type a variable is?

2006-11-29 Thread Eduardo \"EdCrypt\" O. Padoan
> > One might prefer to check for string-ness, as strings can > duck-type somewhat like lists: > > my_list = ['my', 'brain', 'hurts'] > my_string = 'Are you the brain specialist?' > > for test in [my_list, my_string]: > try: > for thing in test: > process_list_item(thing)

Re: Using Python

2006-11-29 Thread Larry Bates
beemer328i2004 wrote: > Hi Guys, > > I am new to this language and i need some help... > > I am trying to create a script that will go into a log file and bring > me back the xml from an order... > > For example: > > go into Log1.xml and extract order number 2 from top to bottom and > extract

Re: How to refer to Python?

2006-11-29 Thread Bart Ogryczak
Sebastian Bassi wrote: > I am writing a paper where I refer to Python. Is there a paper that I > can refer the reader to? Or just use the Python web page as a > reference? I´d refer to "The Python Language Reference Manual", Guido Van Rossum, Fred L., Jr. Drake Network Theory Ltd (September 2003)

Re: pickle and infinity

2006-11-29 Thread Grant Edwards
On 2006-11-29, Bart Ogryczak <[EMAIL PROTECTED]> wrote: > I´ve got this problem with pickle, it seems it doesn´t handle > correctly infinite values (nor does Python return > overflow/underflow error). What could I do about it? Here's what I did. I'm sure it'll fall down on some systems, but it w

Re: pickle and infinity

2006-11-29 Thread Bart Ogryczak
To make things more interesting -- Solaris version: >>> x = 1e310 >>> x Infinity >>> import pickle >>> pickle.dumps(x) 'FInfinity\n.' >>> pickle.loads(_) Infinity >>> pickle.dumps(x,1) [...] SystemError: frexp() result out of range -- http://mail.python.org/mailman/listinfo/python-list

pickle and infinity

2006-11-29 Thread Bart Ogryczak
Hello, I´ve got this problem with pickle, it seems it doesn´t handle correctly infinite values (nor does Python return overflow/underflow error). What could I do about it? Example code: >>> x = 1e310 #actually it would be a result of calculations >>> type(x) >>> x 1.#INF >>> import pickle >>> pic

Re: How to detect what type a variable is?

2006-11-29 Thread Tim Chase
>> I want to know what type is a variable. > > You should try to treat it as a list, catch the exceptions > raise when it is a string (problably ValueError, TypeError ou > Attribute error, depends on what are you doing), and then > treat it as a string. This is the BAFP (better ask for > forgivene

Re: How to detect what type a variable is?

2006-11-29 Thread Grant Edwards
On 2006-11-29, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Leandro Ardissone wrote: >> Hi, >> >> I want to know what type is a variable. >> For example, I get the contents of an xml but some content is a list or >> a string, and I need to know what type it is. > > You should try to treat it as

Re: Processing Solid Edge objects

2006-11-29 Thread obnmfrbeqzgkst
I've done a similar thing with Python and Catia in the past. I used late binding to the Catia objects and I didn't have any real issues. Things to remember: Remove all of the "Set" statements No need to : set obj = XYZ just obj =XYZ Include the brackets with all Sub calls. VB is sloppy and

Re: How to refer to Python?

2006-11-29 Thread Alan Isaac
On Tue, 28 Nov 2006 16:51:10 -0500, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > http://effbot.org/pyfaq/are-there-any-published-articles-about-python-that-i-can-reference.htm Maybe: http://www.amazon.com/Introduction-Python-Guido-Van-Rossum/dp/0954161769/sr=8-1/qid=1164818994/ref=sr_1_1/102-28183

Re: How to detect what type a variable is?

2006-11-29 Thread Luis M. González
Leandro Ardissone wrote: > great, thanks > > And how I can compare this "" output ? > I want to decide what to do if the var is an string and what to do if > not.. > > Tried with: > if type(artistList) == "": > > and > if type(artistList) == "list": > > but nothing.. You shouldn't enclose "list"

Re: pyxpcom

2006-11-29 Thread Trent Mick
hg wrote: > Trent Mick wrote: >>> My need is as follows: I have developed an activex component to access a >>> smart card on the client side / do some web site logon. >>> >>> Are xpcom / pyxpcom advanced/stable enough for such an implementation >>> under Linux / Windows ? >> You mean to provide the

Re: why would anyone use python when java is there?

2006-11-29 Thread Antoine De Groote
+1 Éric Daigneault wrote: > > wtf > > a reasonable question... > > But before I run circle yelling "the trolls are here, the trolls are > here" I got one for you... > > why would anyone use java when python is there?? > > ;-) > > .^_^. > > Eric :D, > -- http://mail.python.org/mailman/li

Re: Using Python

2006-11-29 Thread hg
beemer328i2004 wrote: > Hi Guys, > > I am new to this language and i need some help... > > I am trying to create a script that will go into a log file and bring > me back the xml from an order... > > For example: > > go into Log1.xml and extract order number 2 from top to bottom and > extract

Re: How to detect what type a variable is?

2006-11-29 Thread [EMAIL PROTECTED]
Leandro Ardissone wrote: > Hi, > > I want to know what type is a variable. > For example, I get the contents of an xml but some content is a list or > a string, and I need to know what type it is. You should try to treat it as a list, catch the exceptions raise when it is a string (problably Valu

Re: why would anyone use python when java is there?

2006-11-29 Thread Adam Jones
gregarican wrote: > gavino wrote: > > wtf > > You have to be trolling I would think. Yeah, gavino has been trolling comp.lang.lisp for quite some time. For the life of me I can't understand why he would troll comp.lang.python when comp.lang.lisp is there. -Adam -- http://mail.python.org/mailma

Re: Overloading "if object" unary operator

2006-11-29 Thread Fredrik Lundh
Sarcastic Zombie wrote: > If I have a class > > class A: > __init__(id) > self.id = id > > is there any way to overload the 'if' unary usage to detect if a > variable has a value? http://effbot.org/pyref/__nonzero__ -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >