Re: PLEASE ACCEPT MY SINCERE APOLOGIES

2008-01-31 Thread Arnaud Delobelle
On Feb 1, 5:08 am, Paddy <[EMAIL PROTECTED]> wrote: > On Feb 1, 1:26 am, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: > > > > > To Everyone on the planet Earth, > > > Please accept my apologies for > > > Why the Hell has nobody answered my question. > > > I am just trying to

Re: dict comprehension

2008-01-31 Thread Arnaud Delobelle
On Feb 1, 6:21 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Daniel Fetchinson" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | Hi folks, > | > | There is a withdrawn PEP about a new syntax for dict comprehension: > |http://www.python.org/dev/peps/pep-0274/which says: > > I be

Re: Bug/Patch: Problem with xml/__init__.py when using freeze.py

2008-01-31 Thread Gabriel Genellina
En Thu, 31 Jan 2008 13:16:47 -0200, glomde <[EMAIL PROTECTED]> escribió: > I tried to do freeze.py for my script that uses ElementTree. > But got the this error: > > File "/usr/lib/python2.5/xml/__init__.py", line 45, in > _xmlplus.__path__.extend(__path__) > AttributeError: 'str' object

Re: Will Python on day replace MATLAB?????????????????????????????????????????????????????

2008-01-31 Thread Ben Finney
"Danyelle Gragsone" <[EMAIL PROTECTED]> writes: > Could you please use less question marks. Yes, preferably a maximum of one sentence-end punctuation mark per sentence. -- \ "When I get real bored, I like to drive downtown and get a | `\ great parking spot, then sit in my ca

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-01-31 Thread Stefan Behnel
John Henry wrote: >> Why the HELL has nobody answered my question >> ! > > Urhpeople in HELL can't answer your question. Try sending your > post to HEAVEN... How do you know people in hell aren't doing any programming in Python? Especially "Gene Expressio

Re: Python Standardization: Wikipedia entry

2008-01-31 Thread Terry Reedy
"Paddy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Feb 1, 12:18 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: | > ANSI does not actually make standards. It make metastandards about how to | > make standards (both style and process) and accredites US standard-making | > bod

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-01-31 Thread John Henry
>Why the HELL has nobody answered my question >! Urhpeople in HELL can't answer your question. Try sending your post to HEAVEN... -- http://mail.python.org/mailman/listinfo/python-list

Re: dict comprehension

2008-01-31 Thread Terry Reedy
"Daniel Fetchinson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi folks, | | There is a withdrawn PEP about a new syntax for dict comprehension: | http://www.python.org/dev/peps/pep-0274/ which says: I believe both set and dict comprehensions will be in 3.0. -- http://mai

Re: dict comprehension

2008-01-31 Thread Daniel Fetchinson
> > Hi folks, > > > > There is a withdrawn PEP about a new syntax for dict comprehension: > > http://www.python.org/dev/peps/pep-0274/ which says: > > > > "Substantially all of its benefits were subsumed by generator > > expressions coupled with the dict() constructor." > > > > What does the author

Re: dict comprehension

2008-01-31 Thread Paddy
On Feb 1, 6:06 am, "Ryan Ginstrom" <[EMAIL PROTECTED]> wrote: > > On Behalf Of Daniel Fetchinson > > What does the author mean here? What's the Preferably One Way > > (TM) to do something analogous to a dict comprehension? > > I imagine something like this: > > >>> keys = "a b c".split() > >>> valu

Re: dict comprehension

2008-01-31 Thread Paul Rubin
"Daniel Fetchinson" <[EMAIL PROTECTED]> writes: > What does the author mean here? What's the Preferably One Way (TM) to > do something analogous to a dict comprehension? from itertools import izip d = dict((k,v) for k,v in izip(keys, values)) -- http://mail.python.org/mailman/listinfo/python-list

Re: dict comprehension

2008-01-31 Thread Gary Herron
Ryan Ginstrom wrote: >> On Behalf Of Daniel Fetchinson >> What does the author mean here? What's the Preferably One Way >> (TM) to do something analogous to a dict comprehension? >> > > I imagine something like this: > > keys = "a b c".split() values = [1, 2, 3] D = dict([(a

Re: dict comprehension

2008-01-31 Thread Gary Herron
Daniel Fetchinson wrote: > Hi folks, > > There is a withdrawn PEP about a new syntax for dict comprehension: > http://www.python.org/dev/peps/pep-0274/ which says: > > "Substantially all of its benefits were subsumed by generator > expressions coupled with the dict() constructor." > > What does the

