Re: client-server parallellised number crunching

2011-04-27 Thread Hans Georg Schaathun
On Tue, 26 Apr 2011 14:31:59 -0700, geremy condra debat...@gmail.com wrote: : Without knowledge of what you're doing it's hard to comment : intelligently, I need to calculate map( foobar, L ) where foobar() is a pure function with no dependency on the global state, L is a list of tuples,

Re: Python IDE/text-editor

2011-04-27 Thread Alec Taylor
Excellent news everyone! They've released an update for Editra with the bugfix for the issues I submitted. So now PyScripter and Editra do exactly what I need, but since Editra is updated it isn't buggy. =] Editra has tabs (in the right place!), syntax-highlight, shortcuts to run code,

Re: Terrible FPU performance

2011-04-27 Thread Ben Finney
Alec Taylor alec.tayl...@gmail.com writes: What's an FPU? Wikipedia not working for you today? :-) URL:http://en.wikipedia.org/wiki/Floating-point_unit I take it as a promising sign that computer-savvy people don't need to know the term anymore, since FPUs have long been integrated parts of

recommended Emacs mode (was Re: Development tools and practices for Pythonistas)

2011-04-27 Thread Gour-Gadadhara Dasa
On Tue, 26 Apr 2011 07:39:41 -0700 (PDT) snorble snor...@hotmail.com wrote: I'm not a Pythonista, but I aspire to be. My current tools: Python, gvim, OS file system I'm also starting with Python after abandoning idea to use D for our desktop GUI application. We plan to use Python + Qt

Re: client-server parallellised number crunching

2011-04-27 Thread geremy condra
On Tue, Apr 26, 2011 at 10:58 PM, Hans Georg Schaathun ge...@schaathun.net wrote: On Tue, 26 Apr 2011 14:31:59 -0700, geremy condra  debat...@gmail.com wrote: :  Without knowledge of what you're doing it's hard to comment :  intelligently, I need to calculate map( foobar, L ) where foobar()

Re: [OT] Comparing VCS tools

2011-04-27 Thread Ben Finney
Ben Finney ben+pyt...@benfinney.id.au writes: Tim Chase python.l...@tim.thechases.com writes: Mercurial (hg) == […] Cons: - no biggies that I've found - (Anecdotal) Merge algorithm sometimes fails catastrophically. I'm going to retract this one point. Merging is not as

Re: Life

2011-04-27 Thread Kelly James
Only an experienced person can tell about life in this great way. a href=http://www.insurancesos.co.uk/articles/life-insurance/index.html; rel=dofollowLife Insurance UK/a -- http://mail.python.org/mailman/listinfo/python-list

Re: recommended Emacs mode (was Re: Development tools and practices for Pythonistas)

2011-04-27 Thread rusi
On Apr 27, 11:39 am, Gour-Gadadhara Dasa g...@atmarama.net wrote: On Tue, 26 Apr 2011 07:39:41 -0700 (PDT) snorble snor...@hotmail.com wrote: I'm not a Pythonista, but I aspire to be. My current tools: Python, gvim, OS file system I'm also starting with Python after abandoning idea to

Re: recommended Emacs mode

2011-04-27 Thread Gour-Gadadhara Dasa
On Wed, 27 Apr 2011 00:51:01 -0700 (PDT) rusi rustompm...@gmail.com wrote: b) python-mode.el or Thats what I use. Upon hearing there is some bug in 23.2 branches with this mode, I've switched to 'emacs-devel' port and will start with this mode as well. Thanks. Sincerely, Gour -- “In

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Jean-Michel Pichavant
Ben Finney wrote: Mercurial – are the ones to choose from. Anoyone recommending a VCS tool that has poor merging support (such as Subversion or, heaven help us, CVS) is doing the newcomer a disservice. True enough. But the modern crop of first-tier VCSen – Bazaar, Git, For a single user,

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Chris Angelico
On Wed, Apr 27, 2011 at 7:24 PM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: For a single user, there would be no merge issue. And svn is very simple to use. That would not be a such bad advice for a beginner with VCS systems. As someone who for years had nightly backups and renamed

Re: client-server parallellised number crunching

2011-04-27 Thread Thomas Rachel
Am 26.04.2011 21:55, schrieb Hans Georg Schaathun: Now, I would like to use remote hosts as well, more precisely, student lab boxen which are rather unreliable. By experience I'd expect to lose roughly 4-5 jobs in 100 CPU hours on average. Thus I need some way of detecting lost connections

Re: Py_INCREF() incomprehension

2011-04-27 Thread Thomas Rachel
Am 26.04.2011 20:44, schrieb Hegedüs Ervin: and (maybe) final question: :) I defined many exceptions: static PyObject *cibcrypt_error_nokey; static PyObject *cibcrypt_error_nofile; static PyObject *cibcrypt_error_badpad; ... void handle_err(int errcode) { switch(errcode) { case

Re: client-server parallellised number crunching

2011-04-27 Thread Hans Georg Schaathun
On Tue, 26 Apr 2011 23:54:24 -0700, geremy condra debat...@gmail.com wrote: : This sounds like a hadoop job, with the caveat that you still have to : get your objects across the network somehow. Have you tried xdrlib or : the struct module? I suspect either would save you some time. Packing

minimal python27.dll?

2011-04-27 Thread est
Hi guys, I need to ship python runtime environment package on Windows, if I want to stripping unnessasery functions from python27.dll to make it as small as possible(and perhaps finally UPX it), which parts of python27.dll do you think can be removed? From what I think, these parts are not

Re: De-tupleizing a list

2011-04-27 Thread John Pinner
On Apr 26, 4:28 am, Gnarlodious gnarlodi...@gmail.com wrote: I have an SQLite query that returns a list of tuples: [('0A',), ('1B',), ('2C',), ('3D',),... What is the most Pythonic way to loop through the list returning a list like this?: ['0A', '1B', '2C', '3D',... -- Gnarlie If you

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Jean-Michel Pichavant
Chris Angelico wrote: On Wed, Apr 27, 2011 at 7:24 PM, Jean-Michel Pichavant jeanmic...@sequans.com wrote: For a single user, there would be no merge issue. And svn is very simple to use. That would not be a such bad advice for a beginner with VCS systems. As someone who for years had

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Anssi Saari
Jean-Michel Pichavant jeanmic...@sequans.com writes: For a single user, there would be no merge issue. Really? What about a single user with many computers and environments? I find myself merging files on occasion because I edited them separately and forgot to check in changes before doing more

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Ben Finney
Jean-Michel Pichavant jeanmic...@sequans.com writes: Ben Finney wrote: Mercurial – are the ones to choose from. Anoyone recommending a VCS tool that has poor merging support (such as Subversion or, heaven help us, CVS) is doing the newcomer a disservice. True enough. But the modern

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Jean-Michel Pichavant
Anssi Saari wrote: Jean-Michel Pichavant jeanmic...@sequans.com writes: For a single user, there would be no merge issue. Really? What about a single user with many computers and environments? I find myself merging files on occasion because I edited them separately and forgot to

Re: client-server parallellised number crunching

2011-04-27 Thread Hans Georg Schaathun
On Wed, 27 Apr 2011 11:35:16 +0200, Thomas Rachel nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de wrote: : As far as I understand, you acquire a job, send it to a remote host via : a socket and then wait for the answer. Is that correct? That's correct. And the client

Re: Reading Huge UnixMailbox Files

2011-04-27 Thread Nobody
On Tue, 26 Apr 2011 14:02:23 -0700, Dan Stromberg wrote: For the archive: This assumes traditional mbox. A SysV-ish sendmail, for example, may not like it. sendmail itself doesn't deal with mailboxes or spool files; that task is left to the local delivery agent (e.g. mail.local or procmail).

Re: Terrible FPU performance

2011-04-27 Thread Mihai Badoiu
I'm using intel xeon harpertown (E5450) and Python 2.6.4. In the cython code, when I use fpclassify, in the slow case I get 3 (FP_SUBNORMAL) In the pure-C code, when I use fpclassify, in the case that's supposed to be slow but it's not, I get a 2 (FP_ZERO) Somehow, the FPU's have different

Re: client-server parallellised number crunching

2011-04-27 Thread Chris Angelico
On Wed, Apr 27, 2011 at 10:21 PM, Hans Georg Schaathun h...@schaathun.net wrote: On Wed, 27 Apr 2011 11:35:16 +0200, Thomas Rachel  nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de wrote: :  As far as I understand, you acquire a job, send it to a remote host via :  a socket

unpickling derived LogRecord in python 2.7 from python2.6

2011-04-27 Thread ivdn...@gmail.com
Hello all, I have a service that runs in python 2.6.4. This service sends LogRecords to a log monitoring app on my workstation running python 2.7. The LogRecord class is derived: class LogRecord(logging.LogRecord): def __init__(self, name, level, fn, lno, user, hostname, msg, args,

How to upload a file

2011-04-27 Thread Torsten Bronger
Hallöchen! I'm skimming through the various recipies for uploading a file via HTTP. Unfortunately, all of them are awkward but also rather old. (See for example http://stackoverflow.com/questions/68477/send-file-using-post-from-a-python-script) In my module, I do my HTTP request like this:

Re: client-server parallellised number crunching

2011-04-27 Thread Hans Georg Schaathun
On Wed, 27 Apr 2011 23:35:06 +1000, Chris Angelico ros...@gmail.com wrote: : On Wed, Apr 27, 2011 at 10:21 PM, Hans Georg Schaathun : h...@schaathun.net wrote: : That's correct.  And the client initiates the connection.  At the : moment, I use one thread per connection, and don't

Re: Case study: debugging failed assertRaises bug

2011-04-27 Thread R David Murray
Ben Finney ben+python at benfinney.id.au writes: (1) assertRaises REALLY needs a better error message. If not a custom message, at least it should show the result it got instead of an exception. +1 Is this one of the many improvements in Python 3.2's ‘unittest’ that Michael Foord

Re: client-server parallellised number crunching

2011-04-27 Thread Chris Angelico
On Thu, Apr 28, 2011 at 12:15 AM, Hans Georg Schaathun h...@schaathun.net wrote: Quite.  I was referring to some tutorials and documentation recommending to use non-blocking sockets and select() within a single thread.  I cannot say that I understand why, but I can imagine the benefit with

Re: minimal python27.dll?

2011-04-27 Thread Tim Golden
On 27/04/2011 11:43, est wrote: I need to ship python runtime environment package on Windows, if I want to stripping unnessasery functions from python27.dll to make it as small as possible(and perhaps finally UPX it), which parts of python27.dll do you think can be removed? Perhaps have a look

Deditor

2011-04-27 Thread Kruptein
Hey, I released a new version (0.2.5) of my pythonic text-editor called Deditor. It is a text-editor aimed to fasten your python development. (it perfectly handels other languages too) Some features are: - python shell to do quick commands or checks - pyflakes error check on save - pylint error

Re: unpickling derived LogRecord in python 2.7 from python2.6

2011-04-27 Thread Peter Otten
ivdn...@gmail.com wrote: I have a service that runs in python 2.6.4. This service sends LogRecords to a log monitoring app on my workstation running python 2.7. The LogRecord class is derived: class LogRecord(logging.LogRecord): def __init__(self, name, level, fn, lno, user,

Re: Deditor

2011-04-27 Thread Alec Taylor
Thanks, any plans for a Windows version? On Thu, Apr 28, 2011 at 1:53 AM, Kruptein darragh@gmail.com wrote: Hey, I released a new version (0.2.5) of my pythonic text-editor called Deditor. It is a text-editor aimed to fasten your python development. (it perfectly handels other

Have you read the Python docs lately?

2011-04-27 Thread Raymond Hettinger
A number of developers have been working on adding examples and useful advice to the docs. To sharpen your skills, here are some pieces of recommended reading: http://docs.python.org/dev/library/heapq.html#priority-queue-implementation-notes

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Thomas Rachel
Am 27.04.2011 13:17, schrieb Jean-Michel Pichavant: You're mistaking, SVN is not restricted to solo work. However it's more suitable for solo work than git. Why? I personally found hg much better than svn. That's why I migrated all my projects. Thomas --

Re: Deditor

2011-04-27 Thread Kruptein
On 27 apr, 19:22, Alec Taylor alec.tayl...@gmail.com wrote: Thanks, any plans for a Windows version? On Thu, Apr 28, 2011 at 1:53 AM, Kruptein darragh@gmail.com wrote: Hey, I released a new version (0.2.5) of my pythonic text-editor called Deditor. It is a text-editor aimed to

Re: Have you read the Python docs lately?

2011-04-27 Thread Irmen de Jong
On 27-4-2011 19:56, Raymond Hettinger wrote: A number of developers have been working on adding examples and useful advice to the docs. To sharpen your skills, here are some pieces of recommended reading: http://docs.python.org/dev/library/heapq.html#priority-queue-implementation-notes

ElementTree XML parsing problem

2011-04-27 Thread Mike
I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ä. Here's the XML: ?xml version=1.0? snapshot time=Mon Apr 25 08:47:23 PDT 2011 records record id=001 education=High School employment=7 yrs / record id=002

Re: Python IDE/text-editor

2011-04-27 Thread Stefaan Himpe
Thanks for all the suggestions, glad I found the right one! You're welcome :D -- http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree XML parsing problem

2011-04-27 Thread Benjamin Kaplan
On Wed, Apr 27, 2011 at 2:26 PM, Mike Mike@invalid.invalid wrote: I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ä. Here's the XML: ?xml version=1.0? snapshot time=Mon Apr 25 08:47:23 PDT 2011 records

Re: client-server parallellised number crunching

2011-04-27 Thread Hans Georg Schaathun
On Thu, 28 Apr 2011 00:58:22 +1000, Chris Angelico ros...@gmail.com wrote: : thousand threads? a couple of million? In Python, it'll probably end : up pretty similar; chances are you won't be taking much advantage of : multiple CPUs/cores (because the threads will all be waiting for : socket

Re: Terrible FPU performance

2011-04-27 Thread David Cournapeau
On Wed, Apr 27, 2011 at 10:04 PM, Mihai Badoiu mbad...@gmail.com wrote: I'm using intel xeon harpertown (E5450) and Python 2.6.4. In the cython code, when I use fpclassify, in the slow case I get 3 (FP_SUBNORMAL) In the pure-C code, when I use fpclassify, in the case that's supposed to be

Re: [OT] VCS tools (was Development tools and practices for Pythonistas)

2011-04-27 Thread Tim Chase
On 04/27/2011 04:24 AM, Jean-Michel Pichavant wrote: Ben Finney wrote: Mercurial – are the ones to choose from. Anoyone recommending a VCS tool that has poor merging support (such as Subversion or, heaven help us, CVS) is doing the newcomer a disservice. True enough. But the modern crop of

Re: [OT] Comparing VCS tools

2011-04-27 Thread Tim Chase
On 04/26/2011 09:45 PM, Ben Finney wrote: Tim Chasepython.l...@tim.thechases.com writes: Bazaar (bzr) Cons: - was slow, though I understand they've worked on improving this Right, that's not a count against Bazaar for at least the last several versions (since 2009 at least).

Re: ElementTree XML parsing problem

2011-04-27 Thread Neil Cerutti
On 2011-04-27, Mike Mike@invalid.invalid wrote: I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ?. Here's the XML: ?xml version=1.0? snapshot time=Mon Apr 25 08:47:23 PDT 2011 records record id=001

Re: De-tupleizing a list

2011-04-27 Thread Algis Kabaila
On Wednesday 27 April 2011 20:56:20 John Pinner wrote: On Apr 26, 4:28 am, Gnarlodious gnarlodi...@gmail.com wrote: I have an SQLite query that returns a list of tuples: [('0A',), ('1B',), ('2C',), ('3D',),... What is the most Pythonic way to loop through the list returning a list

Re: ElementTree XML parsing problem

2011-04-27 Thread Philip Semanchuk
On Apr 27, 2011, at 2:26 PM, Mike wrote: I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ä. Here's the XML: ?xml version=1.0? snapshot time=Mon Apr 25 08:47:23 PDT 2011 records record id=001

Re: ElementTree XML parsing problem

2011-04-27 Thread Hegedüs Ervin
hello, I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ä. Here's the XML: ?xml version=1.0? snapshot time=Mon Apr 25 08:47:23 PDT 2011 records record id=001 education=High School employment=7 yrs /

Re: Deditor

2011-04-27 Thread Algis Kabaila
On Thursday 28 April 2011 01:53:18 Kruptein wrote: Hey, I released a new version (0.2.5) of my pythonic text-editor called Deditor. snip... ( only a .deb is available for download now, if you would like another format (.tar.gz) please comment ) Congratulations! Though I am happy with

Re: Deditor

2011-04-27 Thread Kruptein
On 27 apr, 21:46, Algis Kabaila akaba...@pcug.org.au wrote: On Thursday 28 April 2011 01:53:18 Kruptein wrote: Hey, I released a new version (0.2.5) of my pythonic text-editor called Deditor. snip... ( only a .deb is available for download now, if you would like another format

I think I found a mistake in the official language reference documentation -- or I am missing somethig???

2011-04-27 Thread Igor Soares
Reading the section 6.11. The import statement http://docs.python.org/py3k/reference/simple_stmts.html#the-import-statement I found: Import statements are executed in two steps: (1) find a module, and initialize it if necessary; (2) define a name or names in the local namespace (of the scope

Re: minimal python27.dll?

2011-04-27 Thread Martin v. Loewis
Am 27.04.2011 12:43, schrieb est: Hi guys, I need to ship python runtime environment package on Windows, if I want to stripping unnessasery functions from python27.dll to make it as small as possible(and perhaps finally UPX it), which parts of python27.dll do you think can be removed?

Re: ElementTree XML parsing problem

2011-04-27 Thread Mike
On 4/27/2011 12:33 PM, Hegedüs Ervin wrote: hello, I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ä. Here's the XML: ?xml version=1.0? snapshot time=Mon Apr 25 08:47:23 PDT 2011 records record id=001

Re: unpickling derived LogRecord in python 2.7 from python2.6

2011-04-27 Thread Vinay Sajip
On Apr 27, 5:41 pm, Peter Otten __pete...@web.de wrote: The Problem is that as of Python 2.7logging.LogRecord has become a newstyle class which is pickled/unpickled differently. I don't know if there is an official way to do the conversion, but here's what I've hacked up. The script can read

Re: Deditor

2011-04-27 Thread Yico Gaga
why not linux? 2011/4/28 Alec Taylor alec.tayl...@gmail.com Thanks, any plans for a Windows version? On Thu, Apr 28, 2011 at 1:53 AM, Kruptein darragh@gmail.com wrote: Hey, I released a new version (0.2.5) of my pythonic text-editor called Deditor. It is a text-editor aimed

Re: Deditor

2011-04-27 Thread geremy condra
On Wed, Apr 27, 2011 at 1:47 PM, Yico Gaga trevita2...@gmail.com wrote:  why not linux? The download is a .deb, ie, for Debian and Ubuntu. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree XML parsing problem

2011-04-27 Thread Mike
On 4/27/2011 12:24 PM, Neil Cerutti wrote: On 2011-04-27, MikeMike@invalid.invalid wrote: I'm using ElementTree to parse an XML file, but it stops at the second record (id = 002), which contains a non-standard ascii character, ?. Here's the XML: ?xml version=1.0? snapshot time=Mon Apr 25

Re: Deditor

2011-04-27 Thread Yico Gaga
yeah ,I know ,Ubuntu is based on Debian , i said why not linux , because someone ask for windows version of this Deditor , so, I type :why not linux.. i mean he may like to try a linux-desktop OS; THX~ 2011/4/28 geremy condra debat...@gmail.com On Wed, Apr 27, 2011 at 1:47 PM, Yico Gaga

Re: I think I found a mistake in the official language reference documentation -- or I am missing somethig???

2011-04-27 Thread Ken Watford
On Wed, Apr 27, 2011 at 4:02 PM, Igor Soares ibp@gmail.com wrote: Reading the section 6.11. The import statement http://docs.python.org/py3k/reference/simple_stmts.html#the-import-statement I found: Import statements are executed in two steps: (1) find a module, and initialize it if

Reliably call code after object no longer exists or is unreachable?

2011-04-27 Thread Jack Bates
In Python, how can you reliably call code - but wait until an object no longer exists or is unreachable? I want to ensure that some code is called (excluding some exotic situations like when the program is killed by a signal not handled by Python) but can't call it immediately. I want to wait

Re: minimal python27.dll?

2011-04-27 Thread Ryan Kelly
On Wed, 2011-04-27 at 22:06 +0200, Martin v. Loewis wrote: Am 27.04.2011 12:43, schrieb est: Hi guys, I need to ship python runtime environment package on Windows, if I want to stripping unnessasery functions from python27.dll to make it as small as possible(and perhaps finally UPX

Re: Have you read the Python docs lately?

2011-04-27 Thread Dan Stromberg
On Wed, Apr 27, 2011 at 10:56 AM, Raymond Hettinger pyt...@rcn.com wrote: A number of developers have been working on adding examples and useful advice to the docs.  To sharpen your skills, here are some pieces of recommended reading:

Re: I think I found a mistake in the official language reference documentation -- or I am missing somethig???

2011-04-27 Thread Igor Soares
On Apr 27, 6:21 pm, Ken Watford kwatford+pyt...@gmail.com wrote: On Wed, Apr 27, 2011 at 4:02 PM, Igor Soares ibp@gmail.com wrote: Reading the section 6.11. The import statement http://docs.python.org/py3k/reference/simple_stmts.html#the-import-st... I found: Import statements are

Re: Have you read the Python docs lately?

2011-04-27 Thread Ben Finney
Raymond Hettinger pyt...@rcn.com writes: A number of developers have been working on adding examples and useful advice to the docs. To sharpen your skills, here are some pieces of recommended reading: Great stuff, and thank you for directing us to some gems.

Re: Development tools and practices for Pythonistas

2011-04-27 Thread Ben Finney
Thomas Rachel writes: Am 27.04.2011 13:17, schrieb Jean-Michel Pichavant: You're mistaking, SVN is not restricted to solo work. However it's more suitable for solo work than git. Why? I personally found hg much better than svn. That's why I migrated all my projects. Indeed. The only

Re: I think I found a mistake in the official language reference documentation -- or I am missing somethig???

2011-04-27 Thread MRAB
On 27/04/2011 21:02, Igor Soares wrote: Reading the section 6.11. The import statement http://docs.python.org/py3k/reference/simple_stmts.html#the-import-statement I found: Import statements are executed in two steps: (1) find a module, and initialize it if necessary; (2) define a name or

Re: minimal python27.dll?

2011-04-27 Thread est
On Apr 27, 11:15 pm, Tim Golden m...@timgolden.me.uk wrote: Perhaps have a look at tinypy?    http://www.tinypy.org/ Even if it's not exactly what you want, I expect that the author will have useful ideas / experience. TJG Thanks, but I still need the completeness of CPython. AFAIK TinyPy

use of index (beginner's question)

2011-04-27 Thread Rusty Scalf
Greetings, I am just now learning python and am trying to use the index function with variables. list1 = ['pig', 'horse', 'moose'] list2 = ['62327', '49123', '79115'] a = list2[list1.index('horse')] print a 49123 -works fine. But list1 = ['pig', 'horse', 'moose'] list2 = ['62327',

Re: use of index (beginner's question)

2011-04-27 Thread Chris Angelico
On Thu, Apr 28, 2011 at 10:42 AM, Rusty Scalf iai-...@sonic.net wrote: list1 = ['pig', 'horse', 'moose'] list2 =  ['62327', '49123', '79115'] n = 2 s2 = list + `n` a = s2[list1.index('horse')] print a s2 is a string with the value list2; this is not the same as the variable list2. You could

Re: Reliably call code after object no longer exists or is unreachable?

2011-04-27 Thread Thomas 'PointedEars' Lahn
Jack Bates wrote: Python's __del__ or destructor method works (above) - but only in the absence of reference cycles (below). An object, with a __del__ method, in a reference cycle, causes all objects in the cycle to be uncollectable. This can cause memory leaks and because the object is

Re: Reliably call code after object no longer exists or is unreachable?

2011-04-27 Thread Dan Stromberg
On Wed, Apr 27, 2011 at 5:54 PM, Thomas 'PointedEars' Lahn pointede...@web.de wrote: Jack Bates wrote: Faced with the real potential for reference cycles, how can you reliably call code - but wait until an object no longer exists or is unreachable? For normal program termination, the

Re: use of index (beginner's question)

2011-04-27 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: Rusty Scalf wrote: list1 = ['pig', 'horse', 'moose'] list2 = ['62327', '49123', '79115'] n = 2 s2 = list + `n` I would prefer the clearer s2 = list + str(n) or s2 = list%s % n a = s2[list1.index('horse')] print a s2 is a string with the value list2; this

Re: use of index (beginner's question)

2011-04-27 Thread Chris Rebert
On Wed, Apr 27, 2011 at 6:23 PM, Thomas 'PointedEars' Lahn pointede...@web.de wrote: Chris Angelico wrote: Rusty Scalf wrote: list1 = ['pig', 'horse', 'moose'] list2 =  ['62327', '49123', '79115'] n = 2 s2 = list + `n` I would prefer the clearer  s2 = list + str(n) or  s2 = list%s %

Re: use of index (beginner's question)

2011-04-27 Thread Chris Angelico
On Thu, Apr 28, 2011 at 11:23 AM, Thomas 'PointedEars' Lahn pointede...@web.de wrote: You forgot a comma after the first `]', to separate the list elements. Whoops! Apologies. It's very confusing when example code has silly bugs in it! And yes, need to either back down the indices or insert a

Re: use of index (beginner's question)

2011-04-27 Thread Steven D'Aprano
On Wed, 27 Apr 2011 17:42:30 -0700, Rusty Scalf wrote: Greetings, I am just now learning python and am trying to use the index function with variables. list1 = ['pig', 'horse', 'moose'] list2 = ['62327', '49123', '79115'] a = list2[list1.index('horse')] print a 49123 -works

Access violation reading 0x00000010

2011-04-27 Thread yuan zheng
Hi, everyone. I have a question when I invoke an api which is included a library open by CDLL. And then it will prompt the follow error: libcommon.SIM_init() WindowsError: exception: access

Re: Access violation reading 0x00000010

2011-04-27 Thread Chris Angelico
On Thu, Apr 28, 2011 at 1:00 PM, yuan zheng tsinghuayua...@gmail.com wrote: Hi,     everyone. I have a question when I invoke an api which is included a library open by CDLL. And then it will prompt the follow error: How are you invoking it? Chris Angelico --

Re: use of index (beginner's question)

2011-04-27 Thread Algis Kabaila
On Thursday 28 April 2011 11:23:51 Thomas 'PointedEars' Lahn wrote: Chris Angelico wrote: Rusty Scalf wrote: list1 = ['pig', 'horse', 'moose'] list2 = ['62327', '49123', '79115'] n = 2 s2 = list + `n` list + 'n' 'listn' And IMHO you did not want that, did you? OldAl. -- Algis

Re: Deditor

2011-04-27 Thread Alec Taylor
By all means I use Linux... when it's available, but I'm often on non-Linux machines (at Uni), so it'd be great if something like Deditor was available. On Thu, Apr 28, 2011 at 7:07 AM, Yico Gaga trevita2...@gmail.com wrote: yeah ,I know ,Ubuntu is based on Debian , i said why not linux ,

Re: Deditor

2011-04-27 Thread jmfauth
On 27 avr, 19:22, Alec Taylor alec.tayl...@gmail.com wrote: Thanks, any plans for a Windows version? - Download the deb - Unpack it with a utility like 7zip - Throw away the unnecessary stuff, (keep the deditor part) - Depending on your libs, adatpt the import - Launch deditor.py - Then ... [5

[issue8809] smtplib should support SSL contexts

2011-04-27 Thread Kasun Herath
Kasun Herath kasun...@gmail.com added the comment: Thanks for the quick review. I'm submitting a new patch with changes suggested. -- Added file: http://bugs.python.org/file21791/smtp_sslcontext_updated3.patch ___ Python tracker

[issue11763] assertEqual memory issues with large text inputs

2011-04-27 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 8dbf661c0a63 by Ezio Melotti in branch '2.7': #11763: don't use difflib in TestCase.assertMultiLineEqual if the strings are too long. http://hg.python.org/cpython/rev/8dbf661c0a63 New changeset 04e64f77c6c7 by Ezio Melotti in

[issue11763] assertEqual memory issues with large text inputs

2011-04-27 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: I committed a slightly modified version of the patch, so the issue should be fixed now. There are two related problems though: 1) difflib is used in other places, so those should probably be checked too; 2) _baseAssertEqual should check if

[issue11922] Add General Index to Windows .chm help file Contents

2011-04-27 Thread Tim Golden
Tim Golden m...@timgolden.me.uk added the comment: I can't say I'd object as such, but the [Index] tab already contains the items in the General Index and is arguably the killer feature of the CHM in any case. -- nosy: +tim.golden ___ Python tracker

[issue9390] Error in sys.excepthook on windows when redirecting output of the script

2011-04-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I've seen the same question/answer on other forums, about Perl, Lua and Javascript http://stackoverflow.com/questions/3018848/cannot-run-python-script-on-windows-with-output-redirected but nobody suggested to set this flag by default.

[issue11921] distutils2 should be able to compile an Extension based on the Python implementation version

2011-04-27 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Alexis is right, the implementation name is not currently available as an environment marker. Maybe another approach could be used: consider all extensions optional on non-CPython platforms? -- versions: +3rd party -Python 2.7

[issue11928] fail on filename with space at the end

2011-04-27 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Do you get the bug if you put such a filename in the MANIFEST file, or MANIFEST.in, or data_files argument, or something else, or all of them? If it’s a MANIFEST bug, can you test with quotes around the filename? -- assignee: tarek -

[issue9614] _pickle is not entirely 64-bit safe

2011-04-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The warnings above are a bit old: 027f81579b4a changed Pdata into a PyVarObject, and the int length member is now accessed with the Py_SIZE() macro. Unfortunately, the only win64 buildbot is offline, and I could not find any recent

[issue10148] st_mtime differs after shutil.copy2

2011-04-27 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10148 ___ ___ Python-bugs-list

[issue11933] newer() function in dep_util.py mixes up new vs. old files due stat.st_mtime vs stat[ST_MTIME]

2011-04-27 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Hi! Welcome to the joy of Python and thanks for the bug report and analysis. In researching a bug Is it public? I’d be curious to look at it. I was surprised that a newly created file was being replaced when being processed a second time

[issue11914] pydoc modules/help('modules') crash in dirs with unreadable subdirs

2011-04-27 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- components: +Library (Lib) -Demos and Tools nosy: +eric.araujo stage: - test needed versions: -Python 2.5, Python 2.6, Python 3.4 ___ Python tracker rep...@bugs.python.org

[issue6625] UnicodeEncodeError on pydoc's CLI

2011-04-27 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo versions: -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6625 ___ ___

[issue9614] _pickle is not entirely 64-bit safe

2011-04-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Yes there are still warnings, but in different places; here is an extract of the previous buildlog.html file: ..\Modules\_pickle.c(156) : warning C4244:'initializing' : conversion from 'Py_ssize_t' to 'int', possible loss of data

[issue11928] fail on filename with space at the end

2011-04-27 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: The mere presence of this file in directory with setup.py files this error. It is not added in any files. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11928

[issue11928] fail on filename with space at the end

2011-04-27 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Wow. Can you set DISTUTILS_DEBUG=1 in your environment and then copy the full traceback here? Try to see if other commands like build or check cause the error too. -- ___ Python tracker

[issue11928] fail on filename with space at the end

2011-04-27 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: python setup.py sdist {{{ Distribution.parse_config_files(): options (after parsing config files): no commands known yet options (after parsing command line): option dict for 'sdist' command: {} running sdist

[issue11928] fail on filename with space at the end

2011-04-27 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: WindowsError: [Error 2] The system cannot find the file specified: 'some file ' The strange thing is that the filename is correct (I feared it was a strip() call somewhere that caused the bug), and that you get a WindowsError. This makes me

[issue10318] make altinstall installs many files with incorrect shebangs

2011-04-27 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: There are a lot of examples that use a bare “python”; changing all of those would cause merging pains. I’ve changed my mind. Given the python/python2/python3 drama with distributions, I now think that we should use “python3” in the 3.x docs.

[issue11182] remove unused undocumented pydoc.Scanner class

2011-04-27 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo stage: - needs patch title: pydoc.Scanner class not used by anything - remove unused undocumented pydoc.Scanner class ___ Python tracker rep...@bugs.python.org

[issue11934] build with --prefix=/dev/null and zlib enabled in Modules/Setup failed

2011-04-27 Thread ysj.ray
New submission from ysj.ray ysj@gmail.com: The development guide(http://docs.python.org/devguide/setup.html) suggested that one can build with --prefix=/dev/null in order to avoid accidentally install it. But in the Modules/Setup.dist the zlib module is defined as: zlib zlibmodule.c

  1   2   3   >