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 >> wrote: > >> | BTW, iter seems faster than iterating thru mylist[1:]! >> >> I would hope the difference can be attributed to the cost of copying >>

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 -- http://mail.python.org/mailman/listinfo/pyt

Re: python reliability with EINTR handling in general modules

2012-02-01 Thread oleg korenevich
On Feb 1, 6:07 pm, Dennis Lee Bieber wrote: > On Wed, 1 Feb 2012 06:15:22 -0800 (PST), oleg korenevich > > > > > > > > > > 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 buildroot > >2.6.28.6 #177 Mon

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 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 times and the difference

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

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 charact

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

Re: copy on write

2012-02-01 Thread Devin Jeanpierre
On Wed, Feb 1, 2012 at 10:18 PM, John O'Hagan wrote: > On Fri, 13 Jan 2012 10:40:47 -0800 > Ethan Furman 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

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: 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 Rick Johnson
On Jan 13, 10:48 am, Devin Jeanpierre wrote: > On Fri, Jan 13, 2012 at 10:13 AM, Grant Edwards > wrote: > > On 2012-01-13, Devin Jeanpierre wrote: > >> On Fri, Jan 13, 2012 at 7:30 AM, Chris Angelico wrote: > There's a bit of a feeling > that code should "do what it looks like" and be sort of

Re: copy on write

2012-02-01 Thread John O'Hagan
On Fri, 13 Jan 2012 10:40:47 -0800 Ethan Furman 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 "", line 1, in > > TypeErro

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

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 though

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*

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 s

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

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" 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.a

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 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()) ... --> --> f('fro

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 Ian Kelly
On Wed, Feb 1, 2012 at 4:41 PM, Ethan Furman 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: Question about name scope

2012-02-01 Thread Ethan Furman
Ian Kelly wrote: On Wed, Feb 1, 2012 at 3:24 PM, Ethan Furman 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 changed

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

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 the

Re: Generator problem: parent class not seen

2012-02-01 Thread Arnaud Delobelle
On Feb 1, 2012 9:01 PM, "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",

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

Re: Question about name scope

2012-02-01 Thread Ian Kelly
On Wed, Feb 1, 2012 at 3:53 PM, Ethan Furman 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 locals(

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:24 PM, Ethan Furman 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 changed from a stateme

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

Re: Question about name scope

2012-02-01 Thread Ian Kelly
On Wed, Feb 1, 2012 at 11:47 AM, Mel Wilson 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) > [GCC 4.4.3] on lin

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

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

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 wrote: > IMO the code is good enough to submit a patch. > -- > http://mail.python.o

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: Then I send the email, here is my code: from django.templ

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 "/Applications/APO/TTUI.app/Contents/R

Re: changing sys.path

2012-02-01 Thread Tim Delaney
On 2 February 2012 04:47, 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 what r

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 ab

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 R

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 imperfec

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

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

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

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 ge

Re: changing sys.path

2012-02-01 Thread Rick Johnson
On Feb 1, 10:15 am, Andrea Crotti 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 I take these p

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 an

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

Re: Question about name scope

2012-02-01 Thread Chris Rebert
On Wed, Feb 1, 2012 at 9:11 AM, 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 > import * > > For example if I write: >

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 from import * For example if I write: def f(a): re

Re: TypeError

2012-02-01 Thread Nick Dokos
Clark, Kathleen 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 a string, but

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 import * For example if I write: def f(a): return sin(a)+cos(a) I c

Re: Question about name scope

2012-02-01 Thread Rick Johnson
On Feb 1, 11:11 am, Olive 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__'] >>> from

Re: Question about name scope

2012-02-01 Thread Chris Kaynor
On Wed, Feb 1, 2012 at 9:11 AM, 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 > import * > > For example if I write: >

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 n

Re: changing sys.path

2012-02-01 Thread jmfauth
On 1 fév, 17:15, Andrea Crotti 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 I take these path

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 import * For example if I write: def f(a): return sin(a)+cos(a) I could then do:

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

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 inse

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 sam

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: u"©", 0x2122: u"™"}) u'©™' Ye

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 everythi

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 Py

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

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 would

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 HKLM\Softwar

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

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 wrote: > On 1/31/2012 3:20 PM, John Roth wrote: > > > On Jan 30, 3:43 pm, Terry Reedy  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 corresponding .pyc fi

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

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 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 when it i

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

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 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") In Python 2, it'll say "type" not "class", but same diff. It tells you there what the type is.

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:'—', # 'EM DASH', >> 0x2013:'–', # 'EN DASH', >> 0x0160:'Š',# 'LATIN CAPITAL LETTER S WITH CARON', >> 0x201d:'”', # 'RIGHT DOUBLE QUOTATION MARK', >> 0x201c:'“', # 'LEFT DOUBLE QUOTATI

Re: Iterate from 2nd element of a huge list

2012-02-01 Thread Paul Rubin
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 process1 (mylist[0]) for el in i

Re: xhtml encoding question

2012-02-01 Thread Ulrich Eckhardt
Am 31.01.2012 19:09, schrieb Tim Arnold: high_chars = { 0x2014:'—', # 'EM DASH', 0x2013:'–', # 'EN DASH', 0x0160:'Š',# 'LATIN CAPITAL LETTER S WITH CARON', 0x201d:'”', # 'RIGHT DOUBLE QUOTATION MARK', 0x201c:'“', # 'LEFT DOUBLE QUOTATION MARK', 0x2019:"’", # 'RIGHT SINGLE

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

Re: Installing pypi package twice

2012-02-01 Thread Ben Finney
Jason Friedman 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, but that has not be

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