Re: How to pass out the result from iterated function

2008-12-11 Thread JD
On Dec 10, 2:25 pm, eric <[EMAIL PROTECTED]> wrote: > On Dec 10, 9:16 pm, JD <[EMAIL PROTECTED]> wrote: > > > > > I got a iterated function like this: > > > def iterSomething(list): > > has_something = False > >

How to pass out the result from iterated function

2008-12-10 Thread JD
problem is how can I read this final_out outside of the function. I tried the global statement, it seems not work. Any idea? JD -- http://mail.python.org/mailman/listinfo/python-list

Re: algorizm to merge nodes

2008-10-17 Thread JD
It could be a very good "homework assignmet". This is for a real application. each item in the list represent two terminals of a resistor. All the resistors in the list are shorted, I need to figure out how many independent nets are there. JD On Oct 17, 4:16 pm, Paul McGuire <[EM

Re: algorizm to merge nodes

2008-10-17 Thread JD
Thanks, This one really works. JD On Oct 17, 3:17 pm, [EMAIL PROTECTED] wrote: > JD, you probably need the algorithm for connected components of an > undirected graph. > > For example you can do that with my graph > lib:http://sourceforge.net/projects/pynetwork/ > > from g

Re: algorizm to merge nodes

2008-10-17 Thread JD
'c', 'u'], \ ['b', 'p'],\ ['e', 'd']] The result is set(['a', 'p', 'b', 'g']), set(['e', 'c', 'u', 'd']), set(['k', 'e', 'd

Re: algorizm to merge nodes

2008-10-17 Thread JD
Hi, Thanks for the help, but the result is not quite right: [['a', 'b', 'g'], ['c', 'd', 'u'], ['b', 'p'], ['e', 'f', 'k']] the ['b', 'p'] is not merged.

algorizm to merge nodes

2008-10-17 Thread JD
7;]] Each item in the list need to be merged. For example, 'a', 'b' will be merged, 'c', 'd' will be merged. Also if the node in the list share the same name, all these nodes need be merged. For example, ['a', 'b'], ['a', '

issue with cookielib.LWPCookieJar

2007-11-30 Thread JD Smith
Greetings: My cookiejar contains the cookie that I need however when I do cj.save(file) it does not actually save out to the cookies.lwj Does anyone have any clue what would keep this from saving? It CREATED my cookies.lwj file so I know it's not permissions. cookies.lwp: #LWP-Cookies-2.0 tes

Re: pygresql

2007-11-04 Thread JD
Apologies for essentially talking to myself out loud! I've switched back to pygresql. I think a lot of my problems were caused by not having installed postgresql-server-dev-8.2 which contains a lot of header files etc. I'm sure this was part of the problem with the psycopg modules aswell. postgre

Re: pygresql

2007-11-04 Thread JD
Btw apologies for naming the post 'pygresql'! That was the module I was attempting to use before. -- http://mail.python.org/mailman/listinfo/python-list

pygresql

2007-11-04 Thread JD
Hi there. I'm trying to use python with postgresql. I decided to use psycopg to interact with the postgresql server. When installing psycopg it appeared that I needed mxDateTime. So I decided to install the mxbase package. I received the following error message (the interesting bit seems to be a

Re: A question about subprocess

2007-10-05 Thread JD
Thanks very much for all the answers. JD On Oct 3, 6:24 pm, Dan Stromberg <[EMAIL PROTECTED]> wrote: > You don't necessarily need thesubprocessmodule to do this, though you > could use it. > > I've done this sort of thing in the past with fork and exec. > > To

A question about subprocess

2007-10-03 Thread JD
machine A, B, C should be in parallel, however, for each machine, jobs should run one after another. How can I do it with the subprocess? Thanks, JD -- http://mail.python.org/mailman/listinfo/python-list

Re: xml-rpc timeout

2007-09-21 Thread Jd
Steve Holden wrote: > Jd wrote: >> Hi >>I have a multi-threaded application. For certain operations to the >> server, I would like to explicitly set timeout so that I get correct >> status from the call and not timed out exception. >>Does anyone know ho

threading.local _threading_local problems

2007-09-21 Thread Jd
rom within the thread) Or is there anyway to notify the object when the thread for which it set the local storage is going away ? This looks to me a bit like design shortcoming. or I have missed something completely. Thanks /Jd -- http://mail.python.org/mailman/listinfo/python-list

xml-rpc timeout

2007-09-21 Thread Jd
Hi I have a multi-threaded application. For certain operations to the server, I would like to explicitly set timeout so that I get correct status from the call and not timed out exception. Does anyone know how to go about doing it ? /Jd -- http://mail.python.org/mailman/listinfo/python

hang in multithreaded program / python and gdb.

2007-09-13 Thread Jd
PyThread_acquire_lock() 1 thread in _poll from _socketmodule.so. Any ideas what might be going on. (Isnt PyThread_acquire_lock() trying to get the global interpreter lock ?) Any help.. pointers are welcome. Thanks /Jd -- http://mail.python.org/mailman/listinfo/python-list

Re: File access

2007-08-02 Thread JD
Thanks for the suggestion, I am thinking implement a database system for that. JD On Aug 2, 12:11 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > JD wrote: > > Hi, > > > What I am trying to do is to run a subprocess on another machine using > > subprocess.Popen, thi

Re: File access

2007-08-02 Thread JD
Thanks for answering, No, the data was writing into the file when the subprocess was runing. For example, every second it will write something into the file. I tried to run another python program aside and it sucessfully read the file when the subprocess was runing. JD On Aug 2, 11:00 am

File access

2007-08-02 Thread JD
subprocess was runing. The problem is I could not get anything untill the subprocess finished. I also tried to run another python programm when the subprocess is runing, I could get what I want. Does anyone know why? Thanks! JD -- http://mail.python.org/mailman/listinfo/python-list

Re: clean up html document created by Word

2007-03-30 Thread jd
Wow, thanks for all the great responses! Here's my summary: - demoronizer (from John Walker) is designed to solve some very particular problems that could be considered bugs. However, it doesn't remove the unnecessary html generated by Word. http://www.fourmilab.ch/webtools/demoroniser/ - The

clean up html document created by Word

2007-03-30 Thread jd
I am looking for python code (working or sample code) that can take an html document created by Microsoft Word and clean it up (if you've never had to look at a Word-generated html document, consider yourself lucky ;-) Alternatively, if you know of a non-python solution, I'd like to hear about it.

looking for RSS generator

2007-03-27 Thread jd
I'm looking for sample code to generate an RSS feed. I can annotate my html code with comments/tags to mark the articles, all I need is an "engine" to process the pages and generate the rss file. If I was a python wiz I'm sure I could do this quickly but as a newbie, an assist here would certainl

creating "jsp-like" tool with python

2007-03-23 Thread jd
I'd like to create a program that takes files with "jsp-like" markup and processes the embedded code (which would be python) to produce the output file. There would be two kinds of sections in the markup file: python code to be evaluated, and python code that returns a value that would be inserted

removing dictionary key-pair

2006-06-09 Thread JD
Hello, I try to remove a dictionary key-pair (remove an entry), but I'm unsuccessful. Does anyone know how to achieve this? Thanks -- http://mail.python.org/mailman/listinfo/python-list

changing python script on-the-fly for ActiveX/COM object (win32com)

2006-02-01 Thread jd
I have implemented a COM object in Python and I would like to be able to change the script without stopping and restarting the application that's using the COM object. Is there a way to do this? (I can change the program that calls the COM object if needed.) Thanks... -- jeff -- http://mail.p

Re: output buffering

2005-11-11 Thread JD
On 2005-11-11, Larry Bates <[EMAIL PROTECTED]> wrote: > This is something I wrote that might help. > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299207 > The solutions become better and better. Thanks. > -Larry Bates > > JD wrote: >> Hello, >&g

Re: output buffering

2005-11-11 Thread JD
On 2005-11-11, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > "JD" <[EMAIL PROTECTED]> wrote: > >> When reading a large datafile, I want to print a '.' to show the >> progress. This fails, I get the series of '.'s after the data has been >

output buffering

2005-11-11 Thread JD
Hello, When reading a large datafile, I want to print a '.' to show the progress. This fails, I get the series of '.'s after the data has been read. Is there a trick to fix this? Thanks -- http://mail.python.org/mailman/listinfo/python-list