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.
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
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
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
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
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
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
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
(['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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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/
-
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
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
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
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
--
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
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
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
33 matches
Mail list logo