RE: dict comprehension

2008-01-31 Thread Ryan Ginstrom
> On Behalf Of Daniel Fetchinson > What does the author mean here? What's the Preferably One Way > (TM) to do something analogous to a dict comprehension? I imagine something like this: >>> keys = "a b c".split() >>> values = [1, 2, 3] >>> D = dict([(a, b) for a, b in zip(keys, values)]) >>> D {

Re: REALLY simple xml reader

2008-01-31 Thread Stefan Behnel
Ivan Illarionov wrote: >> Also, for XML documents, they were probably thinking that the >> documents will be machine-generated most of the time. As far as I can >> tell, they were right in that. > > If anybody has to deal with human-generated XML/HTML in Python it may > be better to use something

dict comprehension

2008-01-31 Thread Daniel Fetchinson
Hi folks, There is a withdrawn PEP about a new syntax for dict comprehension: http://www.python.org/dev/peps/pep-0274/ which says: "Substantially all of its benefits were subsumed by generator expressions coupled with the dict() constructor." What does the author mean here? What's the Preferably

Re: Naive idiom questions

2008-01-31 Thread Stargaming
On Thu, 31 Jan 2008 15:30:09 -0600, Terran Melconian wrote: > * Is there a way to get headings in docstrings? > > I want to create my own sections, like "OVERVIEW", "EXAMPLES", > "AUTHORS", "BUGS", etc. I can't figure out any way to do this. In > perldoc, I can easily use =head1, but

Re: best(fastest) way to send and get lists from files

2008-01-31 Thread Paddy
On Jan 31, 7:34 pm, "Abrahams, Max" <[EMAIL PROTECTED]> wrote: > I've looked into pickle, dump, load, save, readlines(), etc I've used the following sometimes: from pprint import pprint as pp print "data = \\" pp(data) That created a python file that could be read as a module, but there are limit

Re: PLEASE ACCEPT MY SINCERE APOLOGIES

2008-01-31 Thread Paddy
On Feb 1, 1:26 am, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: > To Everyone on the planet Earth, > > Please accept my apologies for > > Why the Hell has nobody answered my question. > > I am just trying to finish a Masters thesis that is quite beyond > anything in this worl

Re: Python Standardization: Wikipedia entry

2008-01-31 Thread Paddy
On Feb 1, 12:18 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "John Nagle" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > Submitting Python 2.5 to ISO/ANSI might be a good idea. > > ANSI does not actually make standards. It make metastandards about how to > make standards

Re: Will Python on day replace MATLAB?????????????????????????????????????????????????????

2008-01-31 Thread [EMAIL PROTECTED]
Hi David I am not familiar with ImpulseC. I think it may be unlikely for Python to replace MATLAB - maybe Python has less specialized libraries than MATLAB but Python has the width of applications. I will be hardpressed to think of a convincing argument to teach MATLAB as a replacement of Python/

PyWeek 6 is coming!

2008-01-31 Thread richard
PyWeek 6 will run from 00:00 UTC on March 30th through to 00:00 UTC on April 6th. Registration is NOT OPEN YET. It will open on Friday 2008/02/29. If you're new (or even coming back again) please have a look at the rules and help pages at http://www.pyweek.org/ The PyWeek challenge: 1. Inv

Re: char string 2 hex string

2008-01-31 Thread Jared Grubb
You could also do: "".join(['%02x' % ord(c) for c in 'AAA']) On 31 Jan 2008, at 14:09, Paul Rubin wrote: Antonio Chay <[EMAIL PROTECTED]> writes: "AAA" should be "414141" 'AAA'.encode('hex') -- http://mail.python.org/mailman/listinfo/python-list On 31 Jan 2008, at 14:05, Antonio Chay wrot

Re: Will Python on day replace MATLAB?????????????????????????????????????????????????????

2008-01-31 Thread chewie54
> I have been evaluating the python environment ever more closer. I > believe I can interface python with a development environment known as > the ImpulseC environment. The ImpulseC environment develops C to VHDL > for FPGA development. I would especially love to interface Python > with Impul

CDA conversion

2008-01-31 Thread Sick Monkey
Good evening. I am trying to write an application in Python that will allow a person to insert a CD into their computer and this python script will convert the music to mp3. NOTE: I have already google'd this, and nothing really pops out at me. I found tons of applications that does this, but I

Re: Will Python on day replace MATLAB?????????????????????????????????????????????????????

2008-01-31 Thread Dan Upton
> with ImpulseC and the graphing capabilities of GNU Plot and SciPy in http://gnuplot-py.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Naive idiom questions

2008-01-31 Thread Paul Rubin
Terran Melconian <[EMAIL PROTECTED]> writes: > I guess for complete symmetry, there should then be frozendicts as well, > although I don't envision a lot of use for them at the moment. There should definitely be frozendicts and I've been wanting to write an implementation. The main thing about th

Re: Naive idiom questions

2008-01-31 Thread Carl Banks
On Jan 31, 4:30 pm, Terran Melconian <[EMAIL PROTECTED]> wrote: > * Why are there no real mutable strings available? > > I found MutableString in UserString, but further research indicates > that it is horribly inefficient and actually just wraps immutable > strings for the implementati

Re: Will Python on day replace MATLAB?????????????????????????????????????????????????????

2008-01-31 Thread Jorge Godoy
Danyelle Gragsone wrote: > Could you please use less question marks. This is not part of his Masters... :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Naive idiom questions

2008-01-31 Thread Terran Melconian
On 2008-01-31, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > Did you measure such impact on your application? > Also see http://www.skymind.com/~ocrow/python_string/ I don't have a real application yet. That was, in fact, exactly the web page which informed me that the MutableString class was

Re: Will Python on day replace MATLAB?????????????????????????????????????????????????????

2008-01-31 Thread Danyelle Gragsone
Could you please use less question marks. thanks -- http://mail.python.org/mailman/listinfo/python-list

Will Python on day replace MATLAB?????????????????????????????????????????????????????

2008-01-31 Thread Blubaugh, David A.
To All, I have been evaluating the python environment ever more closer. I believe I can interface python with a development environment known as the ImpulseC environment. The ImpulseC environment develops C to VHDL for FPGA development. I would especially love to interface Python with Impul

Re: How to identify which numbers in a list are within each others' range

2008-01-31 Thread George Sakkis
On Jan 31, 7:11 pm, Paul Rubin wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > True... Any lighter-weight implementation of > > sets out there? That is, one that would defer > > use of resources until actually needed -- > > somewhat akin to the distinction

Re: Naive idiom questions

2008-01-31 Thread Terran Melconian
On 2008-02-01, Roger Miller <[EMAIL PROTECTED]> wrote: > On Jan 31, 11:48 am, Grant Edwards <[EMAIL PROTECTED]> wrote: >> I'm not sure what you're asking. AFAIK, the main reason that >> strings are immutable is so they can be used as dict keys. > > I think its more fundamental than that. If strin

PLEASE ACCEPT MY SINCERE APOLOGIES

