Re: Urgent Openings with the World's Leading Software Company !!!

2007-01-10 Thread Terry Reedy
(cc'ed) "Software Hiring" <[EMAIL PROTECTED]> wrote Hi Vamsi. Recruiting for Microsoft gives you no extra right to spam comp.lang.python with off-topic messages. There are thousands of other software groups that might like to do the same but with a couple of exceptions a year, they all desi

Print message with Colors

2007-01-10 Thread prk
Hi Folks, Is there any procesure for print messages with colors. Ex: print "Welcome" Comment: Here i want to see the welcome message in Red Color. Regards, Ram -- http://mail.python.org/mailman/listinfo/python-list

Re: how to clean sys.path

2007-01-10 Thread Tim Roberts
"siggi" <[EMAIL PROTECTED]> wrote: > >when I do >>>sys.path in IDLE (winXP), i get a horrendously long list of >paths, paths I may have used during a lot of trials and errors. How can I >clean up sys.path? I mean, trim it of unnecessary paths? What do mean by "used during a lot of trials and err

Re: Joining threads but allowing signals to main thread?

2007-01-10 Thread Gabriel Genellina
At Thursday 11/1/2007 03:43, Lloyd Zusman wrote: while threading.activeCount() > 1: time.sleep(0.001) sys.exit(0) Is there any way to allow my program to respond to signals without having to busy-wait in the main thread? Don't worry too much, this is *not* a busy wait, because you

Urgent Openings with the World's Leading Software Company !!!

2007-01-10 Thread Software Hiring
Hi Friends, Hope you're doing great. We are looking for Software Professionals with about 7 years of experience and willing to work for the World's Biggest Software Company - Microsoft. We have a variety of jobs across different verticals at Microsoft India Development Center (MSIDC) based at HIT

Joining threads but allowing signals to main thread?

2007-01-10 Thread Lloyd Zusman
I have a python-2.5 program running under linux in which I spawn a number of threads. The main thread does nothing while these subsidiary threads are running, and after they all complete, the main thread will then exit. I know that I can manage this through the use of Thread.join(), but when I do

Re: Python 2.5 install on Gentoo Linux: failed dmb and _tkinter

2007-01-10 Thread Martin v. Löwis
Sorin Schwimmer schrieb: > *** WARNING: renaming "_tkinter" since importing it > failed: libtk8.4.so: cannot open shared object file: > No such file or directory > running build_scripts > > I have libtk: > > # ls -l /usr/local/lib/libtk8.4.so > -r-xr-xr-x 1 root root 906285 Jan 10 16:08 > /usr/lo

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

2007-01-10 Thread Paul Rubin
Paul Rubin writes: > def get_from_queue(queue): >try: > return queue.get(block=False) >except Queue.Empty: > return QUEUE_IS_EMPTY Alternatively: def get_from_queue(queue): try: return (queue.get(block=Fals

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

2007-01-10 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> wrote: > 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 thre

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

2007-01-10 Thread Paul Rubin
"Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: > am aware of Queue module - the same app uses it for something else. > I dont like too many try -- excepts in the code - I find they confuse > me when I try to read it later - and in this case I cannot block on waiting > for > the queue to fill. D

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

2007-01-10 Thread Hendrik van Rooyen
"Paul Rubin" wrote: > "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

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

2007-01-10 Thread Hendrik van Rooyen
"robert" <[EMAIL PROTECTED]> wrote: > 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 the

Re: IDLE Python and Environment Variables

2007-01-10 Thread Gabriel Genellina
At Wednesday 10/1/2007 23:24, Tristan wrote: 1) For almost everyone, I execute a corresponding ".bat file" into which I define and/or include values for some "temporal" environment variables that let me find all the objects that the selected application uses. Sometimes I include in the .ba

The Python Papers: Submit your Quotes

2007-01-10 Thread [EMAIL PROTECTED]
Volume Two of The Python Papers is on its way, and it would be great to get some more words from the community in there. Submit your own quotes to [EMAIL PROTECTED] to get a brief comment included in our next publication. Please include any attribution information you wish... Let's get the ball ro

Re: globals accros modules

2007-01-10 Thread Gabriel Genellina
At Thursday 11/1/2007 01:11, alf wrote: How can I have global globals without cyclical import? You can't. Globals are module globals. You need to qualify *which* module `a` belongs to. amodule.py: def f(): global a print a main.py: import

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

2007-01-10 Thread Michele Simionato
Martin v. Löwis wrote: > If you want to, you can combine this with the factory/singleton > patterns, to transparently create the objects on first access: > > class Registry: > def __getitem__(self, name): > # only invoked when attribute is not set > r = pin(name) > setattr(self, name,

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

2007-01-10 Thread Gabriel Genellina
At Wednesday 10/1/2007 16:48, 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 e

Re: Universal Feed Parser - How do I keep attributes?

2007-01-10 Thread Gabriel Genellina
At Wednesday 10/1/2007 14:38, [EMAIL PROTECTED] wrote: >>> d = feedparser.parse('http://weather.yahooapis.com/forecastrss?p=94089') >>> d.feed.yweather_location u'' You have to feed it the *contents* of the page, not its URL. -- Gabriel Genellina Softlab SRL

Re: SubProcess _make_inheritable

2007-01-10 Thread Gabriel Genellina
At Wednesday 10/1/2007 13:10, Roland Puntaier wrote: 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

globals accros modules

2007-01-10 Thread alf
Hi, executing main.py reulsts in following: [EMAIL PROTECTED] andy]$ python main.py Traceback (most recent call last): File "main.py", line 4, in ? amodule.f() File "/raid/home/andy/amodule.py", line 3, in f print a NameError: global name 'a' is not defined How can I have global

Re: Maths error

2007-01-10 Thread Tim Peters
[Tim Peters] ... >> 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 ...". [Nick Maclaren] > I wouldn't expect YOU to read it that way, Of course I meant "putting my

Re: Evolving doctests for changing output format

2007-01-10 Thread Raymond Hettinger
[EMAIL PROTECTED] > What I'd like is if I could get doctest to take my tests, and > substitute the obtained output for the provided output. There's currently no support for auto-updating doctests. I think it would make for a good feature request. In the meantime, it may not be difficult to roll

Re: Read from database, write to another database, simultaneously

2007-01-10 Thread johnf
Bjoern Schliessmann wrote: > Sean Davis wrote: > >> The author of one of the python database clients mentioned that >> using one thread to retrieve the data from the oracle database and >> another to insert the data into postgresql with something like a >> pipe between the two threads might make

Re: what is the idiom for copy lots of params into self?

2007-01-10 Thread [EMAIL PROTECTED]
def __init__(self, **kw): self.argdict = kw Emin wrote: > Dear Experts, > > When writing large classes, I sometimes find myself needing to copy a > lot of parameters from the argument of __init__ into self. Instead of > having twenty lines that all basically say something like self.x = x, I >

IDLE Python and Environment Variables

2007-01-10 Thread Tristan
Hello community: I post this because I could not find satisfactory answers in the posts generated by this nice group. I work on winXP. I have many little python applications in different folders, each application can share or not other objects located in the same or other folders. The way I work t

IDLE Python and Environment Variables

2007-01-10 Thread Tristan
Hello community: I post this because I could not find satisfactory answers in the posts generated by this nice group. I work on winXP. I have many little python applications in different folders, each application can share or not other objects located in the same or other folders. The way I work t

Re: what is the idiom for copy lots of params into self?

2007-01-10 Thread Luis M. González
Emin wrote: > Dear Experts, > > When writing large classes, I sometimes find myself needing to copy a > lot of parameters from the argument of __init__ into self. Instead of > having twenty lines that all basically say something like self.x = x, I > often use __dict__ via something like: > > class

Re: what is the idiom for copy lots of params into self?

2007-01-10 Thread bearophileHUGS
Emin: > This saves a lot of code and makes it easier to see what is going on, > but it seems like there should be a better idiom for this task. Any > suggestions? I know two ways of doing it, one way requires very light code into the __init__ and it uses a decorator that takes the parameters and u

How to use Mercurial for local source code management with a public Subversion server

2007-01-10 Thread Larry Hastings
I'm working on a patch or two for Python. Now, it's always best to use a source code manager (rcs, whatever) when writing code; in particular it'd make updating to the latest Python trees much easier. But I don't have write access to the Python Subversion repository. So I figured out how to wo

Legally correct way of copying stdlib module?

2007-01-10 Thread Leif K-Brooks
I'm writing a package where I need to use the uuid module. Unfortunately, that module is only available in Python 2.5, and my package needs to be compatible with 2.4. I'm planning to copy it from Python 2.5's stdlib into my package, and import it like this: try: import uuid except ImportEr

Re: what is the idiom for copy lots of params into self?

2007-01-10 Thread Steve Holden
Jean-Paul Calderone wrote: > On 10 Jan 2007 14:46:54 -0800, Emin <[EMAIL PROTECTED]> wrote: >> Dear Experts, >> >> When writing large classes, I sometimes find myself needing to copy a >> lot of parameters from the argument of __init__ into self. Instead of >> having twenty lines that all basically

Re: what is the idiom for copy lots of params into self?

2007-01-10 Thread Jean-Paul Calderone
On 10 Jan 2007 14:46:54 -0800, Emin <[EMAIL PROTECTED]> wrote: >Dear Experts, > >When writing large classes, I sometimes find myself needing to copy a >lot of parameters from the argument of __init__ into self. Instead of >having twenty lines that all basically say something like self.x = x, I >oft

Re: Internet Survey

2007-01-10 Thread kkkisok
On 10-Jan-2007, krw <[EMAIL PROTECTED]> wrote: > ...and "HexaPussy" just wouldn't be right. SexagesimalPussy (base 60) has kind of a nice ring to it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python - C# interoperability

2007-01-10 Thread sturlamolden
mc wrote: > Is there an easy way to compile a Python class (or set of classes) into > a .DLL that a C# program can call? Or otherwise to use an existing > library of Python classes from a C# program as seamlessly as possible? One way is to use IronPython if you don't need modules written for CPy

Re: Read from database, write to another database, simultaneously

2007-01-10 Thread Bjoern Schliessmann
Sean Davis wrote: > The author of one of the python database clients mentioned that > using one thread to retrieve the data from the oracle database and > another to insert the data into postgresql with something like a > pipe between the two threads might make sense, keeping both IO > streams bus

Re: Wierd M2Crypto bug - phony "peer did not return certificate" error

2007-01-10 Thread Heikki Toivonen
John Nagle wrote: > I have a little test case for M2Crypto, which just opens up SSL > connections to > web servers and reads their certificates. This works fine. > > But if I execute > > socket.setdefaulttimeout(5.0) Yup, this is a known problem, this breaks all M2Crypto code that uses sock

what is the idiom for copy lots of params into self?

2007-01-10 Thread Emin
Dear Experts, When writing large classes, I sometimes find myself needing to copy a lot of parameters from the argument of __init__ into self. Instead of having twenty lines that all basically say something like self.x = x, I often use __dict__ via something like: class example: def __init__

Re: where to find the spec of format in PyObject_CallMethod

2007-01-10 Thread Huayang Xia
Thanks. I have mixed arguments. I found the format spec @ http://docs.python.org/api/arg-parsing.html On Jan 10, 5:31 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Wed, 2007-01-10 at 14:05 -0800, Huayang Xia wrote: > > I am trying to use PyObject_CallMethod. It needs a format string to > > sp

Read from database, write to another database, simultaneously

2007-01-10 Thread Sean Davis
I am working on a simple script to read from one database (oracle) and write to another (postgresql). I retrieve the data from oracle in chunks and drop the data to postgresql continuously. The author of one of the python database clients mentioned that using one thread to retrieve the data from

Re: Problem installing cElementTree on Python 2.5

2007-01-10 Thread Klaas
Piet van Oostrum wrote: > I have just installed Python 2.5 on Mac OS X 10.4.8 on an iBook (PPC) from > the dmg. Now I tried to install cElementTree -1.0.5-20 from source (no egg > available in cheeseshop) and got the following compilation error: python2.5 ships with cElementTree: import xml.etree

Python 2.5 install on Gentoo Linux: failed dmb and _tkinter

2007-01-10 Thread Sorin Schwimmer
Hi All, After a disaster in which I lost my whole harddrive, I decided to install the newest everything that I use. I put the latest Gentoo Linux, with gcc 4.1.1, installed tcl/tk 8.4.14 and tried Python 2.5. I tried with and without the suggested -fwrapv compiler option, and make gave me the same

Re: where to find the spec of format in PyObject_CallMethod

2007-01-10 Thread Carsten Haese
On Wed, 2007-01-10 at 14:05 -0800, Huayang Xia wrote: > I am trying to use PyObject_CallMethod. It needs a format string to > specify what are the followed arguments. Is it possible to use a > PyObject* as an argument? > > Where can I find the spec for the format? > > Thanks in advance. See http

Problem installing cElementTree on Python 2.5

2007-01-10 Thread Piet van Oostrum
I have just installed Python 2.5 on Mac OS X 10.4.8 on an iBook (PPC) from the dmg. Now I tried to install cElementTree -1.0.5-20 from source (no egg available in cheeseshop) and got the following compilation error: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-ali

where to find the spec of format in PyObject_CallMethod

2007-01-10 Thread Huayang Xia
I am trying to use PyObject_CallMethod. It needs a format string to specify what are the followed arguments. Is it possible to use a PyObject* as an argument? Where can I find the spec for the format? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamic library loading, missing symbols

2007-01-10 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > I suppose this means that any subsequent libraries dlopened will not > see any of the symbols in my module? That's correct, and intentional. Python has crashed in the past when symbols conflicted across shared libraries. > I guess I'll have to look through the Python

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

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: (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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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 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: 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 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: 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 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

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: 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

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: 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: 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: 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: 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

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 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

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: 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: 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: 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: 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

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: 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

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: 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: 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

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

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

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

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: 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: (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: 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?

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

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

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

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: 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: 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

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

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

  1   2   >