Re: Iterate from 2nd element of a huge list

2012-02-01 Thread Peter Otten
Arnaud Delobelle wrote: Em 01-02-2012 01:39, Paulo da Silva escreveu: What is the best way to iterate thru a huge list having the 1st element a different process? I.e.: Nobody mentioned itertools.islice, which can be handy, especially if you weren't interested in the first element of the

Re: Installing pypi package twice

2012-02-01 Thread Ben Finney
Jason Friedman ja...@powerpull.net writes: How would I also install this package for 3.2.2? (I am assuming that python-daemon-1.5.5 is either version3-compatible or I can make it so). I am the primary developer of ‘python-daemon’. It is an explicit goal of this library to target Python 3,

Re: xhtml encoding question

2012-02-01 Thread Stefan Behnel
Tim Arnold, 31.01.2012 19:09: I have to follow a specification for producing xhtml files. The original files are in cp1252 encoding and I must reencode them to utf-8. Also, I have to replace certain characters with html entities. I think I've got this right, but I'd like to hear if there's

Re: xhtml encoding question

2012-02-01 Thread Ulrich Eckhardt
Am 31.01.2012 19:09, schrieb Tim Arnold: high_chars = { 0x2014:'mdash;', # 'EM DASH', 0x2013:'ndash;', # 'EN DASH', 0x0160:'Scaron;',# 'LATIN CAPITAL LETTER S WITH CARON', 0x201d:'rdquo;', # 'RIGHT DOUBLE QUOTATION MARK', 0x201c:'ldquo;', # 'LEFT DOUBLE QUOTATION MARK',

Re: Iterate from 2nd element of a huge list

2012-02-01 Thread Paul Rubin
Paulo da Silva p_s_d_a_s_i_l_...@netcabo.pt writes: process1(mylist[0]) for el in mylist[1:]: process2(el) This way mylist is almost duplicated, isn't it? I think it's cleanest to use itertools.islice to get the big sublist (not tested): from itertools import islice process1

Re: xhtml encoding question

2012-02-01 Thread Peter Otten
Ulrich Eckhardt wrote: Am 31.01.2012 19:09, schrieb Tim Arnold: high_chars = { 0x2014:'mdash;', # 'EM DASH', 0x2013:'ndash;', # 'EN DASH', 0x0160:'Scaron;',# 'LATIN CAPITAL LETTER S WITH CARON', 0x201d:'rdquo;', # 'RIGHT DOUBLE QUOTATION MARK', 0x201c:'ldquo;', # 'LEFT

Re: How can I verify if the content of a variable is a list or a string?

2012-02-01 Thread Chris Angelico
On Wed, Feb 1, 2012 at 12:11 PM, Andres Soto soto_and...@yahoo.com wrote: okok, my mistake is that I was using string in place of str. Thank you!! regards Tip: In the interactive interpreter, enter: type(spam) class 'str' In Python 2, it'll say type not class, but same diff. It tells you

Re: Disable use of pyc file with no matching py file

2012-02-01 Thread Jean-Michel Pichavant
Terry Reedy wrote: On 1/31/2012 9:19 AM, Jean-Michel Pichavant wrote: A: My wheel is flat B: Buy a new car A better analogy would be Q. How do I make my old model car do something (it cannot do)? A. Get the free new model that has that feature added. Of course, there is a cost to giving up

Re: Disable use of pyc file with no matching py file

2012-02-01 Thread Terry Reedy
On 1/31/2012 11:14 PM, Roy Smith wrote: We would love to move to 3.x, for the better unicode support, if nothing else. What's keeping us from doing so is the host of third-party modules and tools we depend on that don't yet support 3.x. Tell that to the authors of packages you use so they no

Re: configobj

2012-02-01 Thread Andrea Crotti
On 02/01/2012 12:21 AM, Terry Reedy wrote: On 1/31/2012 11:06 AM, Andrea Crotti wrote: I have a couple of questions about configobj, which I'm happily trying to use for this project. When asking about 3rd party modules, please include a url, so we can be sure of what you mean and even take a

Re: Iterate from 2nd element of a huge list

2012-02-01 Thread Arnaud Delobelle
On 1 February 2012 08:11, Peter Otten __pete...@web.de wrote: Arnaud Delobelle wrote: The example should be from itertools import islice: for el in islice(mylist, 1, None):     process2(el) Oops! -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: Disable use of pyc file with no matching py file

2012-02-01 Thread Devin Jeanpierre
On Tue, Jan 31, 2012 at 6:55 PM, Terry Reedy tjre...@udel.edu wrote: Q. How do I make my old model car do something (it cannot do)? A. Get the free new model that has that feature added. Of course, there is a cost to giving up the old and familiar and learning and adjusting to the new, even

Re: Iterate from 2nd element of a huge list

2012-02-01 Thread Stefan Behnel
Paul Rubin, 01.02.2012 10:25: Paulo da Silva writes: process1(mylist[0]) for el in mylist[1:]: process2(el) This way mylist is almost duplicated, isn't it? I think it's cleanest to use itertools.islice to get the big sublist (not tested): from itertools import islice

FounderDating - Helping entrepreneurs find their co-founder start companies!

2012-02-01 Thread Jason Demant
Looking for your co-founder? FounderDating is back in San Francisco on March 1st (Apply by February 20th), in Seattle on March 6th (Apply by February 26th) and NY on February 21st (Apply by February 16th) at http://members.founderdating.com/application/. What is FounderDating? A great team is the

Re: Disable use of pyc file with no matching py file

2012-02-01 Thread John Roth
On Jan 31, 4:43 pm, Terry Reedy tjre...@udel.edu wrote: On 1/31/2012 3:20 PM, John Roth wrote: On Jan 30, 3:43 pm, Terry Reedytjre...@udel.edu  wrote: On 1/30/2012 4:30 PM, Roy Smith wrote: Every so often (typically when refactoring), I'll remove a .py file and forget to remove the

python reliability with EINTR handling in general modules

2012-02-01 Thread oleg korenevich
I have linux board on samsung SoC s3c6410 (ARM11). I build rootfs with buildroot: Python 2.7.1, uClibc-0.9.31. Linux kernel: Linux buildroot 2.6.28.6 #177 Mon Oct 3 12:50:57 EEST 2011 armv6l GNU/Linux My app, written on python, in some mysterios conditons raise this exceptions: 1) exception:

Registry entries set up by the Windows installer

2012-02-01 Thread Paul Moore
I'm trying to get information on what registry entries are set up by the Python Windows installer, and what variations exist. I don't know enough about MSI to easily read the source, so I'm hoping someone who knows can help :-) As far as I can see on my PC, the installer puts entries

Buffering in Wing and IDLE 3

2012-02-01 Thread Franck Ditter
Hi, I'm using Python 3.2.x with beginners. If I try the following in IDLE 3, it works as expected : from time import sleep import sys for i in range(4) : sys.stdout.write(str(i)) sys.stdout.flush() sleep(1) but with Wing-101, it write 0123 after the total sleep time. Why ??? I

solutions manual books

2012-02-01 Thread solutions team
trust solutions team trustsolutionsteam(at)hotmail(dot)com We're a team for providing solution manuals to help students in their study. We sell the books in a soft copy, PDF format. We will find any book or solution manual for you. Just email us: t r u s t s o l u t i o n s t e a m @ h o t m

Re: python zipfile v. native unzip

2012-02-01 Thread Michael Torrie
On 01/31/2012 06:41 AM, Jason Friedman wrote: Does Python 2.7's zipfile module use its own algorithm or does it leverage the zip/unzip libraries that exist on the host? I ask because my host's native unzip program cannot handle files that, when unzipped, are larger than 2GB. Will using

changing sys.path

2012-02-01 Thread Andrea Crotti
So suppose I want to modify the sys.path on the fly before running some code which imports from one of the modules added. at run time I do sys.path.extend(paths_to_add) but it still doesn't work and I get an import error. If I take these paths and add them to site-packages/my_paths.pth

Re: xhtml encoding question

2012-02-01 Thread Ulrich Eckhardt
Am 01.02.2012 10:32, schrieb Peter Otten: It doesn't matter for the OP (see Stefan Behnel's post), but If you want to replace characters in a unicode string the best way is probably the translate() method: print u\xa9\u2122 ©™ u\xa9\u2122.translate({0xa9: ucopy;, 0x2122: utrade;})

Re: Installing pypi package twice

2012-02-01 Thread Hans Mulder
On 1/02/12 07:04:31, Jason Friedman wrote: My system's default python is 2.6.5. I have also installed python3.2 at /opt/python. I installed a pypi package for 2.6.5 with: $ tar xzf package.tar.gz $ cd package $ python setup.py build $ sudo python setup.py install How can I also install this

Re: Installing pypi package twice

2012-02-01 Thread Andrea Crotti
On 02/01/2012 04:49 PM, Hans Mulder wrote: How about (in another directory): $ tar xzf package.tar.gz $ cd package $ /opt/python/bin/python setup.py build $ sudo /opt/python/bin/python setup.py install This assumes that /opt/python/bin/python is your python3.2 executable. You may want to

TypeError

2012-02-01 Thread Clark, Kathleen
Hello, I am new to python and am trying to correct the follow error: TypeError: sequence item 1: expected string, NoneType found The error message is referencing line 86 of my code: ws.cell(row=row, column=1).value = ','.join([str(ino), fn, ln, sdob]) If I'm understanding this correctly, the

Question about name scope

2012-02-01 Thread Olive
I am learning python and maybe this is obvious but I have not been able to see a solution. What I would like to do is to be able to execute a function within the namespace I would have obtained with from module import * For example if I write: def f(a): return sin(a)+cos(a) I could

Re: changing sys.path

2012-02-01 Thread jmfauth
On 1 fév, 17:15, Andrea Crotti andrea.crott...@gmail.com wrote: So suppose I want to modify the sys.path on the fly before running some code which imports from one of the modules added. at run time I do sys.path.extend(paths_to_add) but it still doesn't work and I get an import error. If

Re: TypeError

2012-02-01 Thread Dave Angel
On 02/01/2012 11:53 AM, Clark, Kathleen wrote: Hello, Which python version, what operating system. Doesn't cost much to specify, and can frequently be relevant. I am new to python and am trying to correct the follow error: TypeError: sequence item 1: expected string, NoneType found That's

Re: Question about name scope

2012-02-01 Thread Chris Kaynor
On Wed, Feb 1, 2012 at 9:11 AM, Olive di...@bigfoot.com wrote: I am learning python and maybe this is obvious but I have not been able to see a solution. What I would like to do is to be able to execute a function within the namespace I would have obtained with from module import * For

Re: Question about name scope

2012-02-01 Thread Rick Johnson
On Feb 1, 11:11 am, Olive di...@bigfoot.com wrote: But I have polluted my global namespace with all what's defined in math. I would like to be able to do something like from math import * at the f level alone. Seeing is believing! dir() ['__builtins__', '__doc__', '__name__', '__package__']

Re: Question about name scope

2012-02-01 Thread Ethan Furman
Olive wrote: I am learning python and maybe this is obvious but I have not been able to see a solution. What I would like to do is to be able to execute a function within the namespace I would have obtained with from module import * For example if I write: def f(a): return

Re: TypeError

2012-02-01 Thread Nick Dokos
Clark, Kathleen katie.cl...@yale.edu wrote: TypeError: sequence item 1: expected string, NoneType found The error message is referencing line 86 of my code: ws.cell(row=row, column=1).value = ','.join([str(ino), fn, ln, sdob]) If I’m understanding this correctly, the code is expecting

Re: Question about name scope

2012-02-01 Thread Dave Angel
On 02/01/2012 12:11 PM, Olive wrote: I am learning python and maybe this is obvious but I have not been able to see a solution. What I would like to do is to be able to execute a function within the namespace I would have obtained with frommodule import * For example if I write: def f(a):

Re: Question about name scope

2012-02-01 Thread Chris Rebert
On Wed, Feb 1, 2012 at 9:11 AM, Olive di...@bigfoot.com wrote: I am learning python and maybe this is obvious but I have not been able to see a solution. What I would like to do is to be able to execute a function within the namespace I would have obtained with  from module import * For

Re: changing sys.path

2012-02-01 Thread Andrea Crotti
On 02/01/2012 05:13 PM, Eric Snow wrote: On Wed, Feb 1, 2012 at 9:15 AM, Andrea Crottiandrea.crott...@gmail.com wrote: So suppose I want to modify the sys.path on the fly before running some code which imports from one of the modules added. at run time I do sys.path.extend(paths_to_add) but

Re: Question about name scope

2012-02-01 Thread Christian Heimes
Am 01.02.2012 18:36, schrieb Dave Angel: def f(a): from math import sin, cos return sin(a) + cos(a) print f(45) Does what you needed, and neatly. The only name added to the global namspace is f, of type function. I recommend against this approach. It's slightly slower and the

Re: changing sys.path

2012-02-01 Thread Rick Johnson
On Feb 1, 10:15 am, Andrea Crotti andrea.crott...@gmail.com wrote: So suppose I want to modify the sys.path on the fly before running some code which imports from one of the modules added. at run time I do sys.path.extend(paths_to_add) but it still doesn't work and I get an import error.

Re: python zipfile v. native unzip

2012-02-01 Thread Tim Chase
On 01/31/12 07:41, Jason Friedman wrote: Does Python 2.7's zipfile module use its own algorithm or does it leverage the zip/unzip libraries that exist on the host? I ask because my host's native unzip program cannot handle files that, when unzipped, are larger than 2GB. Will using Python 2.7

TypeError

2012-02-01 Thread Clark, Kathleen
Hello and thank you for all responses. I have resolved my problem. Turned out that one of the files was missing fn and after deleting the record, the program ran just fine. Thanks again, Katie -- http://mail.python.org/mailman/listinfo/python-list

Startup Chile Company Looking For Founding Developer/CTO

2012-02-01 Thread Jennifer Turliuk
Hi everyone, My name is Jennifer Turliuk. I'm currently in Santiago, Chile for the next 6 months as part of the Startup Chile program. I think you may be able to help me out. We are looking to bring on a developer ASAP (see description below). If you are interested, we'd love to hear from you.

Re: Question about name scope

2012-02-01 Thread Mel Wilson
Dave Angel wrote: I tried your experiment using Python 2.7 and Linux 11.04 def f(a): from math import sin, cos return sin(a) + cos(a) print f(45) Does what you needed, and neatly. The only name added to the global namspace is f, of type function. I was a bit surprised

PyDev 2.4.0 Released

2012-02-01 Thread Fabio Zadrozny
Hi All, PyDev 2.4.0 has been released Details on PyDev: http://pydev.org Details on its development: http://pydev.blogspot.com Release Highlights: --- PyDev is now faster and uses less memory (many performance and memory improvements were done)! The contents of the

Re: Disable use of pyc file with no matching py file

2012-02-01 Thread Terry Reedy
On 2/1/2012 6:14 AM, Devin Jeanpierre wrote: It really bothers me that you imagine that there are no other problems than the newness. And it bothers me that you imput such ignorance to me. You made what I think was a bad analogy and I made a better one of the same type, though still

Re: Disable use of pyc file with no matching py file

2012-02-01 Thread Terry Reedy
On 2/1/2012 8:11 AM, John Roth wrote: One other point: I'm unclear if a compiled module in the source directory would be named spam.pyc or spam.cpython-32.pyc. I'd think the latter to allow two versions of a compiled-only distribution. By test, it has to be spam.pyc, as before. -- Terry Jan

Re: Buffering in Wing and IDLE 3

2012-02-01 Thread Terry Reedy
On 2/1/2012 10:17 AM, Franck Ditter wrote: I would prefer to use IDLE but as we are in France, the Python team does not seem to be aware that the ~ and others are not available on MacOS-X here (probably the same in Europe)... We are quite aware of the problem but cannot directly do anything

Re: changing sys.path

2012-02-01 Thread Tim Delaney
On 2 February 2012 04:47, Andrea Crotti andrea.crott...@gmail.com wrote: Yes they are exactly the same, because in that file I just write exactly the same list, but when modifying it at run-time it doesn't work, while if at the application start there is this file everything works

Generator problem: parent class not seen

2012-02-01 Thread Russell E. Owen
I have an odd and very intermittent problem in Python script. Occasionally it fails with this error: Traceback (most recent call last): File /Applications/APO/TTUI.app/Contents/Resources/lib/python2.7/TUI/Base/Bas eFocusScript.py, line 884, in run File

Problem sending an email in html with mime image

2012-02-01 Thread Ariel
Hi everybody I have a question, here is my problem I want to send an email with content in html with an image embed so I converted the image binary in mime text and then I put the mime code inside the src attribute of the html like this: img class=logoe

Re: Patching CGIHTTPServer.py

2012-02-01 Thread Giovanni Funchal
Wow, that's very flattering :-) I've opened an item in the python bug tracker for this enhancement and attached my patch, let's see how it goes. Thanks, -- Giovanni On Sat, Jan 28, 2012 at 4:04 PM, Miki Tebeka miki.teb...@gmail.com wrote: IMO the code is good enough to submit a patch. --

Work from Home. Earn $2000/month. No Investment. Part Time, 1-2h/day.

2012-02-01 Thread businessmot...@hotmail.com
Work from Home. Earn $2000/month. No Investment. Part Time, 1-2h/day. Wanted Online Internet job workers. Job is only through Internet. Work from home part time jobs. You can earn $1500-2500/month working 1-2 hours/day, no matter where you live. These are genuine Data entry jobs Internet jobs.

Work from Home. Earn $2000/month. No Investment. Part Time, 1-2h/day.

2012-02-01 Thread businessmot...@hotmail.com
Work from Home. Earn $2000/month. No Investment. Part Time, 1-2h/day. Wanted Online Internet job workers. Job is only through Internet. Work from home part time jobs. You can earn $1500-2500/month working 1-2 hours/day, no matter where you live. These are genuine Data entry jobs Internet jobs.

Re: Question about name scope

2012-02-01 Thread Ian Kelly
On Wed, Feb 1, 2012 at 11:47 AM, Mel Wilson mwil...@the-wire.com wrote: I guess they want local symbols in functions to be pre-compiled.  Similar to the way you can't usefully update the dict returned by locals().  Strangely, I notice that Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)

Re: Generator problem: parent class not seen

2012-02-01 Thread Chris Rebert
On Wed, Feb 1, 2012 at 1:00 PM, Russell E. Owen ro...@uw.edu wrote: I have an odd and very intermittent problem in Python script. Occasionally it fails with this error: Traceback (most recent call last):  File /Applications/APO/TTUI.app/Contents/Resources/lib/python2.7/TUI/Base/Bas

Re: Question about name scope

2012-02-01 Thread Ian Kelly
On Wed, Feb 1, 2012 at 3:24 PM, Ethan Furman et...@stoneleaf.us wrote: Definitely should rely on it, because in CPython 3 exec does not un-optimize the function and assigning to locals() will not actually change the functions variables. Well, the former is not surprising, since exec was

Re: Question about name scope

2012-02-01 Thread Ethan Furman
Ian Kelly wrote: I am not a dev, but I believe it works because assigning to locals() and assigning via exec are not the same thing. The problem with assigning to locals() is that you're fundamentally just setting a value in a dictionary, and even though it happens to be the locals dict for the

Re: Question about name scope

2012-02-01 Thread Ian Kelly
On Wed, Feb 1, 2012 at 3:53 PM, Ethan Furman et...@stoneleaf.us wrote: -- def f(x, y): ...     locals()[x] = y ...     print(vars()) ...     exec('print (' + x + ')') ...     print(x) ... -- f('a', 42) {'y': 42, 'x': 'a', 'a': 42} 42 a Indeed -- the point to keep in mind is that

Re: Generator problem: parent class not seen

2012-02-01 Thread Russell Owen
On Feb 1, 2012, at 2:34 PM, Chris Rebert wrote: On Wed, Feb 1, 2012 at 1:00 PM, Russell E. Owen ro...@uw.edu wrote: I have an odd and very intermittent problem in Python script. Occasionally it fails with this error: Traceback (most recent call last): File

Re: Generator problem: parent class not seen

2012-02-01 Thread Peter Otten
Russell E. Owen wrote: I have an odd and very intermittent problem in Python script. Occasionally it fails with this error: Traceback (most recent call last): File /Applications/APO/TTUI.app/Contents/Resources/lib/python2.7/TUI/Base/Bas eFocusScript.py, line 884, in run File

Re: Generator problem: parent class not seen

2012-02-01 Thread Arnaud Delobelle
On Feb 1, 2012 9:01 PM, Russell E. Owen ro...@uw.edu wrote: I have an odd and very intermittent problem in Python script. Occasionally it fails with this error: Traceback (most recent call last): File /Applications/APO/TTUI.app/Contents/Resources/lib/python2.7/TUI/Base/Bas

Re: Question about name scope

2012-02-01 Thread Ethan Furman
Ethan Furman wrote: Ian Kelly wrote: I am not a dev, but I believe it works because assigning to locals() and assigning via exec are not the same thing. The problem with assigning to locals() is that you're fundamentally just setting a value in a dictionary, and even though it happens to be

Re: Buffering in Wing and IDLE 3

2012-02-01 Thread Kevin Walzer
On 2/1/12 3:01 PM, Terry Reedy wrote: On 2/1/2012 10:17 AM, Franck Ditter wrote: I would prefer to use IDLE but as we are in France, the Python team does not seem to be aware that the ~ and others are not available on MacOS-X here (probably the same in Europe)... We are quite aware of the

solutions manual

2012-02-01 Thread solutions for student
solutions for student solutions(dot)for(dot)student(at)hotmail(dot)com We're a team for providing solution manuals to help students in their study. We sell the books in a soft copy, PDF format. We will find any book or solution manual for you. Just email us: s o l u t i o n s . f o r . s t u

Re: Question about name scope

2012-02-01 Thread Ethan Furman
Ian Kelly wrote: On Wed, Feb 1, 2012 at 3:24 PM, Ethan Furman et...@stoneleaf.us wrote: Definitely should rely on it, because in CPython 3 exec does not un-optimize the function and assigning to locals() will not actually change the functions variables. Well, the former is not surprising,

Re: Question about name scope

2012-02-01 Thread Ian Kelly
On Wed, Feb 1, 2012 at 4:41 PM, Ethan Furman et...@stoneleaf.us wrote: I'm not sure what you mean by temporary: -- def f(x, y): ...     frob = None ...     loc = locals() ...     loc[x] = y ...     print(loc) ...     print(locals()) ...     print(loc) ...     print(locals()) ... --

solutions books

2012-02-01 Thread solutions for student
solutions for student solutions(dot)for(dot)student(at)hotmail(dot)com We're a team for providing solution manuals to help students in their study. We sell the books in a soft copy, PDF format. We will find any book or solution manual for you. Just email us: s o l u t i o n s . f o r . s t u

Re: Question about name scope

2012-02-01 Thread Ethan Furman
Ian Kelly wrote: On Wed, Feb 1, 2012 at 4:41 PM, Ethan Furman et...@stoneleaf.us wrote: I'm not sure what you mean by temporary: -- def f(x, y): ... frob = None ... loc = locals() ... loc[x] = y ... print(loc) ... print(locals()) ... print(loc) ... print(locals())

Re: Generator problem: parent class not seen

2012-02-01 Thread Russell Owen
On Feb 1, 2012, at 3:35 PM, Arnaud Delobelle wrote: On Feb 1, 2012 9:01 PM, Russell E. Owen ro...@uw.edu wrote: I have an odd and very intermittent problem in Python script. Occasionally it fails with this error: Traceback (most recent call last): File

Re: Registry entries set up by the Windows installer

2012-02-01 Thread Mark Hammond
On 2/02/2012 2:09 AM, Paul Moore wrote: I'm trying to get information on what registry entries are set up by the Python Windows installer, and what variations exist. I don't know enough about MSI to easily read the source, so I'm hoping someone who knows can help :-) As far as I can see on my

Re: Question about name scope

2012-02-01 Thread Ethan Furman
Ian Kelly wrote: Sure, but that's not actually out of sync. The argument of your exec evaluates to 'print (a)'. You get two different results because you're actually printing two different variables. Ah -- thanks, I missed that. You can get the dict temporarily out of sync: def f(x, y):

Re: TypeError

2012-02-01 Thread Steven D'Aprano
Hello Katie, When posting to technical news groups like this, can you please send plain text emails rather than so-called rich text (actually HTML code) email? Or at least, don't use Microsoft Word as your email editor. Many people will be reading your posts using text applications and will

Re: Question about name scope

2012-02-01 Thread Steven D'Aprano
On Wed, 01 Feb 2012 14:53:09 -0800, Ethan Furman wrote: Indeed -- the point to keep in mind is that locals() can become out of sync with the functions actual variables. Definitely falls in the camp of if you don't know *exactly* what you are doing, do not play this way! And if you *do* know

Re: Question about name scope

2012-02-01 Thread Ethan Furman
Ethan Furman wrote: Ethan Furman wrote: Ian Kelly wrote: I am not a dev, but I believe it works because assigning to locals() and assigning via exec are not the same thing. The problem with assigning to locals() is that you're fundamentally just setting a value in a dictionary, and even

Re: changing sys.path

2012-02-01 Thread Steven D'Aprano
On Wed, 01 Feb 2012 17:47:22 +, Andrea Crotti wrote: Yes they are exactly the same, because in that file I just write exactly the same list, but when modifying it at run-time it doesn't work, while if at the application start there is this file everything works correctly... That's

simple system for building packages for multiple platforms?

2012-02-01 Thread Dan Goodman
Hi all, Until recently, our package has been pure Python, so distributing it has been straightforward. Now, however, we want to add some extension modules in C++. We're happy to provide source only distributions on Linux because almost all Linux users will have all the required compilers and

Re: copy on write

2012-02-01 Thread John O'Hagan
On Fri, 13 Jan 2012 10:40:47 -0800 Ethan Furman et...@stoneleaf.us wrote: Steven D'Aprano wrote: Normally this is harmless, but there is one interesting little glitch you can get: t = ('a', [23]) t[1] += [42] Traceback (most recent call last): File stdin, line 1, in module

Re: copy on write

2012-02-01 Thread Rick Johnson
On Jan 13, 10:48 am, Devin Jeanpierre jeanpierr...@gmail.com wrote: On Fri, Jan 13, 2012 at 10:13 AM, Grant Edwards inva...@invalid.invalid wrote: On 2012-01-13, Devin Jeanpierre jeanpierr...@gmail.com wrote: On Fri, Jan 13, 2012 at 7:30 AM, Chris Angelico ros...@gmail.com wrote: There's a

Re: xhtml encoding question

2012-02-01 Thread Tim Arnold
On 2/1/2012 3:26 AM, Stefan Behnel wrote: Tim Arnold, 31.01.2012 19:09: I have to follow a specification for producing xhtml files. The original files are in cp1252 encoding and I must reencode them to utf-8. Also, I have to replace certain characters with html entities.

Re: copy on write

2012-02-01 Thread Steven D'Aprano
On Wed, 01 Feb 2012 19:51:13 -0800, Rick Johnson wrote: Yeah there's a word for that; INTUITIVE, And I've been preaching its virtues (sadly in vain it seems!) to these folks for some time now. Intuitive to whom? Expert Python programmers? VB coders? Perl hackers? School children who have

Re: copy on write

2012-02-01 Thread Devin Jeanpierre
On Wed, Feb 1, 2012 at 10:18 PM, John O'Hagan resea...@johnohagan.com wrote: On Fri, 13 Jan 2012 10:40:47 -0800 Ethan Furman et...@stoneleaf.us wrote: Steven D'Aprano wrote: Normally this is harmless, but there is one interesting little glitch you can get: t = ('a', [23]) t[1] +=

Re: Disable use of pyc file with no matching py file

2012-02-01 Thread Devin Jeanpierre
On Wed, Feb 1, 2012 at 2:53 PM, Terry Reedy tjre...@udel.edu wrote: And it bothers me that you imput such ignorance to me. You made what I think was a bad analogy and I made a better one of the same type, though still imperfect. I acknowledged that the transition will take years. Ah. It is a

Re: xhtml encoding question

2012-02-01 Thread Stefan Behnel
Tim Arnold, 01.02.2012 19:15: On 2/1/2012 3:26 AM, Stefan Behnel wrote: Tim Arnold, 31.01.2012 19:09: I have to follow a specification for producing xhtml files. The original files are in cp1252 encoding and I must reencode them to utf-8. Also, I have to replace certain characters with html

Re: How can I verify if the content of a variable is a list or a string?

2012-02-01 Thread Rainer Grimm
You can do it more concise. def isListOrString(p): ...return any((isinstance(p,list),isinstance(p,str))) ... listOrString(string) True listOrString([1,2,3]) True listOrString(2) False listOrString(False) False Rainer -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterate from 2nd element of a huge list

2012-02-01 Thread Paulo da Silva
Em 01-02-2012 04:55, Cameron Simpson escreveu: On 01Feb2012 03:34, Paulo da Silva p_s_d_a_s_i_l_...@netcabo.pt wrote: | BTW, iter seems faster than iterating thru mylist[1:]! I would hope the difference can be attributed to the cost of copying mylist[1:]. I don't think so. I tried several

Re: python reliability with EINTR handling in general modules

2012-02-01 Thread oleg korenevich
On Feb 1, 6:07 pm, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Wed, 1 Feb 2012 06:15:22 -0800 (PST), oleg korenevich void.of.t...@gmail.com wrote: I have linux board on samsung SoC s3c6410 (ARM11). I build rootfs with buildroot: Python 2.7.1, uClibc-0.9.31. Linux kernel: Linux

Re: How can I verify if the content of a variable is a list or a string?

2012-02-01 Thread Steven D'Aprano
On Wed, 01 Feb 2012 23:19:57 -0800, Rainer Grimm wrote: You can do it more concise. def isListOrString(p): ...return any((isinstance(p,list),isinstance(p,str))) Or even more concisely still: isinstance(p, (list, str)) -- Steven --

Re: Iterate from 2nd element of a huge list

2012-02-01 Thread Steven D'Aprano
On Thu, 02 Feb 2012 07:23:04 +, Paulo da Silva wrote: Em 01-02-2012 04:55, Cameron Simpson escreveu: On 01Feb2012 03:34, Paulo da Silva p_s_d_a_s_i_l_...@netcabo.pt wrote: | BTW, iter seems faster than iterating thru mylist[1:]! I would hope the difference can be attributed to the

[issue13734] Add a generic directory walker method to avoid symlink attacks

2012-02-01 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: I think the O(depth) version is fine. The O(1) version is quite more complicated, difficult to follow, and it seems less robust (it doesn't use try/finally and therefore might leak fds if the generator isn't exhausted before being

[issue13734] Add a generic directory walker method to avoid symlink attacks

2012-02-01 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I'm also a fan of using the simpler approach unless/until we have solid evidence that the file descriptor limit could be a problem in practice. A comment in the code mentioning the concern, along with the fact that there's an alternate

[issue13719] bdist_msi upload fails

2012-02-01 Thread Ralf Schmitt
Ralf Schmitt python-b...@systemexit.de added the comment: It's a bug in bdist_msi not in the upload command. You can check that distribution.dist_files point to valid files after running the command. -- ___ Python tracker rep...@bugs.python.org

[issue13917] Python 2.7.2 and 3.2.2 execl crash

2012-02-01 Thread Carlo Di Dato
New submission from Carlo Di Dato shin...@autistici.org: These lines make Python 2.7.2 and 3.2.2 crash import os os.execl(cmd.exe, ) Regards -- components: Windows messages: 152428 nosy: shinnai priority: normal severity: normal status: open title: Python 2.7.2 and 3.2.2 execl crash

[issue13917] Python 2.7.2 and 3.2.2 execl crash

2012-02-01 Thread Carlo Di Dato
Changes by Carlo Di Dato shin...@autistici.org: -- versions: +Python 3.2 -Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13917 ___ ___

[issue13917] Python 2.7.2 and 3.2.2 execl crash

2012-02-01 Thread Tim Golden
Tim Golden m...@timgolden.me.uk added the comment: This is a duplicate of http://bugs.python.org/issue8036 (which I still haven't got around to applying...) -- nosy: +tim.golden ___ Python tracker rep...@bugs.python.org

[issue13917] Python 2.7.2 and 3.2.2 execl crash

2012-02-01 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- resolution: - duplicate status: open - closed superseder: - Interpreter crashes on invalid arg to spawnl on Windows ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13917

[issue7856] cannot decode from or encode to big5 \xf9\xd8

2012-02-01 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +haypo versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7856 ___

[issue13918] locale.atof documentation is missing func argument

2012-02-01 Thread Cédric Krier
New submission from Cédric Krier cedric.kr...@b2ck.com: atof has a func argument used to instantiate the result but it is missing in the documentation. -- assignee: docs@python components: Documentation messages: 152430 nosy: ced, docs@python priority: normal severity: normal status:

[issue13868] Add hyphen doc fix

2012-02-01 Thread Boštjan Mejak
Boštjan Mejak bostjan.me...@gmail.com added the comment: Seriously, how old are you two clowns? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13868 ___

[issue13868] Add hyphen doc fix

2012-02-01 Thread Sandro Tosi
Sandro Tosi sandro.t...@gmail.com added the comment: On Wed, Feb 1, 2012 at 15:42, Boštjan Mejak rep...@bugs.python.org wrote: Seriously, how old are you two clowns? I think it's enough: FTR I'm +1 on removing Retro tracker account, effective immediately (if any admin is around). --

[issue12328] multiprocessing's overlapped PipeConnection on Windows

2012-02-01 Thread sbt
sbt shibt...@gmail.com added the comment: I have done an updated patch. (It does *not* switch to using bytes oriented pipes as I suggested in the previous message.) The patch also adds a wait() function with signature wait(object_list, timeout=None) for polling multiple objects at once.

[issue13868] Add hyphen doc fix

2012-02-01 Thread Boštjan Mejak
Boštjan Mejak bostjan.me...@gmail.com added the comment: Kiss my ball sac! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13868 ___ ___

[issue13919] kiss my ball sac

2012-02-01 Thread Boštjan Mejak
Changes by Boštjan Mejak bostjan.me...@gmail.com: -- assignee: docs@python components: Documentation nosy: Retro, docs@python priority: normal severity: normal status: open title: kiss my ball sac type: enhancement versions: Python 2.7 ___ Python

  1   2   >