2008-01-31 Thread Blubaugh, David A.
To Everyone on the planet Earth, Please accept my apologies for Why the Hell has nobody answered my question. I am just trying to finish a Masters thesis that is quite beyond anything in this world. David Blubaugh -Original Message- From: [EMAI

Re: psycopg2

2008-01-31 Thread Steve Holden
Andre' John wrote: > Hi > > I am trying to do this for a Postgresql database: > > conn = psycopg2.connect('host=localhost') > cur = conn.cursor() > cur.execute("SELECT * FROM names WHERE name=%s", ['S']) > > , which doesn't work, and neither does > > cur.execute("SELECT * FROM names WHERE name=

Re: Naive idiom questions

2008-01-31 Thread Roger Miller
On Jan 31, 11:48 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > > I'm not sure what you're asking. AFAIK, the main reason that > strings are immutable is so they can be used as dict keys. > I think its more fundamental than that. If strings were mutable you would be constantly worrying about whe

psycopg2

2008-01-31 Thread Andre' John
Hi I am trying to do this for a Postgresql database: conn = psycopg2.connect('host=localhost') cur = conn.cursor() cur.execute("SELECT * FROM names WHERE name=%s", ['S']) , which doesn't work, and neither does cur.execute("SELECT * FROM names WHERE name='%s'", ['S']) or cur.execute("SELECT *

Re: Removal of element from list while traversing causes the next element to be skipped

2008-01-31 Thread Gabriel Genellina
En Thu, 31 Jan 2008 15:45:42 -0200, <[EMAIL PROTECTED]> escribió: > Hmm, how does this fare?? > > for i in range(len(a)): > if a[i]==99: a=a[:i]+a[i+1:] > > > I like following your guys code noodling. I can come up with something > that does what it appears your doing, sometimes, but as t

Re: Python Standardization: Wikipedia entry

2008-01-31 Thread Terry Reedy
"John Nagle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Submitting Python 2.5 to ISO/ANSI might be a good idea. ANSI does not actually make standards. It make metastandards about how to make standards (both style and process) and accredites US standard-making bodies tha

Re: Design question - Sharing of single object by multiple processes

2008-01-31 Thread Steve Holden
Mike D wrote: > Steve, > > You raise some very good (and obvious) issues I did'nt consider. I'll > look further into this sort of implementation as I'm quite interested. > > I suppose a compromise could be to load the objects from a pickle, that > may have issues in terms of updating the pickle

Re: How to identify which numbers in a list are within each others' range

2008-01-31 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > True... Any lighter-weight implementation of > sets out there? That is, one that would defer > use of resources until actually needed -- > somewhat akin to the distinction between > range and xrange, and so on. Don't even think of doing it that w

Re: object vs class oriented -- xotcl

2008-01-31 Thread neumann
On 29 Jan., 19:22, William Pursell <[EMAIL PROTECTED]> wrote: > I > believe "per object mixin" is the correct > term for such an animal. The first several google > hits on that phrase all reference xotcl, so I'm > not sure if that is an xotcl inspired vocabulary > that isn't really standard. wel

Re: wxEVT_SCROLL_ENDSCROLL

2008-01-31 Thread Astan Chee
try wx.EVT_SCROLL_ENDSCROLL ? Jack Holt wrote: > Hello, > > I got the following error: > > Traceback (most recent call last): > File "vplayer.py", line 15, in ? > File "config.pyo", line 3, in ? > File "wx\__init__.pyo", line 44, in ? > File "wx\_core.pyo", line 3592, in ? > AttributeErro

Re: Online Debugging

2008-01-31 Thread Gabriel Genellina
En Thu, 31 Jan 2008 03:15:05 -0200, Yansky <[EMAIL PROTECTED]> escribió: > I'm trying to debug a script on my server and it's taking forever > using print to find the error. I've tried to use the debugging > examples on this page http://webpython.codepoint.net/debugging but > they don't seem to

wxEVT_SCROLL_ENDSCROLL

2008-01-31 Thread Jack Holt
Hello, I got the following error: Traceback (most recent call last): File "vplayer.py", line 15, in ? File "config.pyo", line 3, in ? File "wx\__init__.pyo", line 44, in ? File "wx\_core.pyo", line 3592, in ? AttributeError: 'module' object has no attribute 'wxEVT_SCROLL_ENDSCROLL' I ne

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-01-31 Thread Neil Hodgson
Steve Holden wrote: > ... > Look guys, I thought we'd agreed that the PSU was no longer to be How did Steve manage to click send again after the para -- http://mail.python.org/mailman/listinfo/python-list

Re: python modules collection

2008-01-31 Thread [EMAIL PROTECTED]
On 31 jan, 02:57, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > 2008/1/30, J. Peng <[EMAIL PROTECTED]>: > > > Hello, > > > Is there a site for python,which collects most kinds of python modules? > > like CPAN for Perl. > > Sometime I want to use a module,like the time/date modules,don't know > >

Re: How to identify which numbers in a list are within each others' range

2008-01-31 Thread [EMAIL PROTECTED]
On Jan 31, 3:09 pm, Paul Rubin wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > mysets = [set(range(x[2],x[1])) for x in mylist] > > This is pretty horrible, each set can be arbitrarily large, > i.e. if x[2] and x[1] are 0 and 100, you get a set with > a m

Re: How to identify which numbers in a list are within each others' range

2008-01-31 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > mysets = [set(range(x[2],x[1])) for x in mylist] This is pretty horrible, each set can be arbitrarily large, i.e. if x[2] and x[1] are 0 and 100, you get a set with a million elements. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to identify which numbers in a list are within each others' range

2008-01-31 Thread [EMAIL PROTECTED]
On Jan 31, 2:48 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jan 31, 8:12 am, erikcw <[EMAIL PROTECTED]> wrote: > > One way would be to use sets and check for intersection: > > for idx, s in enumerate(mysets): > for next_idx, next_s in enumerate(mysets[idx+1:]): > if s.inter

Re: REALLY simple xml reader

2008-01-31 Thread Ivan Illarionov
> Also, for XML documents, they were probably thinking that the > documents will be machine-generated most of the time. As far as I can > tell, they were right in that. If anybody has to deal with human-generated XML/HTML in Python it may be better to use something like http://www.crummy.com/softw

Re: Dictionary Keys question

2008-01-31 Thread Dustan
On Jan 31, 7:35 am, Ben Finney <[EMAIL PROTECTED]> wrote: > Dustan <[EMAIL PROTECTED]> writes: > > On Jan 30, 7:02 pm, FireNWater <[EMAIL PROTECTED]> wrote: > > > Thank you for the explanation. . . I think I now have a (foggy) > > > understanding of hash tables. It seems to be a way to create order

Re: Python Standardization: Wikipedia entry

2008-01-31 Thread John Nagle
Colin J. Williams wrote: > John Nagle wrote: >> Paddy wrote: >>> I would value the opinion of fellow Pythoneers who have also >>> contributed to Wikipedia, on the issue of "Is Python Standardized". >>> Specifically in the context of this table: >>> >>> http://en.wikipedia.org/wiki/Comparison_of_

Re: REALLY simple xml reader

2008-01-31 Thread Ricardo Aráoz
Diez B. Roggisch wrote: > Ricardo Aráoz schrieb: >> Diez B. Roggisch wrote: >>> Ricardo Aráoz schrieb: Thanks Ivan, it seems a elegant API, and easy to use. I tried to play a little with it but unfortunately could not get it off the ground. I kept getting >>> root = et.fromstring

Re: helper function in a class' namespace

2008-01-31 Thread Arnaud Delobelle
On Jan 31, 8:05 pm, Stargaming <[EMAIL PROTECTED]> wrote: [...] > > class A(object): > >    def Helper(M) : > >      return 'H>'+M > >    def __init__(self,Msg) : > >      print Helper(Msg) > > > doesn't work since Python is looking for a global function Helper (why?) > > Because in the scope of th

Re: How to identify which numbers in a list are within each others' range

2008-01-31 Thread [EMAIL PROTECTED]
On Jan 31, 8:12 am, erikcw <[EMAIL PROTECTED]> wrote: > Hi, > > I have a list of numbers each with a +/- margin of error. I need to > identify which ones overlab each other. > > For example: > 55 +/- 3 > 20 +/- 2 > 17 +/- 4 > 60 +/- 3 > > #base, max, min > list = [ > (55, 58, 52), > (20, 22, 18),

Re: helper function in a class' namespace

2008-01-31 Thread Arnaud Delobelle
On Jan 31, 10:39 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Thu, 31 Jan 2008 20:05:44 +, Stargaming wrote: > > String concatenation is generally considered unpythonic, better use > > string interpolation:: > > >     'H> %s' % (M,) [...] > Also, the tuple above is tot

Re: helper function in a class' namespace

2008-01-31 Thread Steven D'Aprano
On Thu, 31 Jan 2008 20:05:44 +, Stargaming wrote: > String concatenation is generally considered unpythonic, better use > string interpolation:: > > 'H> %s' % (M,) String concatenation is significantly faster than string interpolation. >>> import timeit >>> timeit.Timer("'H> %s' % M", "

Re: Design question - Sharing of single object by multiple processes

2008-01-31 Thread Mike D
Steve, You raise some very good (and obvious) issues I did'nt consider. I'll look further into this sort of implementation as I'm quite interested. I suppose a compromise could be to load the objects from a pickle, that may have issues in terms of updating the pickle perhaps, though it would be m

Re: How to identify which numbers in a list are within each others' range

2008-01-31 Thread Arnaud Delobelle
On Jan 31, 4:12 pm, erikcw <[EMAIL PROTECTED]> wrote: > Hi, > > I have a list of numbers each with a +/- margin of error.  I need to > identify which ones overlab each other. > > For example: > 55 +/- 3 > 20 +/- 2 > 17 +/- 4 > 60 +/- 3 > > #base, max, min > list = [ > (55, 58, 52), > (20, 22, 18),

Re: Naive idiom questions

2008-01-31 Thread Paul Rubin
Terran Melconian <[EMAIL PROTECTED]> writes: > I want to be able to accumulate a string with +=, not by going > through an intermediate list and then doing ''.join(), because I > think the latter is ugly. There are also times when I'd like to use > the string as a modifiable buffer

Re: pyExcelerator - Can I read and modify an existing Excel-WorkBook?

2008-01-31 Thread John Machin
On Feb 1, 4:37 am, Stephen Brown <[EMAIL PROTECTED]> wrote: > Yes indeed, pyExcelerator does support reading data from excel > spreadsheets. I presume this is an orphaned and belated reply to the 3-message thread in July 2006 with the same subject. > An example of how to do this is included in th

Re: Naive idiom questions

2008-01-31 Thread Bjoern Schliessmann
Terran Melconian wrote: > * Why are there no real mutable strings available? > > I found MutableString in UserString, but further research > indicates that it is horribly inefficient and actually just > wraps immutable strings for the implementation. Did you measure such impact on you

Re: char string 2 hex string

2008-01-31 Thread Paul Rubin
Antonio Chay <[EMAIL PROTECTED]> writes: > "AAA" should be "414141" 'AAA'.encode('hex') -- http://mail.python.org/mailman/listinfo/python-list

char string 2 hex string

2008-01-31 Thread Antonio Chay
Hello! I need to transform a string from a file into a hexadecimal representation, for example: "AAA" should be "414141" With perl I do this with: unpack("H*","AAA") And with python I got this: "".join([str(hex(ord(x)))[2:] for x in "AAA"]) But seems a little "weird" for me. Is there anothe

Re: best(fastest) way to send and get lists from files

2008-01-31 Thread Steve Holden
Abrahams, Max wrote: > I've looked into pickle, dump, load, save, readlines(), etc. > > Which is the best method? Fastest? My lists tend to be around a thousand to a > million items. > > Binary and text files are both okay, text would be preferred in general > unless there's a significant speed

Re: Design question - Sharing of single object by multiple processes

2008-01-31 Thread Steve Holden
Mike D wrote: > Steve, > > Thanks for the response. My question really comes down to, as you > suggested, premature optimization. > > It is more for my own understanding than a current practical use. > > If an object is loaded into memory and other threads(or processes) can > recieve a pointer

Re: best(fastest) way to send and get lists from files

2008-01-31 Thread Yu-Xi Lim
Abrahams, Max wrote: > I've looked into pickle, dump, load, save, readlines(), etc. > > Which is the best method? Fastest? My lists tend to be around a thousand to a > million items. > > Binary and text files are both okay, text would be preferred in general > unless there's a significant speed

Re: Naive idiom questions

2008-01-31 Thread Grant Edwards
On 2008-01-31, Terran Melconian <[EMAIL PROTECTED]> wrote: > * Why are there no real mutable strings available? [...] > I want to be able to accumulate a string with +=, not by going > through an intermediate list and then doing ''.join(), So what's stopping you? >>> s = "one" >>> s +=

Naive idiom questions

2008-01-31 Thread Terran Melconian
* Why are there no real mutable strings available? I found MutableString in UserString, but further research indicates that it is horribly inefficient and actually just wraps immutable strings for the implementation. I want to be able to accumulate a string with +=, not by going

Re: sending a handmade SOAP request

2008-01-31 Thread Bernard
On 31 jan, 15:23, Van Gale <[EMAIL PROTECTED]> wrote: > Yes, it's quite easy to SOAP by hand. > > I use Oren Tirosh's ElementBuilder class (on top of lxml instead of > ElementTree) to build the SOAP request and the xpath capabilities in lxml > to pull out the data I need from the response. > > http

Re: sending a handmade SOAP request

2008-01-31 Thread Stefan Behnel
Hi, Bernard wrote: > Is there a way to POST a handmade SOAP request *without* using any > libraries like SOAPpy? This might help: http://effbot.org/zone/element-soap.htm I didn't try, but it should also work with lxml - which might make a couple of things a little easier, as it gives you XPath

Re: REALLY simple xml reader

2008-01-31 Thread Ben Finney
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Fri, 01 Feb 2008 00:40:01 +1100, Ben Finney wrote: > > > Quite apart from a human thinking it's pretty or not pretty, it's *not > > valid XML* if the XML declaration isn't immediately at the start of the > > document http://www.w3.org/TR/xml/#sec-p

Re: PIL linux err

2008-01-31 Thread Paul McNett
dzizes wrote: > I'm trying to run simple .py on linux, which is using PIL. Below error > message which I receive: > > IOError: decoder jpeg not available > > Do you know what might be the problem? No, but google seems to: http://effbot.org/zone/pil-decoder-jpeg-not-available.htm Paul --

Re: sending a handmade SOAP request

2008-01-31 Thread Van Gale
On Thu, 31 Jan 2008 11:03:26 -0800, Bernard wrote: > Hey y'all, > > Is there a way to POST a handmade SOAP request *without* using any > libraries like SOAPpy? Yes, it's quite easy to SOAP by hand. I use Oren Tirosh's ElementBuilder class (on top of lxml instead of ElementTree) to build the SO

Re: Dictionary Keys question

2008-01-31 Thread FireNWater
On Jan 31, 4:39 am, Dustan <[EMAIL PROTECTED]> wrote: > On Jan 30, 7:02 pm, FireNWater <[EMAIL PROTECTED]> wrote: > > > Thank you for the explanation. . . I think I now have a (foggy) > > understanding of hash tables. It seems to be a way to create order > > The 'order' that your speaking of is n

RE: Design question - Sharing of single object by multiple processes

2008-01-31 Thread Mike D
Steve, Thanks for the response. My question really comes down to, as you suggested, premature optimization. It is more for my own understanding than a current practical use. If an object is loaded into memory and other threads(or processes) can recieve a pointer to this location, would this not

Re: helper function in a class' namespace

2008-01-31 Thread Stargaming
On Thu, 31 Jan 2008 20:51:23 +0100, Helmut Jarausch wrote: > Hi, > > the following code works fine > > def Helper(M) : >return 'H>'+M String concatenation is generally considered unpythonic, better use string interpolation:: 'H> %s' % (M,) > class A(object): >def __init__(self,Ms

helper function in a class' namespace

2008-01-31 Thread Helmut Jarausch
Hi, the following code works fine def Helper(M) : return 'H>'+M class A(object): def __init__(self,Msg) : print Helper(Msg) B=A('ZZ') but the Helper function is in the module's namespace. I'd like to put it into class A's namespace. Note, the Helper function doesn't need access to

Re: Python for mobiles

2008-01-31 Thread Chris Mellon
On Jan 31, 2008 1:16 PM, Shawn Milochik <[EMAIL PROTECTED]> wrote: > > A better solution would surely be to get a Nokia S60 'phone, for which > there is a native Python implementation. > > regards > Steve > -- > Steve Holden+1 571 484 6266 +1 800 494 3119 > Holden Web LLC h

Re: PIL linux err

2008-01-31 Thread John Machin
On Feb 1, 5:41 am, dzizes <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to run simple .py on linux, which is using PIL. Below error > message which I receive: > > File "/usr/lib/python2.4/site-packages/PIL/Image.py", line 960, in > histogram > self.load() > File "/usr/lib/python2.4/site-p

best(fastest) way to send and get lists from files

2008-01-31 Thread Abrahams, Max
I've looked into pickle, dump, load, save, readlines(), etc. Which is the best method? Fastest? My lists tend to be around a thousand to a million items. Binary and text files are both okay, text would be preferred in general unless there's a significant speed boost from something binary. tha

Re: Python for mobiles

2008-01-31 Thread Shawn Milochik
A better solution would surely be to get a Nokia S60 'phone, for which there is a native Python implementation. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ Steve: Do you know if the Nokia E60i phone has this

pyExcelerator - Can I read and modify an existing Excel-WorkBook?

2008-01-31 Thread Stephen Brown
Yes indeed, pyExcelerator does support reading data from excel spreadsheets. An example of how to do this is included in the file xls2csv-gerry.py under the directory ... pyExcelerator/examples/tools Syntax is pretty straight forward. extract_all = parse_xls(filename, CP = None) where CP i

sending a handmade SOAP request

2008-01-31 Thread Bernard
Hey y'all, Is there a way to POST a handmade SOAP request *without* using any libraries like SOAPpy? I've been having some communication trouble with a server using the new wse3 (http://www.microsoft.com/Downloads/ details.aspx? familyid=018A09FD-3A74-43C5-8EC1-8D789091255D&displaylang=en). they

PIL linux err

2008-01-31 Thread dzizes
Hi, I'm trying to run simple .py on linux, which is using PIL. Below error message which I receive: File "/usr/lib/python2.4/site-packages/PIL/Image.py", line 960, in histogram self.load() File "/usr/lib/python2.4/site-packages/PIL/ImageFile.py", line 180, in load d = Image._getdecod

Re: Python for mobiles

2008-01-31 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hello, > > Is there any chance that i could compile python programs to java (.jar > [java bytecode]) so that i could run them with full support (no > interpreter) in a wireless device (talking about mobiles eg. nokia, > ericsson). > I am aware of jython, however i am not

Re: REALLY simple xml reader

2008-01-31 Thread Stefan Behnel
Stefan Behnel wrote: > Steven D'Aprano wrote: >> On Fri, 01 Feb 2008 00:40:01 +1100, Ben Finney wrote: >> >>> Quite apart from a human thinking it's pretty or not pretty, it's *not >>> valid XML* if the XML declaration isn't immediately at the start of the >>> document http://www.w3.org/TR/xml/#sec

Re: Fw: Undeliverable Message

2008-01-31 Thread Matthew_WARREN
> Heres the code > > def increment(digits,symbols): >         overflow=True >         digitpos=-1 >         while overflow and -digitpos<=len(digits): >                 digitsymbolindex=symbols.index(digits[digitpos]) >                 if digitsymbolindex==len(symbols)-1: >                    

Python for mobiles

2008-01-31 Thread [EMAIL PROTECTED]
Hello, Is there any chance that i could compile python programs to java (.jar [java bytecode]) so that i could run them with full support (no interpreter) in a wireless device (talking about mobiles eg. nokia, ericsson). I am aware of jython, however i am not elegible of finding a proper article c

Re: Removal of element from list while traversing causes the next element to be skipped

2008-01-31 Thread Matthew_WARREN
Hmm, how does this fare?? for i in range(len(a)): if a[i]==99: a=a[:i]+a[i+1:] I like following your guys code noodling. I can come up with something that does what it appears your doing, sometimes, but as to it's relevant merits I havent a clue :) matt.

Re: REALLY simple xml reader

2008-01-31 Thread Stefan Behnel
Hi, Steven D'Aprano wrote: > On Fri, 01 Feb 2008 00:40:01 +1100, Ben Finney wrote: > >> Quite apart from a human thinking it's pretty or not pretty, it's *not >> valid XML* if the XML declaration isn't immediately at the start of the >> document http://www.w3.org/TR/xml/#sec-prolog-dtd>. Many XML

very simple Genetic Algorithm completed

2008-01-31 Thread Matthew_WARREN
Hi, I got some help with this from here, and there's been a little bit of discussion around GA's recently, so thought I'd post up my likey slow and clunky version of a GA that in essence just 'evolves' a solution to 'make a sum that evaluates to n using */+-0123456789' it's a really simple GA tha

Re: REALLY simple xml reader

2008-01-31 Thread Diez B. Roggisch
Steven D'Aprano schrieb: > On Fri, 01 Feb 2008 00:40:01 +1100, Ben Finney wrote: > >> Quite apart from a human thinking it's pretty or not pretty, it's *not >> valid XML* if the XML declaration isn't immediately at the start of the >> document http://www.w3.org/TR/xml/#sec-prolog-dtd>. Many XML >>

Re: How to identify which numbers in a list are within each others' range

2008-01-31 Thread Paul Rubin
erikcw <[EMAIL PROTECTED]> writes: > What is the best way to in python to identify the list items that > overlap and the items that don't overlap with any other. This sounds like a homework problem, so the first thing I'll suggest is that you figure out exactly what it means for two of those inter

Re: Problems installing Python on server

2008-01-31 Thread Paul Boddie
On 28 Jan, 22:28, Yansky <[EMAIL PROTECTED]> wrote: > I asked my hosting company if they would upgrade Python on my server > to the latest version. They responded with: > > "Sorry no. We tend to stick with what comes packaged with the unix > distribution to ease maintenance issues. Which version a

DEADLINE Feb 4: OSCON 2008 Call for Proposals

2008-01-31 Thread Aahz
The O'Reilly Open Source Convention (OSCON) is accepting proposals for tutorials and presentations. The submission period ends Feb 4. OSCON 2008 will be in Portland, Oregon July 21-25. For more information and to submit a proposal, see http://conferences.oreilly.com/oscon/ -- Aahz ([EMAIL PROT

How to identify which numbers in a list are within each others' range

2008-01-31 Thread erikcw
Hi, I have a list of numbers each with a +/- margin of error. I need to identify which ones overlab each other. For example: 55 +/- 3 20 +/- 2 17 +/- 4 60 +/- 3 #base, max, min list = [ (55, 58, 52), (20, 22, 18), (17, 21, 13), (60, 63, 57), ] In this example the range of list[0] overlaps the

Re: Sine Wave Curve Fit Question

2008-01-31 Thread Paul Rubin
Helmut Jarausch <[EMAIL PROTECTED]> writes: > You're right: standard Python's math library missing the function arctan2. It's math.atan2 . -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >