Re: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-10 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Julio Biason wrote: > If I use a file() in a for, how to I explicitely close the file? > > > for line in file('contents'): >print line > > > Would this work like the new 'with' statement or it will only be closed > when the GC finds it? Only when the GC destroys it

Re: Bitwise expression

2007-01-10 Thread Hendrik van Rooyen
"Gigs_" <[EMAIL PROTECTED]> wrote: > Now is all clearer thanks to [EMAIL PROTECTED] and Hendrick van Rooyen Contrary to popular belief in the English speaking world - >>> "c" in "Hendrik" False >>> There is no "c" in "Hendrik" : - )- Hendrik -- http://mail.python.org/mailman/listinfo

Re: Colons, indentation and reformatting. (2)

2007-01-10 Thread Hendrik van Rooyen
"Jorgen Grahn" <[EMAIL PROTECTED]>wrote: > On 8 Jan 2007 23:57:29 -0800, Paddy <[EMAIL PROTECTED]> wrote: > > > > OK, whilst colons are not sufficient to re-format a completely > > mis-indented file. I'm thinking that they are sufficient for > > reformatting most pasted code blocks when refactor

Re: Why less emphasis on private data?

2007-01-10 Thread Hendrik van Rooyen
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > On Tue, 09 Jan 2007 10:27:56 +0200, Hendrik van Rooyen wrote: > > > "Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > > > > > >> On Mon, 08 Jan 2007 13:11:14 +0200, Hendrik van Rooyen wrote: > >> > >> > When you hear a programmer use the word "probabilit

Re: Parallel Python

2007-01-10 Thread parallelpython
> I always thought that if you use multiple processes (e.g. os.fork) then > Python can take advantage of multiple processors. I think the GIL locks > one processor only. The problem is that one interpreted can be run on > one processor only. Am I not right? Is your ppm module runs the same > interp

Re: Xah's Edu Corner: Introduction to 3D Graphics Programing

2007-01-10 Thread John Ersatznom
[EMAIL PROTECTED] wrote: > And the core folks around the project are either science educators or > Python folks - there is little C++ expertise currently involved with > the project. > > The project is looking for help. > > Anyone willing to jump in should perhaps reply here or at: [snip address]

Re: distutils and ctypes

2007-01-10 Thread [EMAIL PROTECTED]
Robert Kern wrote: > [EMAIL PROTECTED] wrote: > > > So finally, my question is, is there a way to get distutils to simply > > build a shared library on windows so that I can use ctypes with them??? > > Not out-of-box, no. The OOF2 project has added a bdist_shlib command which > should do most of w

Re: distutils and ctypes

2007-01-10 Thread [EMAIL PROTECTED]
Martin v. Löwis wrote: > Robert Kern schrieb: > > To which I say that doing the type-checking and error handling is much > > easier in > > Python than using the C API. Add to that the tediousness of the > > edit-compile-run > > cycle of C and the finickiness of refcounting. > > Sure: edit-compil

Question about compiling.

2007-01-10 Thread Steven W. Orr
I *just* read the tutorial so please be gentle. I created a file called fib.py which works very nicely thank you. When I run it it does what it's supposed to do but I do not get a resulting .pyc file. The tutorial says I shouldn't do anything special to create it. I have machines that have both

Establishing if an Object is Defined

2007-01-10 Thread bg_ie
Hi, The following code works - one = 1 if one == 1: ok = 1 print ok but this does not, without exception - one = 2 if one == 1: ok = 1 print ok How do I establish before printing ok if it actually exists so as to avoid this exception? Thanks for your help, Barry. -- http://mail.python.

Re: Establishing if an Object is Defined

2007-01-10 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > Hi, > > The following code works - > > one = 1 > if one == 1: > ok = 1 > print ok > > but this does not, without exception - > > one = 2 > if one == 1: > ok = 1 > print ok > > How do I establish before printing ok if it actually exists so as to > avoid this ex

Re: Question about compiling.

2007-01-10 Thread Gabriel Genellina
At Tuesday 9/1/2007 14:56, Steven W. Orr wrote: I *just* read the tutorial so please be gentle. I created a file called fib.py which works very nicely thank you. When I run it it does what it's supposed to do but I do not get a resulting .pyc file. The tutorial says I shouldn't do anything speci

Re: Why less emphasis on private data?

2007-01-10 Thread Gabriel Genellina
At Wednesday 10/1/2007 04:33, Hendrik van Rooyen wrote: Oh I am of the opposite conviction - Like the fellow of the Circuit Cellar I forget his name ( Steve Circia (?) ) who said: "My favourite Programming Language is Solder".. Almost right: Steve Ciarcia. -- Gabriel Genellina Softlab SRL

Re: Maths error

2007-01-10 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, Tim Peters <[EMAIL PROTECTED]> writes: |> |> Huh. I don't read it that way. If it said "numbers can be ..." I |> might, but reading that way seems to requires effort to overlook the |> "decimal" in "decimal numbers can be ...". I wouldn't expect YOU to read it

Re: Establishing if an Object is Defined

2007-01-10 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi, > > The following code works - > > one = 1 > if one == 1: > ok = 1 > print ok > > but this does not, without exception - > > one = 2 Are you competing for the Most Misleading Name Award(tm) ?-) > if one == 1: > ok = 1 > print ok > > How do I establish be

Re: pyExcelerator big integer values

2007-01-10 Thread Gacha
Thank you, the repr() function helped me a lot. v = unicode(values[(row_idx, col_idx)]) if v.endswith('e+12'): v = repr(values[(row_idx, col_idx)]) -- http://mail.python.org/mailman/listinfo/python-list

Re: maximum number of threads

2007-01-10 Thread Gabriel Genellina
At Wednesday 10/1/2007 04:38, Paul Sijben wrote: I have a server in Python 2.5 that generates a lot of threads. It is running on a linux server (Fedora Core 6). The server quickly runs out of threads. File "/usr/local/lib/python2.5/threading.py", line 434, in start _start_new_thread(self.

RE: dynamic library loading, missing symbols

2007-01-10 Thread Ames Andreas
Some random notes below ... > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > g] On Behalf Of [EMAIL PROTECTED] > Sent: Wednesday, January 10, 2007 1:26 AM > Subject: dynamic library loading, missing symbols > > The reason for the complication is that I don't h

convert binary data to int

2007-01-10 Thread rubbishemail
Hello, I need to convert a 3 byte binary string like "\x41\x00\x00" to 3 int values ( (65,0,0) in this case). The string might contain characters not escaped with a \x, like "A\x00\x00" Any ideas? Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: convert binary data to int

2007-01-10 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I need to convert a 3 byte binary string like > "\x41\x00\x00" to 3 int values ( (65,0,0) in this case). > The string might contain characters not escaped with a \x, like > "A\x00\x00" >>> [ord(c) for c in "A\x00\x41"] [65, 0, 65] For more complex conversions look into

Re: convert binary data to int

2007-01-10 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : > Hello, > > > I need to convert a 3 byte binary string like > "\x41\x00\x00" to 3 int values ( (65,0,0) in this case). > The string might contain characters not escaped with a \x, like > "A\x00\x00" > > > Any ideas? >>> s = "\x41\x00\x00" >>> [ ord(c) for c in s ]

Is there a way to protect a piece of critical code?

2007-01-10 Thread Hendrik van Rooyen
Hi, I would like to do the following as one atomic operation: 1) Append an item to a list 2) Set a Boolean indicator It would be almost like getting and holding the GIL, to prevent a thread swap out between the two operations. - sort of the inverted function than for which the GIL seems to be us

Re: convert binary data to int

2007-01-10 Thread Gabriel Genellina
At Wednesday 10/1/2007 07:17, [EMAIL PROTECTED] wrote: I need to convert a 3 byte binary string like "\x41\x00\x00" to 3 int values ( (65,0,0) in this case). The string might contain characters not escaped with a \x, like "A\x00\x00" py> [ord(x) for x in "\x41\x00\x00"] [65, 0, 0] py> [ord(x)

Re: convert binary data to int

2007-01-10 Thread rubbishemail
[ord(x) for ...] perfect, thank you Daniel -- http://mail.python.org/mailman/listinfo/python-list

add re module to a embeded device phyton interpreter

2007-01-10 Thread odlfox
I hav to add the re (regular expressions) functionality to an Embeded device that I'm using. I read the re.py file and it says I need several dependencies, one of them is the pcre module but I found no pcre.py or pcre.pyc file. Someone knows where to find something to solve my problem. Thanks

Re: Is there a way to protect a piece of critical code?

2007-01-10 Thread Diez B. Roggisch
Hendrik van Rooyen wrote: > Hi, > > I would like to do the following as one atomic operation: > > 1) Append an item to a list > 2) Set a Boolean indicator > > It would be almost like getting and holding the GIL, > to prevent a thread swap out between the two operations. > - sort of the inverted

Re: Is there a way to protect a piece of critical code?

2007-01-10 Thread Gabriel Genellina
At Wednesday 10/1/2007 07:14, Hendrik van Rooyen wrote: I would like to do the following as one atomic operation: 1) Append an item to a list 2) Set a Boolean indicator Wouldn't a thread.Lock object serve your purposes? -- Gabriel Genellina Softlab SRL

Re: maximum number of threads

2007-01-10 Thread Felipe Almeida Lessa
On 1/10/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Wednesday 10/1/2007 04:38, Paul Sijben wrote: > >Does anyone know what it going on here and how I can ensure that I have > >all the threads I need? > > Simply you can't, as you can't have 1 open files at once. > Computer resources ar

Re: maximum number of threads

2007-01-10 Thread Paul Sijben
Gabriel Genellina wrote: > > Simply you can't, as you can't have 1 open files at once. Computer > resources are not infinite. sure but *how* fast they run out is the issue here > Do you really need so many threads? I might be able to do with a few less but I still need many. I have done a

Re: maximum number of threads

2007-01-10 Thread Paul Sijben
Felipe Almeida Lessa wrote: > Maybe Stackless could help the OP? > http://www.stackless.com/ > thanks I will look into it! -- http://mail.python.org/mailman/listinfo/python-list

Re: convert binary data to int

2007-01-10 Thread Paul Sijben
in some cases struct.unpack would also help [EMAIL PROTECTED] wrote: > Hello, > > > I need to convert a 3 byte binary string like > "\x41\x00\x00" to 3 int values ( (65,0,0) in this case). > The string might contain characters not escaped with a \x, like > "A\x00\x00" > > > Any ideas? > > >

Re: pyExcelerator big integer values

2007-01-10 Thread John Machin
Gacha wrote: > Thank you, the repr() function helped me a lot. > > v = unicode(values[(row_idx, col_idx)]) > if v.endswith('e+12'): > v = repr(values[(row_idx, col_idx)]) That endswith() looks rather suspicious ... what if it's +11 or +13, and shouldn't it have a zero in it, like "+012" ?? H

Re: add re module to a embeded device phyton interpreter

2007-01-10 Thread robert
odlfox wrote: >I hav to add the re (regular expressions) functionality to an > Embeded device that I'm using. I read the re.py file and it says I > need several dependencies, one of them is the pcre module but I found > no pcre.py or pcre.pyc file. Someone knows where to find something to > s

Re: Is there a way to protect a piece of critical code?

2007-01-10 Thread robert
Hendrik van Rooyen wrote: > Hi, > > I would like to do the following as one atomic operation: > > 1) Append an item to a list > 2) Set a Boolean indicator I doubt you have to worry at all about this in such simple single-single queue - if there is not a much more complex condition upon the ins

Re: Is there a way to protect a piece of critical code?

2007-01-10 Thread Paul Rubin
"Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: > I would like to do the following as one atomic operation: > > 1) Append an item to a list > 2) Set a Boolean indicator You could do it with locks as others have suggested, but maybe you really want the Queue module. -- http://mail.python.org/mai

Re: maximum number of threads

2007-01-10 Thread Laurent Pointal
Paul Sijben a écrit : > Gabriel Genellina wrote: >> Simply you can't, as you can't have 1 open files at once. Computer >> resources are not infinite. > > sure but *how* fast they run out is the issue here > >> Do you really need so many threads? > > I might be able to do with a few less but

Re: maximum number of threads

2007-01-10 Thread Felipe Almeida Lessa
On 1/10/07, Laurent Pointal <[EMAIL PROTECTED]> wrote: This is a system configurable limit (up to a maximum). See ulimit man pages. test ulimit -a to see what are the current limits, and try with ulimit -u 2000 to modify the maximum number of user process (AFAIK each thread

Re: maximum number of threads

2007-01-10 Thread Jean-Paul Calderone
On Wed, 10 Jan 2007 12:11:59 -0200, Felipe Almeida Lessa <[EMAIL PROTECTED]> wrote: >On 1/10/07, Laurent Pointal <[EMAIL PROTECTED]> wrote: >>This is a system configurable limit (up to a maximum). >> >>See ulimit man pages. >> >>test >> >> ulimit -a >> >>to see what are the current limits,

An iterator with look-ahead

2007-01-10 Thread Neil Cerutti
For use in a hand-coded parser I wrote the following simple iterator with look-ahead. I haven't thought too deeply about what peek ought to return when the iterator is exhausted. Suggestions are respectfully requested. As it is, you can't be sure what a peek() => None signifies until the next itera

Re: Internet Survey

2007-01-10 Thread jmfbahciv
In article <[EMAIL PROTECTED]>, "Elan Magavi" <[EMAIL PROTECTED]> wrote: > ><[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >> Hello all, >> >> I represent Octabox, an Internet Start-up developing a wide-scale >> platform for Internet services. We are very interested to know your

Re: maximum number of threads

2007-01-10 Thread hg
Jean-Paul Calderone wrote: > On Wed, 10 Jan 2007 12:11:59 -0200, Felipe Almeida Lessa > <[EMAIL PROTECTED]> wrote: >>On 1/10/07, Laurent Pointal <[EMAIL PROTECTED]> wrote: >>>This is a system configurable limit (up to a maximum). >>> >>>See ulimit man pages. >>> >>>test >>> >>> ulimit -a >

Re: Internet Survey

2007-01-10 Thread jmfbahciv
In article <[EMAIL PROTECTED]>, zoara <[EMAIL PROTECTED]> wrote: >On 9 Jan 2007 06:58:15 -0800, [EMAIL PROTECTED] wrote: > >> Hello all, >> >> I represent Octabox, an Internet Start-up developing a wide-scale >> platform for Internet services. We are very interested to know your >> thoughts on

Re: dynamic library loading, missing symbols

2007-01-10 Thread [EMAIL PROTECTED]
> Did you verify, using nm -D, that the symbol is indeed present in > the shared object, not just in the source code? Yes, the symbol is found in the shared object when using nm. > What flags are given to that dlopen call? dlopen(lib, RTLD_NOW | RTLD_GLOBAL); > No. The dynamic linker doesn't s

Re: maximum number of threads

2007-01-10 Thread Paul Sijben
All thanks for all the input! This was very informative. Looks like I indeed need stackless as my code benefits from being concurrently designed. Paul Jean-Paul Calderone wrote: > On Wed, 10 Jan 2007 12:11:59 -0200, Felipe Almeida Lessa > <[EMAIL PROTECTED]> wrote: >> On 1/10/07, Laurent Pointal

Re: An iterator with look-ahead

2007-01-10 Thread Fredrik Lundh
Neil Cerutti wrote: > For use in a hand-coded parser I wrote the following simple > iterator with look-ahead. I haven't thought too deeply about what > peek ought to return when the iterator is exhausted. Suggestions > are respectfully requested. As it is, you can't be sure what a > peek() => None

Working with named groups in re module

2007-01-10 Thread Neil Cerutti
A found some clues on lexing using the re module in Python in an article by Martin L÷wis. http://www.python.org/community/sigs/retired/parser-sig/towards-standard/ He writes: [...] A scanner based on regular expressions is usually implemented as an alternative of all token definitions. For

Need startup suggestions for writing a MSA viewer GUI in python

2007-01-10 Thread Joel Hedlund
Hi! I've been thinking about writing a good multiple sequence alignment (MSA) viewer in python. Sort of like ClustalX, only with better zoom and pan tools. I've been using python in my work for a couple of years, but this is my first shot at making a GUI so I'd very much appreciate some ideas

Re: Need startup suggestions for writing a MSA viewer GUI in python

2007-01-10 Thread Chris Mellon
On 1/10/07, Joel Hedlund <[EMAIL PROTECTED]> wrote: > Hi! > > I've been thinking about writing a good multiple sequence alignment > (MSA) viewer in python. Sort of like ClustalX, only with better zoom and > pan tools. I've been using python in my work for a couple of years, but > this is my first s

Re: An iterator with look-ahead

2007-01-10 Thread Neil Cerutti
On 2007-01-10, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > if you're doing simple parsing on an iterable, it's easier and > more efficient to pass around the current token and the > iterator's next method: > > http://online.effbot.org/2005_11_01_archive.htm#simple-parser-1 Thank you. Much better.

Re: Working with named groups in re module

2007-01-10 Thread Fredrik Lundh
Neil Cerutti wrote: > A found some clues on lexing using the re module in Python in an > article by Martin L÷wis. > Here, each alternative in the regular expression defines a > named group. Scanning proceeds in the following steps: > > 1. Given the complete input, match the regular expre

Re: Internet Survey

2007-01-10 Thread martin griffith
On Tue, 9 Jan 2007 20:16:01 +, in comp.arch.embedded Pete Fenelon <[EMAIL PROTECTED]> wrote: >In comp.arch.embedded [EMAIL PROTECTED] wrote: >> Hello all, >> >> I represent Octabox, an Internet Start-up developing a wide-scale > >Hello. F*ck off, spammer. > > >pete a bit more subtle http://ww

Using Excel With Python

2007-01-10 Thread liam_jones
I'm very new to Python, well IronPython to precise, and have been having problems when using Excel. The problem I'm having is the closing of my Excel object. I'm able to successfully quit the Excel Application that I create, but when I open a Workbook in the Application I can't successfully Quit E

Using Excel With Python

2007-01-10 Thread liam_jones
I'm very new to Python, well IronPython to precise, and have been having problems when using Excel. The problem I'm having is the closing of my Excel object. I'm able to successfully quit the Excel Application that I create, but when I open a Workbook in the Application I can't successfully Quit E

Using Excel With Python

2007-01-10 Thread liam_jones
I'm very new to Python, well IronPython to precise, and have been having problems when using Excel. The problem I'm having is the closing of my Excel object. I'm able to successfully quit the Excel Application that I create, but when I open a Workbook in the Application I can't successfully Quit E

Building Python 2.5.0 on AIX 5.3 - Undefined symbol: .__floor

2007-01-10 Thread Justin Johnson
Hello, I'm trying to build Python 2.5.0 on AIX 5.3 using IBM's compiler (VisualAge C++ Professional / C for AIX Compiler, Version 6). I run configure and make, but makes fails with undefined symbols. See the output from configure and make below. svnadm /svn/build/python-2.5.0>env CC=cc CXX=xlC

Re: Internet Survey

2007-01-10 Thread Lefty Bigfoot
On Wed, 10 Jan 2007 08:28:33 -0600, [EMAIL PROTECTED] wrote (in article <[EMAIL PROTECTED]>): > In article <[EMAIL PROTECTED]>, >"Elan Magavi" <[EMAIL PROTECTED]> wrote: >> Is that like.. OctaPussy? > > I didn't read their stuff. Are they really trying to put a > round peg in a square hole?

Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-10 Thread Martin Miller
Carl Banks wrote: > Martin Miller wrote: > > Carl Banks wrote: > > > > > Martin Miller wrote: > > > > ### non-redundant example ### > > > > import sys > > > > > > > > class Pin: > > > > def __init__(self, name, namespace=None): > > > > self.name = name > > > > if namespace == No

Re: Need startup suggestions for writing a MSA viewer GUI in python

2007-01-10 Thread hg
Joel Hedlund wrote: > Hi! > > I've been thinking about writing a good multiple sequence alignment > (MSA) viewer in python. Sort of like ClustalX, only with better zoom and > pan tools. I've been using python in my work for a couple of years, but > this is my first shot at making a GUI so I'd ver

Re: Yield

2007-01-10 Thread Mikael Olofsson
Mathias Panzenboeck wrote: > def primes(): > yield 1 > yield 2 > [snip rest of code] > Hmm... 1 is not a prime. See for instance http://en.wikipedia.org/wiki/Prime_number The definition given there is "In mathematics , a *prime number* (or a *prime*) is a natural number

Re: Yield

2007-01-10 Thread Mikael Olofsson
I wrote: > The definition given there is "In mathematics , a > *prime number* (or a *prime*) is a natural number > that has exactly two (distinct) natural number > divisors ." The important part of the statement is > "exactly two...divisors", which rules out the number 1. Or should I say: T

call graph using python and cscope

2007-01-10 Thread Roland Puntaier
""" Sometimes it is nice to have the data used by cscope accessible in a programatic way. The following python script extract the "functions called" information from cscope (function: callGraph) and produced an html file from them. from csCallGraph import * acg=callGraph(entryFun,workingDir

SubProcess _make_inheritable

2007-01-10 Thread Roland Puntaier
SubProcess.py needs to be patched - at least in 2.4 - to work from windows GUIs: def _make_inheritable(self, handle): """Return a duplicate of handle, which is inheritable""" if handle==None: handle=-1 return DuplicateHandle(GetCurrentProcess(), handle

Re: Execute binary code

2007-01-10 Thread sturlamolden
Chris Mellon wrote: > This works fine if the binary data is "pure" asm, but the impresssion > the OP gave is that it's a compiled binary, which you can't just "jump > into" this way. You may have to offset the function pointer so the entry point becomes correct. -- http://mail.python.org/mailm

Re: maximum number of threads

2007-01-10 Thread Jeremy Sanders
Jean-Paul Calderone wrote: > Indeed you are correct. The actual limit you are hitting is the size > of your address space. Each thread is allocated 8MB of stack. 382 > threads consumes about 3GB of address space. Even though most of this > memory isn't actually allocated, the address space is

Re: Working with named groups in re module

2007-01-10 Thread Neil Cerutti
On 2007-01-10, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> A found some clues on lexing using the re module in Python in >> an article by Martin L÷wis. > >> Here, each alternative in the regular expression defines a >> named group. Scanning proceeds in the following steps:

Re: Need startup suggestions for writing a MSA viewer GUI in python

2007-01-10 Thread Neil Cerutti
On 2007-01-10, hg <[EMAIL PROTECTED]> wrote: > Joel Hedlund wrote: >> Thanks for taking the time! >> /Joel Hedlund > > I do not know if PyGtk and PyQT have demos, but wxPython does > and includes PyPlot: an easy way to look at the basic features. PyQT does come with an impressive plethora of demos

Regex Question

2007-01-10 Thread Bill Mill
Hello all, I've got a test script: start python code = tests2 = ["item1: alpha; item2: beta. item3 - gamma--", "item1: alpha; item3 - gamma--"] def test_re(regex): r = re.compile(regex, re.MULTILINE) for test in tests2: res = r.search(test) if res: p

Re: Internet Survey

2007-01-10 Thread jmfbahciv
In article <[EMAIL PROTECTED]>, Lefty Bigfoot <[EMAIL PROTECTED]> wrote: >On Wed, 10 Jan 2007 08:28:33 -0600, [EMAIL PROTECTED] wrote >(in article <[EMAIL PROTECTED]>): > >> In article <[EMAIL PROTECTED]>, >>"Elan Magavi" <[EMAIL PROTECTED]> wrote: >>> Is that like.. OctaPussy? >> >> I didn

Re: Execute binary code

2007-01-10 Thread Chris Mellon
On 10 Jan 2007 08:12:41 -0800, sturlamolden <[EMAIL PROTECTED]> wrote: > > Chris Mellon wrote: > > > This works fine if the binary data is "pure" asm, but the impresssion > > the OP gave is that it's a compiled binary, which you can't just "jump > > into" this way. > > You may have to offset the fu

Re: An iterator with look-ahead

2007-01-10 Thread George Sakkis
Neil Cerutti wrote: > For use in a hand-coded parser I wrote the following simple > iterator with look-ahead. I haven't thought too deeply about what > peek ought to return when the iterator is exhausted. Suggestions > are respectfully requested. As it is, you can't be sure what a > peek() => None

Re: An iterator with look-ahead

2007-01-10 Thread Steven Bethard
Neil Cerutti wrote: > For use in a hand-coded parser I wrote the following simple > iterator with look-ahead. There's a recipe for this: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/304373 Note that the recipe efficiently supports an arbitrary look-ahead, not just a single item.

Re: Parallel Python

2007-01-10 Thread sturlamolden
robert wrote: > Thats true. IPC through sockets or (somewhat faster) shared memory - cPickle > at least - is usually the maximum of such approaches. > See > http://groups.google.de/group/comp.lang.python/browse_frm/thread/f822ec289f30b26a > > For tasks really requiring threading one can consid

Re: Parallel Python

2007-01-10 Thread sturlamolden
[EMAIL PROTECTED] wrote: >That's right. ppsmp starts multiple interpreters in separate > processes and organize communication between them through IPC. Thus you are basically reinventing MPI. http://mpi4py.scipy.org/ http://en.wikipedia.org/wiki/Message_Passing_Interface -- http://mail.p

Universal Feed Parser - How do I keep attributes?

2007-01-10 Thread [EMAIL PROTECTED]
I'm trying to use FeedParser to parse out Yahoo's Weather Data. I need to capture some attribute values, but it looks like FeedParser strips them out. Is there any way to keep them? XML Snippet: ... ... When I try to get the value, it's empty: >>> d = feedparser.parse('http://weather.yahooapis.

Re: Parallel Python

2007-01-10 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "sturlamolden" <[EMAIL PROTECTED]> writes: |> |> MPI is becoming the de facto standard for high-performance parallel |> computing, both on shared memory systems (SMPs) and clusters. It has been for some time, and is still gaining ground. |> Spawning |> threads or

Re: Question about compiling.

2007-01-10 Thread Bjoern Schliessmann
Steven W. Orr wrote: > I *just* read the tutorial so please be gentle. I created a file > called fib.py which works very nicely thank you. When I run it it > does what it's supposed to do but I do not get a resulting .pyc > file. .pyc files are created only if you import a .py file. Regards,

Re: An iterator with look-ahead

2007-01-10 Thread Neil Cerutti
On 2007-01-10, Steven Bethard <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> For use in a hand-coded parser I wrote the following simple >> iterator with look-ahead. > > There's a recipe for this: > >http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/304373 > > Note that the recipe ef

Re: Parallel Python

2007-01-10 Thread sturlamolden
Nick Maclaren wrote: > as the ones that you have to play for threaded programs. Yes, I know > that it is a bit Irish for the best way to use a shared memory system > to be to not share memory, but that's how it is. Thank you for clearing that up. In any case, this means that Python can happily

Re: Building Python 2.5.0 on AIX 5.3 - Undefined symbol: .__floor

2007-01-10 Thread Justin Johnson
It looks like I just need to upgrade my compiler version. See http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?message=13876484&cat=72&thread=124105&treeDisplayType=threadmode1&forum=905#13876484 for more information. Justin Johnson wrote: > Hello, > > I'm trying to build Python 2.5.0 o

Re: Announcement -- ZestyParser

2007-01-10 Thread Terry Reedy
"Adam Atlas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | This has been on Cheese Shop for a few weeks now, being updated now and | then, but I never really announced it. I just now put up a real web | page for it, so I thought I'd take the opportunity to mention it here. | | Zes

Seattle Python Interest Group Thursday at 7:00 PM

2007-01-10 Thread James Thiele
7pm at the bar below Third Place books in Ravenna: http://www.seapig.org/ThirdPlaceMeetingLocation -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel Python

2007-01-10 Thread Paul Rubin
[EMAIL PROTECTED] (Nick Maclaren) writes: > Yes, I know that it is a bit Irish for the best way to use a shared > memory system to be to not share memory, but that's how it is. But I thought serious MPI implementations use shared memory if they can. That's the beauty of it, you can run your appli

Re: Is there a way to protect a piece of critical code?

2007-01-10 Thread Steve Holden
Hendrik van Rooyen wrote: > Hi, > > I would like to do the following as one atomic operation: > > 1) Append an item to a list > 2) Set a Boolean indicator > > It would be almost like getting and holding the GIL, > to prevent a thread swap out between the two operations. > - sort of the inverted

Re: Parallel Python

2007-01-10 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "sturlamolden" <[EMAIL PROTECTED]> writes: |> |> In any case, this means that Python can happily keep its GIL, as the |> CPU bound 'HPC' tasks for which the GIL does matter should be done |> using multiple processes (not threads) anyway. That leaves threads as a |>

Re: Parallel Python

2007-01-10 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, Paul Rubin writes: |> |> > Yes, I know that it is a bit Irish for the best way to use a shared |> > memory system to be to not share memory, but that's how it is. |> |> But I thought serious MPI implementations use shared memory if they |

Re: Parallel Python

2007-01-10 Thread Sergei Organov
[EMAIL PROTECTED] (Nick Maclaren) writes: > In article <[EMAIL PROTECTED]>, > "sturlamolden" <[EMAIL PROTECTED]> writes: [...] > |> I wonder if too much emphasis is put on thread programming these days. > |> Threads may be nice for programming web servers and the like, but not > |> for numerical co

Re: An iterator with look-ahead

2007-01-10 Thread Paddy
Neil Cerutti wrote: > On 2007-01-10, Steven Bethard <[EMAIL PROTECTED]> wrote: > > Neil Cerutti wrote: > >> For use in a hand-coded parser I wrote the following simple > >> iterator with look-ahead. > > > > There's a recipe for this: > > > >http://aspn.activestate.com/ASPN/Cookbook/Python/Rec

Re: Parallel Python

2007-01-10 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, Sergei Organov <[EMAIL PROTECTED]> writes: |> |> Do you mean that POSIX threads are inherently designed and implemented |> to stay idle most of the time?! If so, I'm afraid those guys that |> designed POSIX threads won't agree with you. In particular, as far as I |

Re: Newbie - converting csv files to arrays in NumPy - Matlab vs. Numpy comparison

2007-01-10 Thread oyekomova
Thanks for your help. I compared the following code in NumPy with the csvread in Matlab for a very large csv file. Matlab read the file in 577 seconds. On the other hand, this code below kept running for over 2 hours. Can this program be made more efficient? FYI - The csv file was a simple 6 column

Re: dynamic library loading, missing symbols

2007-01-10 Thread [EMAIL PROTECTED]
So, I did some searching and using python -v to run my code, I was able to see that my module was loaded by the python interpreter using dlopen("lib", 2). 2 is the RTLD_NOW flag, meaning that RTLD_LOCAL is assumed by the system. I suppose this means that any subsequent libraries dlopened will not

Re: Announcement -- ZestyParser

2007-01-10 Thread Istvan Albert
Terry Reedy wrote: > I would like to look at the examples online (along with the doc file) > before downloading this and setuptools and installing, so I can see what > it actually looks like in use. Yes, I second that. I poked around for a little while but could not find a single example. Then

Re: Read CSV file into an array

2007-01-10 Thread Tobiah
oyekomova wrote: > I would like to know how to read a CSV file with a header ( n columns > of float data) into an array without the header row. > import csv l = [] for line in csv.reader(open("my.csv").readlines()[1:]): l.append(line) Which really gets you a list of lists. -- Posted v

Re: Newbie - converting csv files to arrays in NumPy - Matlab vs. Numpy comparison

2007-01-10 Thread sturlamolden
oyekomova wrote: > Thanks for your help. I compared the following code in NumPy with the > csvread in Matlab for a very large csv file. Matlab read the file in > 577 seconds. On the other hand, this code below kept running for over 2 > hours. Can this program be made more efficient? FYI - The csv

Re: Question about compiling.

2007-01-10 Thread Rob Wolfe
Gabriel Genellina <[EMAIL PROTECTED]> writes: > At Tuesday 9/1/2007 14:56, Steven W. Orr wrote: > >>I *just* read the tutorial so please be gentle. I created a file called >>fib.py which works very nicely thank you. When I run it it does what it's >>supposed to do but I do not get a resulting .pyc

Re: Parallel Python

2007-01-10 Thread Carl J. Van Arsdall
Just as something to note, but many HPC applications will use a combination of both MPI and threading (OpenMP usually, as for the underlying thread implementation i don't have much to say). Its interesting to see on this message board this huge "anti-threading" mindset, but the HPC community s

Re: Parallel Python

2007-01-10 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> writes: |> |> Just as something to note, but many HPC applications will use a |> combination of both MPI and threading (OpenMP usually, as for the |> underlying thread implementation i don't have much to say). Its |> in

Re: Question about compiling.

2007-01-10 Thread tac-tics
> That's not the whole truth. :) The whole truth is that from a developer's POV, .pyc files are unimportant. -- http://mail.python.org/mailman/listinfo/python-list

Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-10 Thread Carl Banks
Martin Miller wrote: > Carl Banks wrote: > > Because the usage deceptively suggests that it defines a name in the > > local namespace. Failing may be too strong a word, but I've come to > > expect a consistent behavior w.r.t. namespaces, which this violates, so > > I think it qualifies as a failu

Re: Internet Survey

2007-01-10 Thread krw
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > In article <[EMAIL PROTECTED]>, >Lefty Bigfoot <[EMAIL PROTECTED]> wrote: > >On Wed, 10 Jan 2007 08:28:33 -0600, [EMAIL PROTECTED] wrote > >(in article <[EMAIL PROTECTED]>): > > > >> In article <[EMAIL PROTECTED]>, > >>"Elan Magav

Re: Python - C# interoperability

2007-01-10 Thread mc
Thanks to all who responded. It appears that there may be a solution as follows: use jythonc to turn Python program into Java bytecode use Microsoft's jbimp to turn Java bytecode into .NET DLL It sounds roundabout, but I am investigating. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >