[issue42895] Return multi-line list concatenation without parentheses returns only first operand

2021-01-11 Thread JD-Veiga
JD-Veiga added the comment: What a shame. I forget that + is also a unary operator. That produces a new logical line with correct identation though never executed. Sorry for the inconvenience.⁶ -- ___ Python tracker <https://bugs.python.

[issue42895] Return multi-line list concatenation without parentheses returns only first operand

2021-01-11 Thread JD-Veiga
New submission from JD-Veiga : I was trying to return the concatenation of several lists from a function but, inadvertently, forgot to surround the multi-line concatenation expression with parentheses. As a result, the function returns just the first operand and does not perform

[issue41205] Documentation Decimal power 0 to the 0 is Nan (versus 0 to the 0 which is 1)

2020-07-04 Thread JD-Veiga
JD-Veiga added the comment: Well, it is the way that it has been defined in `decimal` package and in the document that inspired this package (IBM's General Decimal Arithmetic Specification, The General Decimal Arithmetic Specification: http://speleotrove.com/decimal/decarith.html

[issue41205] Documentation Decimal power 0 to the 0 is Nan (versus 0 to the 0 which is 1)

2020-07-03 Thread JD-Veiga
New submission from JD-Veiga : Hi, I would like to propose a minor addition to `decimal` package documentation page (https://docs.python.org/3/library/decimal.html). I think that we should add a paragraph in `context.power(x, y, modulo=None)` stating that `Decimal(0) ** Decimal(0)` returns

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 for cell in list: if something in cell: has_something = True

How to pass out the result from iterated function

2008-12-10 Thread JD
The 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

algorizm to merge nodes

2008-10-17 Thread JD
share the same name, all these nodes need be merged. For example, ['a', 'b'], ['a', 'g'] ['b', 'p'] will be merged to ['a', 'b', 'g', 'p'] The answer should be: [['a', 'b', 'g', 'p'], ['c', 'd', 'u'], ['e', 'f', 'k']] Anyone has a solution? Thanks, JD -- http://mail.python.org/mailman/listinfo

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. JD On Oct 17, 2:35 pm, Chris Rebert [EMAIL PROTECTED] wrote: (Disclaimer: completely untested) from collections import defaultdict

Re: algorizm to merge nodes

2008-10-17 Thread JD
(['k', 'e', 'd', 'f']) The right result should be: ['a', 'p', 'b', 'g'], ['c', 'u', 'e', 'd', 'k', 'f'] JD On Oct 17, 3:00 pm, Mensanator [EMAIL PROTECTED] wrote: On Oct 17, 3:20 pm, JD [EMAIL PROTECTED] wrote: Hi, I need help for a task looks very simple: I got a python list like

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 graph import Graph g = Graph

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 [EMAIL PROTECTED

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

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

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

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.

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 serialize the jobs on the machines

A question about subprocess

2007-10-03 Thread JD
on 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

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

threading.local _threading_local problems

2007-09-21 Thread Jd
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

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 how to go about doing it ? The easiest way

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

File access

2007-08-02 Thread JD
the 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: 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

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, this subprocess contuinue writing something

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

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

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 certainly

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

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

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 read. Is there a trick to fix this? assuming that you're printing

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, When reading a large datafile, I want to print