Python Ireland presents December Talks @ The Science Gallery

2010-10-08 Thread Vicky Twomey-Lee
Hi All, When: Wed 8th December, 19:00-20:00 Where: The Science Gallery What: - Microsoft Openness Campaign by Liam Cronin - Windows Azure -- The Nuts and Bolts by Stephen Fitzmaurice - Pub - Trinity Capital Hotel More info: http://www.python.ie/meetup/2010/dec_2010_talks__the_science_gallery/

[Venue Update] Python Ireland's Oct Talks - Wed 13th Oct, 19:00

2010-10-08 Thread Vicky Twomey-Lee
Hi All, Apologies in advance, the venue for October talks is now at The Central Hotel on Exchequer Street. The Science Gallery is closed due to construction of their next exhibition. I've added the update event on the site: http://www.python.ie/meetup/2010/oct_2010_talks__the_central_hotel/

ANN: Roundup Issue Tracker 1.4.16 released

2010-10-08 Thread Richard Jones
I'm proud to release version 1.4.16 of Roundup which introduces some minor features and, as usual, fixes some bugs: Features: - allow trackers to override the classes used to render properties in templating per issue2550659 (thanks Ezio Melotti) - new mailgw configuration item

[Ann] Celery 2.1 stable released

2010-10-08 Thread Ask Solem
Hey! Celery 2.1.0 was just uploaded to PyPI! This is a backward compatible release in the 2.x series, and is an recommended upgrade for all users. What is Celery? Celery is an open source asynchronous task queue/job queue based on distributed message passing. It is focused on

Evolutionary Algorithms in Python (EAP) First Public Release (0.6)

2010-10-08 Thread Félix-Antoine Fortin
Hi everyone, We are proud to announce the first public release of EAP, a library for doing Evolutionary Algorithms in Python. You can download a copy of this open source project at the following web page. http://deap.googlecode.com EAP has been built using the Python and UNIX programming

Re: del() function - cannot find documentation

2010-10-08 Thread Tim Roberts
Chris Rebert c...@rebertia.com wrote: On Thu, Oct 7, 2010 at 1:12 PM, mafeu...@gmail.com wrote: there is following python script: mine = { 1: sd, 2: mk } del(mine[1]) print mine the problem is I cannot find any information about del() function in python 2.7 documentation. is it a

Re: frozendict (v0.1)

2010-10-08 Thread Arnaud Delobelle
kj no.em...@please.post writes: In 87hbgxlk67@gmail.com Arnaud Delobelle arno...@gmail.com writes: A simple fix is to use hash(frozenset(self.items())) instead. Thanks for pointing out the hash bug. It was an oversight: I meant to write def __hash__(self): return

Re: harmful str(bytes)

2010-10-08 Thread Antoine Pitrou
On Thu, 07 Oct 2010 23:33:35 +0200 Hallvard B Furuseth h.b.furus...@usit.uio.no wrote: The offender is bytes.__str__: str(b'foo') == b'foo'. It's often not clear from looking at a piece of code whether some data is treated as strings or bytes, particularly when translating from old code.

Re: [Python-ideas] [Python-Dev] Inclusive Range

2010-10-08 Thread Antoon Pardon
On Wed, Oct 06, 2010 at 05:28:13PM -0400, Terry Reedy wrote: On 10/6/2010 7:14 AM, Antoon Pardon wrote: That right-hand-half-open intervals (i.e. a= i b, equivalently [a, b) ), which are what Python uses, are to be preferred. (See aforelinked PDF:

Re: add bitbucket repo url to install_requires

2010-10-08 Thread Chris Withers
On 05/10/2010 12:43, Julian wrote: I'm developing a django app which depends on an app in a private bitbucket repository, for example ssh://h...@bitbucket.org/username/my-django-app. is it possible to add this url to the list of install_requires in my setup.py? tried various possibilities, but

Re: Many newbie questions regarding python

2010-10-08 Thread Jean-Michel Pichavant
Rogério Brito wrote: class C: f = 1 def g(self): return f I get an annoying message when I try to call the g method in an object of type C, telling me that there's no global symbol called f. If I make g return self.f instead, things work as expected, but the code loses some

Re: frozendict (v0.1)

2010-10-08 Thread Jonas H.
On 10/08/2010 02:23 AM, kj wrote: I imagine that frozenset is better than sorted(tuple(...)) here, but it's not obvious to me why. dicts are unsorted. That means their item-order is undefined. So are sets. If you want a hash that is independent from the order of items, you could ensure the

Re: frozendict (v0.1)

2010-10-08 Thread kj
In 4cae667c$0$29993$c3e8da3$54964...@news.astraweb.com Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Fri, 08 Oct 2010 00:23:30 +, kj wrote: Because it's always better to use a well-written, fast, efficient, correct, well-tested wheel than to invent your own slow,

Re: Many newbie questions regarding python

2010-10-08 Thread BartC
Rogério Brito rbr...@ime.usp.br wrote in message news:i8lk0n$g3...@speranza.aioe.org... My first try to write it in Python was something like this: v = [] for i in range(20): v[i] = 0 Unfortunately, this doesn't work, as I get an index out of bounds when trying to index the v list.

Re: frozendict (v0.1)

2010-10-08 Thread kj
In 878w29kxjp@gmail.com Arnaud Delobelle arno...@gmail.com writes: E.g., try with {1:'a', 1j:'b'} I see. Thanks for this clarification. I learned a lot from it. I guess that frozenset must have some way of canonicalizing the order of its elements that is dependent on their Python values

Re: harmful str(bytes)

2010-10-08 Thread Hallvard B Furuseth
Arnaud Delobelle writes: Hallvard B Furuseth h.b.furus...@usit.uio.no writes: I've been playing a bit with Python3.2a2, and frankly its charset handling looks _less_ safe than in Python 2. (...) With 2.late conversion Unicode - string the equivalent operation did not silently produce garbage:

Re: mantissa and exponent in base 10

2010-10-08 Thread C or L Smith
Jason Swails wrote: s = ('%%%ig' % sigfigs) % n # double-% cancels the % Thanks! I see that the parenthesis can be dropped, too: '%%.%ig' % 3 % 4.23456e-5 '4.23e-05' /c -- http://mail.python.org/mailman/listinfo/python-list

Re: harmful str(bytes)

2010-10-08 Thread Hallvard B Furuseth
Antoine Pitrou writes: Hallvard B Furuseth h.b.furus...@usit.uio.no wrote: The offender is bytes.__str__: str(b'foo') == b'foo'. It's often not clear from looking at a piece of code whether some data is treated as strings or bytes, particularly when translating from old code. Which means one

Re: frozendict (v0.1)

2010-10-08 Thread Jonas H.
On 10/08/2010 03:27 PM, kj wrote: I tried to understand this by looking at the C source but I gave up after 10 fruitless minutes. (This has been invariably the outcome of all my attempts at finding my way through the Python C source.) It's not you. CPython's code is ... [censored] Anyway,

Re: frozendict (v0.1)

2010-10-08 Thread kj
In i8loa2$3o...@reader1.panix.com kj no.em...@please.post writes: At any rate, using your [i.e. Arnaud's] suggestions in this and your other post, the current implementation of frozendict stands at: class frozendict(dict): for method in ('__delitem__ __setitem__ clear pop popitem setdefault

Re: frozendict (v0.1)

2010-10-08 Thread kj
In mailman.1461.1286539843.29448.python-l...@python.org Jonas H. jo...@lophus.org writes: On 10/08/2010 02:23 AM, kj wrote: Here's my implementation suggestion: class frozendict(dict): def _immutable_error(self, *args, **kwargs): raise TypeError(%r object is immutable %

Re: frozendict (v0.1)

2010-10-08 Thread kj
In mailman.1463.1286546684.29448.python-l...@python.org Jonas H. jo...@lophus.org writes: Hope this helps :-) It did! Thanks! For one thing now I see that I was barking up the wrong tree in focusing on a canonical order, when, as the code you posted shows, it is actually not required for

Help with pointers when calling from python to C

2010-10-08 Thread Carolyn MacLeod
Hi. This is kind of a cross-product question, having to do with accessibility on Linux using ATK (AT-SPI). However, I think it really boils down to a python question: How do I pass an integer by reference to a C function? I am using Accerciser (http://live.gnome.org/Accerciser), an

Re: Help with pointers when calling from python to C

2010-10-08 Thread Jonas H.
On 10/08/2010 05:23 PM, Carolyn MacLeod wrote: How do I pass an integer by reference to a C function? That's impossible in pure Python. The only thing I can think of is a wrapper in C. -- http://mail.python.org/mailman/listinfo/python-list

Re: Many newbie questions regarding python

2010-10-08 Thread Tim Harig
On 2010-10-08, BartC b...@freeuk.com wrote: Rogério Brito rbr...@ime.usp.br wrote in message news:i8lk0n$g3...@speranza.aioe.org... If possible, I would like to simply declare the list and fill it latter in my program, as lazily as possible (this happens notoriously when one is using a

Re: Eclipse/PyDev - BOM Lexical Error

2010-10-08 Thread Ethan Furman
Lawrence D'Oliveiro wrote: In message 87hbgyosdc@web.de, Diez B. Roggisch wrote: Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: In message 87d3rorf2f@web.de, Diez B. Roggisch wrote: Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: What exactly is the

Re: Many newbie questions regarding python

2010-10-08 Thread Grant Edwards
On 2010-10-07, Rog??rio Brito rbr...@ime.usp.br wrote: If possible, I would like to simply declare the list and fill it latter in my program, as lazily as possible (this happens notoriously when one is using a technique of programming called dynamic programming where initializing all

Re: frozendict (v0.1)

2010-10-08 Thread Steven D'Aprano
On Fri, 08 Oct 2010 12:10:50 +, kj wrote: In 4cae667c$0$29993$c3e8da3$54964...@news.astraweb.com Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Fri, 08 Oct 2010 00:23:30 +, kj wrote: Because it's always better to use a well-written, fast, efficient, correct,

Re: Many newbie questions regarding python

2010-10-08 Thread Grant Edwards
On 2010-10-08, Grant Edwards inva...@invalid.invalid wrote: On 2010-10-07, Rog??rio Brito rbr...@ime.usp.br wrote: If possible, I would like to simply declare the list and fill it latter in my program, as lazily as possible (this happens notoriously when one is using a technique of

Re: Many newbie questions regarding python

2010-10-08 Thread Grant Edwards
On 2010-10-08, Grant Edwards inva...@invalid.invalid wrote: On 2010-10-08, Grant Edwards inva...@invalid.invalid wrote: On 2010-10-07, Rog??rio Brito rbr...@ime.usp.br wrote: If possible, I would like to simply declare the list and fill it latter in my program, as lazily as possible (this

Re: frozendict (v0.1)

2010-10-08 Thread Steven D'Aprano
On Fri, 08 Oct 2010 14:00:17 +, kj wrote: In i8loa2$3o...@reader1.panix.com kj no.em...@please.post writes: At any rate, using your [i.e. Arnaud's] suggestions in this and your other post, the current implementation of frozendict stands at: class frozendict(dict): for method in

Re: [Python-ideas] [Python-Dev] Inclusive Range

2010-10-08 Thread Steven D'Aprano
On Fri, 08 Oct 2010 10:21:16 +0200, Antoon Pardon wrote: Personnaly I find it horrible that in the following expression: L[a:b:-1], it is impossible to give a numeric value to b, that will include L[0] into the reversed slice. L = [1, 2, 3, 4, 5] L[5:-6:-1] [5, 4, 3, 2, 1] -- Steven

Re: harmful str(bytes)

2010-10-08 Thread Steven D'Aprano
On Fri, 08 Oct 2010 15:31:27 +0200, Hallvard B Furuseth wrote: Arnaud Delobelle writes: Hallvard B Furuseth h.b.furus...@usit.uio.no writes: I've been playing a bit with Python3.2a2, and frankly its charset handling looks _less_ safe than in Python 2. (...) With 2.late conversion Unicode -

Re: Many newbie questions regarding python

2010-10-08 Thread Emile van Sebille
On 10/8/2010 10:15 AM Grant Edwards said... Damn. I should give up and go golfing. +1 QOTW Emile -- http://mail.python.org/mailman/listinfo/python-list

PYTHON

2010-10-08 Thread k..........
PLEASE LEARN ME PYTHON -- http://mail.python.org/mailman/listinfo/python-list

Re: PYTHON

2010-10-08 Thread Seebs
On 2010-10-08, k.. m.51ah...@gmail.com wrote: PLEASE LEARN ME PYTHON Done! Please be sure to drop by sometimes to let us know how it's going, now that we've learned you Python. -s -- Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nos...@seebs.net

Re: if the else short form

2010-10-08 Thread NevilleDNZ
On Oct 7, 9:23 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: x = {1 : One, 2 : Two, 3 : Three}.get(i, None Of The Above) More like: x = {1:lambda:One, 2:lambda:Two, 3:lambda:Three}.get(i, lambda:None Of The Above)() i.e. deferred evaluation of selected case. In Algol68 this

Re: Many newbie questions regarding python

2010-10-08 Thread gregf...@gmail.com
On Oct 7, 6:10 pm, Rogério Brito rbr...@ime.usp.br wrote: Hi there. I am used to some languages like C, but I am just a complete newbie with Python and, while writing some small snippets, I had encountered some problems, with which I would sincerely appreciate any help, since I appreciate

Re: if the else short form

2010-10-08 Thread NevilleDNZ
On Oct 7, 10:36 am, BartC b...@freeuk.com wrote: i=16 x = {1 : fna(), 2 : fnb(), 3 : fnc()}.get(i, None Of The Above) print x Other than efficiency concerns, sometimes you don't want the extra side-effects. Probably there are workarounds here too, but I suspect the syntax won't be quite

open file on mac

2010-10-08 Thread tinauser
hi, sorry if it is a stupid qustio,but i cannot figure out where's the problem. i've a simpleModule: class Starter: def init(self,num): print hithere! print the answer is ,num import sys,os print path:,sys.path try: #f =

Re: Many newbie questions regarding python

2010-10-08 Thread alex23
On Oct 8, 10:27 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote:     v = [0 for i in range(20)] Absolutely not. Such a code snippet is very common, in fact I've done it myself, but it is a hammer solution -- to a small boy with a hammer, everything looks like a nail that

Re: SysLogHandler message formatting

2010-10-08 Thread Dustin C. Hatch
On Oct 7, 6:18 am, Vinay Sajip vinay_sa...@yahoo.co.uk wrote: Thanks for the detailed report. I tried posting a response a couple of times, but Google appears to have swallowed it ... trying again. Sorry if it results in multiple responses. I tried to respond yesterday, but I also noticed

google.com/trends

2010-10-08 Thread pooja kavala
google.com/trends -- http://mail.python.org/mailman/listinfo/python-list

Re: Many newbie questions regarding python

2010-10-08 Thread nn
On Oct 7, 7:10 pm, Rogério Brito rbr...@ime.usp.br wrote: Hi there. I am used to some languages like C, but I am just a complete newbie with Python and, while writing some small snippets, I had encountered some problems, with which I would sincerely appreciate any help, since I appreciate

Re: Simple database explorer

2010-10-08 Thread dusans
On Oct 7, 7:49 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 21c99273-ed58-4f93-b98a-d9292de5d...@k10g2000yqa.googlegroups.com, dusans wrote:  - all the others having ODBC drivers... ODBC seems to be something you use when you can’t use a proper database

Re: pywebkit - python bindings for webkit DOM (alpha)

2010-10-08 Thread lkcl
apologies for the 3 copies of the post: mail.python.org's SMTP service was offline yesterday. just a quick update: XMLHttpRequest support has been fixed today, and the correct version of libsoup discovered which actually works. that puts PythonWebkit into a useful and useable state, despite

HI... WE R HOT COUPLES AND SEARCHING FOR HOT MAN, WOMAN OR COUPLES FOR REAL FUN

2010-10-08 Thread COUPLES FOR FUN
HI... WE R HOT COUPLES AND SEARCHING FOR HOT MAN, WOMAN OR COUPLES FOR REAL FUN JUST CLICK... http://adultfriendfinder.com/go/page/reg_form_video_03?pid=g1250650-ppc http://adultfriendfinder.com/go/page/reg_form_video_03?pid=g1250650-ppc

Re: SysLogHandler message formatting

2010-10-08 Thread Dustin C. Hatch
On Oct 7, 6:18 am, Vinay Sajip vinay_sa...@yahoo.co.uk wrote: Thanks for the detailed report. I tried posting a response a couple of times, but Google appears to have swallowed it ... trying again. Sorry if it results in multiple responses. Hmm, I too seem to be experiencing this problem...

Sys.exit in secondary threads

2010-10-08 Thread Pakal
I've noticed that there is nothing in python's documentation regarding the use of sys.exit(code) in a non-main thread. As far as I've seen, the behaviour in this case is to simply exit the thread, without caring about the return code. in the main thread however, the return code becomes the

open file on mac

2010-10-08 Thread tinauser
hallo, i'm sorry if the question is very stupid, but i cannot understand what i'm doing wrong here. i have this myModule.py code class Starter: def init(self,num): print hithere! print the answer is ,num import sys,os print path:,sys.path print bye

Re: ConFoo spam?

2010-10-08 Thread Raymond Hettinger
On Oct 7, 10:01 am, Jack Diederich jackd...@gmail.com [For the record ConFoo /does/ interest me, but I can't take a week and a half off to do that plus PyCon]. CooFoo is an excellent conference. Even in the non-python tracks, there are plenty of high quality talks that would be of interest to

Unicode Support in Ruby, Perl, Python, Emacs Lisp

2010-10-08 Thread Xah Lee
here's my experiences dealing with unicode in various langs. Unicode Support in Ruby, Perl, Python, Emacs Lisp Xah Lee, 2010-10-07 I looked at Ruby 2 years ago. One problem i found is that it does not support Unicode well. I just checked today, it still doesn't. Just do a web search on blog and

Re: frozendict (v0.1)

2010-10-08 Thread Arnaud Delobelle
kj wrote: In 878w29kxjp@gmail.com Arnaud Delobelle arno...@gmail.com writes: E.g., try with {1:'a', 1j:'b'} I see. Thanks for this clarification. I learned a lot from it. I guess that frozenset must have some way of canonicalizing the order of its elements that is dependent on

Re: Many newbie questions regarding python

2010-10-08 Thread Andreas Waldenburger
On Thu, 7 Oct 2010 18:34:58 -0700 (PDT) alex23 wuwe...@gmail.com wrote: On Oct 8, 10:27 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote:     v = [0 for i in range(20)] Absolutely not. Such a code snippet is very common, in fact I've done it myself, but it is a hammer

how to handle network failures

2010-10-08 Thread harryos
hi I am trying to write a DataGrabber which reads some data from given url..I made DataGrabber as a Thread and want to wait for some interval of time in case there is a network failure that prevents read(). I am not very sure how to implement this class DataGrabber(threading.Thread): def

Re: Ordering tests in a testsuite

2010-10-08 Thread Mike Kent
But sometimes you just wanna do it the way you wanna do it. If you name your tests like 'test_01_yadda' and test_02_whatever', then they will be run in the order you want, as given by the numbers. -- http://mail.python.org/mailman/listinfo/python-list

Re: open file on mac

2010-10-08 Thread Andreas Waldenburger
On Fri, 8 Oct 2010 07:16:13 -0700 (PDT) tinauser tinau...@libero.it wrote: on mac I get an error if i do not give the full path of initfile.py (commented out in the code above); on windows i did not have this problem. Am I missing anything? open(initfile.py) opens initfile.py in the current

Re: open file on mac

2010-10-08 Thread Emile van Sebille
On 10/8/2010 7:16 AM tinauser said... hi, sorry if it is a stupid qustio,but i cannot figure out where's the problem. i've a simpleModule: class Starter: def init(self,num): print hithere! print the answer is ,num import sys,os print path:,sys.path

Re: harmful str(bytes)

2010-10-08 Thread Hallvard B Furuseth
Steven D'Aprano writes: On Fri, 08 Oct 2010 15:31:27 +0200, Hallvard B Furuseth wrote: That's not the point - the point is that for 2.* code which _uses_ str vs unicode, the equivalent 3.* code uses str vs bytes. Yet not the same way - a 2.* 'str' will sometimes be 3.* bytes, sometime str. So

Re: open file on mac

2010-10-08 Thread Jason Swails
On Fri, Oct 8, 2010 at 10:16 AM, tinauser tinau...@libero.it wrote: hi, sorry if it is a stupid qustio,but i cannot figure out where's the problem. i've a simpleModule: class Starter: def init(self,num): If you want this to execute upon declaring an instance of Starter, rename this as

Re: SysLogHandler message formatting

2010-10-08 Thread Dustin C. Hatch
On Oct 7, 6:18 am, Vinay Sajip vinay_sa...@yahoo.co.uk wrote: Thanks for the detailed report. I tried posting a response a couple of times, but Google appears to have swallowed it ... trying again. Sorry if it results in multiple responses. Hmm, I too seem to be experiencing this problem...

Re: open file on mac

2010-10-08 Thread Jason Swails
On Fri, Oct 8, 2010 at 3:39 PM, Jason Swails jason.swa...@gmail.com wrote: On Fri, Oct 8, 2010 at 10:16 AM, tinauser tinau...@libero.it wrote: hi, sorry if it is a stupid qustio,but i cannot figure out where's the problem. i've a simpleModule: class Starter: def init(self,num): If

question about a program

2010-10-08 Thread Logan Butler
question about an assignment: places(home sweet home is here,' ') [4, 10, 15, 18] this is my code: def places(x, y): return [x.index(y) for v in x if (v == y)] so far I'm only getting [4, 4, 4, 4] so the first value is correct, it is just not iterating on to the next three items it needs

Re: Many newbie questions regarding python

2010-10-08 Thread Carl Banks
On Oct 7, 4:10 pm, Rogério Brito rbr...@ime.usp.br wrote: [snip]     v = [0 for i in range(20)]     v = [0] * 20     v = []     for i in range(20): v.append(0) What should I prefer? Any other alternative? The Pythonic way is to not to preinitialize the list at all. Don't put anything in

Re: question about a program

2010-10-08 Thread Andreas Waldenburger
On Thu, 7 Oct 2010 17:39:51 -0700 (PDT) Logan Butler killable1...@gmail.com wrote: question about an assignment: places(home sweet home is here,' ') [4, 10, 15, 18] this is my code: def places(x, y): return [x.index(y) for v in x if (v == y)] so far I'm only getting [4, 4, 4,

Re: [Python-ideas] [Python-Dev] Inclusive Range

2010-10-08 Thread Jed Smith
On Fri, Oct 8, 2010 at 1:26 PM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Fri, 08 Oct 2010 10:21:16 +0200, Antoon Pardon wrote: Personnaly I find it horrible that in the following expression: L[a:b:-1], it is impossible to give a numeric value to b, that will include L[0]

Re: question about a program

2010-10-08 Thread Richard Thomas
On Oct 8, 1:39 am, Logan Butler killable1...@gmail.com wrote: question about an assignment: places(home sweet home is here,' ') [4, 10, 15, 18] this is my code: def places(x, y):     return [x.index(y) for v in x if (v == y)] so far I'm only getting [4, 4, 4, 4] so the first value

Re: Opening a webpage in the background via webbrowser.open()

2010-10-08 Thread Vlastimil Brom
2010/10/7 pyt...@bdurham.com: Python 2.7 (32-bit/Windows): Is there a way to use webbrowser.open() to open a web page in the default browser, but in the background, so that the application making the webbrowser.open() call remains the active application? Thank you, Malcolm --

Re: [Python-ideas] [Python-Dev] Inclusive Range

2010-10-08 Thread Hallvard B Furuseth
Jed Smith j...@jedsmith.org writes: a = [1, 2, 3, 4, 5, 6] a[::-1] [6, 5, 4, 3, 2, 1] Nice. Is there a trick to get a -0 index too? Other than doing 'i or len(L)' instead of 'i', that is. L = [1,2,3,4,5] L[2:-2], L[2:-1], L[2:-0] # not quite right:-) ([3], [3, 4], []) -- Hallvard --

Re: [Python-ideas] [Python-Dev] Inclusive Range

2010-10-08 Thread Arnaud Delobelle
Jed Smith j...@jedsmith.org writes: On Fri, Oct 8, 2010 at 1:26 PM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Fri, 08 Oct 2010 10:21:16 +0200, Antoon Pardon wrote: Personnaly I find it horrible that in the following expression: L[a:b:-1], it is impossible to give a

Re: [Python-ideas] [Python-Dev] Inclusive Range

2010-10-08 Thread Arnaud Delobelle
Hallvard B Furuseth h.b.furus...@usit.uio.no writes: Jed Smith j...@jedsmith.org writes: a = [1, 2, 3, 4, 5, 6] a[::-1] [6, 5, 4, 3, 2, 1] Nice. Is there a trick to get a -0 index too? Other than doing 'i or len(L)' instead of 'i', that is. L = [1,2,3,4,5] L[2:-2], L[2:-1], L[2:-0] #

Re: open file on mac

2010-10-08 Thread Brian Jones
On Fri, Oct 8, 2010 at 10:41 AM, tinauser tinau...@libero.it wrote: hallo, i'm sorry if the question is very stupid, but i cannot understand what i'm doing wrong here. i have this myModule.py code class Starter: def init(self,num): print hithere! print the answer is ,num

Re: harmful str(bytes)

2010-10-08 Thread Antoine Pitrou
On Fri, 08 Oct 2010 15:45:58 +0200 Hallvard B Furuseth h.b.furus...@usit.uio.no wrote: Antoine Pitrou writes: Hallvard B Furuseth h.b.furus...@usit.uio.no wrote: The offender is bytes.__str__: str(b'foo') == b'foo'. It's often not clear from looking at a piece of code whether some data is

Re: [Python-ideas] [Python-Dev] Inclusive Range

2010-10-08 Thread Terry Reedy
On 10/8/2010 4:21 AM, Antoon Pardon wrote: On Wed, Oct 06, 2010 at 05:28:13PM -0400, Terry Reedy wrote: Strings and tuples are not natural numbers, but do have least members ('' and ()), so the bottom end had better be closed. Why? Because otherwise one can never include the least member

Re: Sys.exit in secondary threads

2010-10-08 Thread Ned Deily
In article d841072f-5bad-4b2c-ba14-977b77645...@a15g2000yqm.googlegroups.com, Pakal chambon.pas...@gmail.com wrote: I've noticed that there is nothing in python's documentation regarding the use of sys.exit(code) in a non-main thread. As far as I've seen, the behaviour in this case is to

Re: if the else short form

2010-10-08 Thread BartC
NevilleDNZ neville...@gmail.com wrote in message news:ad9841df-49a1-4c1b-95d0-e76b72df6...@w9g2000prc.googlegroups.com... On Oct 7, 9:23 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: x = {1 : One, 2 : Two, 3 : Three}.get(i, None Of The Above) More like: x =

Re: question about a program

2010-10-08 Thread Chris Rebert
On Thu, Oct 7, 2010 at 5:39 PM, Logan Butler killable1...@gmail.com wrote: question about an assignment: places(home sweet home is here,' ') [4, 10, 15, 18] this is my code: def places(x, y):    return [x.index(y) for v in x if (v == y)] so far I'm only getting [4, 4, 4, 4] so the

Unicode Decode Error

2010-10-08 Thread Pratik Khemka
UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position 152: ordinal not in range(128). Can someone please help me with this error The error occurs in line wbk.save(p4_merge.xls). I have used import xlwt..Can someone just tell what do I need to do to get rid of this error. I read

Re: harmful str(bytes)

2010-10-08 Thread Terry Reedy
On 10/8/2010 9:45 AM, Hallvard B Furuseth wrote: Actually, the implicit contract of __str__ is that it never fails, so that everything can be printed out (for debugging purposes, etc.). Nope: $ python2 -c 'str(u\u1000)' Traceback (most recent call last): File string, line 1, in ?

Re: harmful str(bytes)

2010-10-08 Thread Terry Reedy
On 10/8/2010 9:31 AM, Hallvard B Furuseth wrote: That's not the point - the point is that for 2.* code which _uses_ str vs unicode, the equivalent 3.* code uses str vs bytes. Yet not the same way - a 2.* 'str' will sometimes be 3.* bytes, sometime str. So upgraded old code will have to expect

script in Linux vs Windows

2010-10-08 Thread aurfalien
Hi all, Unsure how to deal with what appears to be \n vs \r issues. The following code works in Linux; o = open(axenfs.reg) n = open(axenfs2.reg, a) while 1: line = o.readline() if not line: break line = line.replace(dword:0,dword:044e) n.write(line) n.close() But in Windows,

Re: Simple database explorer

2010-10-08 Thread Martin Gregorie
On Fri, 08 Oct 2010 02:04:39 -0700, dusans wrote: On Oct 7, 7:49 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 21c99273-ed58-4f93-b98a-d9292de5d...@k10g2000yqa.googlegroups.com, dusans wrote:  - all the others having ODBC drivers... ODBC seems to be

Re: [Python-Dev] Inclusive Range

2010-10-08 Thread Ian
On Oct 8, 3:05 pm, Terry Reedy tjre...@udel.edu wrote: doesn't imply that the sequence I need is easiest defined by using aninclusivelower limit. What if I wanted all none-empty strings/tuples keys in the tree? Use 'a' as the lower bound, it being the string that follows ''. No, that

Re: Unicode Decode Error

2010-10-08 Thread Chris Rebert
On Fri, Oct 8, 2010 at 2:31 PM, Pratik Khemka pratikkhe...@hotmail.com wrote: UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position 152: ordinal not in range(128). Can someone please help me with  this error The error occurs in line wbk.save(p4_merge.xls). I have used import 

Re: Unicode Decode Error

2010-10-08 Thread Ian Kelly
On Fri, Oct 8, 2010 at 3:31 PM, Pratik Khemka pratikkhe...@hotmail.comwrote: *UnicodeDecodeError: 'ascii' codec can't decode byte 0x92 in position 152: ordinal not in range(128)*. Can someone please help me with this error The error occurs in line *wbk.save(p4_merge.xls)*. I have used *

script in Linux vs Windows

2010-10-08 Thread aurfalien
Hi all, Unsure how to deal with what appears to be \n vs \r issues. The following code works in Linux; o = open(axenfs.reg) n = open(axenfs2.reg, a) while 1: line = o.readline() if not line: break line = line.replace(dword:0,dword:044e) n.write(line) n.close() But in Windows, its

Re: question about a program

2010-10-08 Thread Andreas Waldenburger
On Fri, 8 Oct 2010 14:34:21 -0700 Chris Rebert c...@rebertia.com wrote: On Thu, Oct 7, 2010 at 5:39 PM, Logan Butler killable1...@gmail.com wrote: question about an assignment: places(home sweet home is here,' ') [4, 10, 15, 18] this is my code: def places(x, y):    return

Re: script in Linux vs Windows

2010-10-08 Thread Ian Kelly
On Fri, Oct 8, 2010 at 3:52 PM, aurfal...@gmail.com wrote: Hi all, Unsure how to deal with what appears to be \n vs \r issues. The following code works in Linux; o = open(axenfs.reg) n = open(axenfs2.reg, a) while 1: line = o.readline() if not line: break line =

Re: Opening a webpage in the background via webbrowser.open()

2010-10-08 Thread Tim Chase
On 10/08/10 15:11, Vlastimil Brom wrote: webbrowser.open(url[, new=0[, autoraise=True]]) however, the sidenote in the docs also seems to apply: If autoraise is True, the window is raised if possible (note that under many window managers this will occur regardless of the setting of this

Re: Help with sets

2010-10-08 Thread Gregory Ewing
Lawrence D'Oliveiro wrote: Did you know that applying the “set” or “frozenset” functions to a dict return a set of its keys? Seems a bit dodgy, somehow. That's just a consequence of the fact that dicts produce their keys when iterated over, and the set constructor iterates over whatever

Re: script in Linux vs Windows

2010-10-08 Thread MRAB
On 08/10/2010 22:52, aurfal...@gmail.com wrote: Hi all, Unsure how to deal with what appears to be \n vs \r issues. The following code works in Linux; o = open(axenfs.reg) n = open(axenfs2.reg, a) while 1: line = o.readline() if not line: break line =

Re: script in Linux vs Windows

2010-10-08 Thread aurfalien
On Oct 8, 2010, at 4:27 PM, Ian Kelly wrote: On Fri, Oct 8, 2010 at 3:52 PM, aurfal...@gmail.com wrote: Hi all, Unsure how to deal with what appears to be \n vs \r issues. The following code works in Linux; o = open(axenfs.reg) n = open(axenfs2.reg, a) while 1: line = o.readline() if not

Re: [Python-ideas] [Python-Dev] Inclusive Range

2010-10-08 Thread Steven D'Aprano
On Fri, 08 Oct 2010 15:53:17 -0400, Jed Smith wrote: On Fri, Oct 8, 2010 at 1:26 PM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Fri, 08 Oct 2010 10:21:16 +0200, Antoon Pardon wrote: Personnaly I find it horrible that in the following expression: L[a:b:-1], it is

Re: [Python-ideas] [Python-Dev] Inclusive Range

2010-10-08 Thread Steven D'Aprano
On Fri, 08 Oct 2010 22:10:35 +0200, Hallvard B Furuseth wrote: Jed Smith j...@jedsmith.org writes: a = [1, 2, 3, 4, 5, 6] a[::-1] [6, 5, 4, 3, 2, 1] Nice. Is there a trick to get a -0 index too? Other than doing 'i or len(L)' instead of 'i', that is. What exactly are you expecting? I

Re: question about a program

2010-10-08 Thread Steven D'Aprano
On Thu, 07 Oct 2010 17:39:51 -0700, Logan Butler wrote: question about an assignment: places(home sweet home is here,' ') [4, 10, 15, 18] this is my code: def places(x, y): return [x.index(y) for v in x if (v == y)] so far I'm only getting [4, 4, 4, 4] so the first value is

[issue10046] Correction to atexit documentation

2010-10-08 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: One could also argue that on SIGINT, the program is not killed but interrupted by the signal :) What about ... killed by an unhandled signal ...? -- nosy: +georg.brandl ___ Python tracker

[issue10019] json.dumps with indent = 0 not adding newlines

2010-10-08 Thread Bob Ippolito
Bob Ippolito b...@redivi.com added the comment: The test in the patch assumes a specific iteration order for the dict h, changing the dict to have only one key would fix this problem with the test. -- ___ Python tracker rep...@bugs.python.org

[issue10019] json.dumps with indent = 0 not adding newlines

2010-10-08 Thread Bob Ippolito
Bob Ippolito b...@redivi.com added the comment: The test also repeats an equivalent dict to h in the check function. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10019 ___

[issue10019] json.dumps with indent = 0 not adding newlines

2010-10-08 Thread Bob Ippolito
Bob Ippolito b...@redivi.com added the comment: I just applied a version of this patch with corrections to the tests here: http://code.google.com/p/simplejson/source/detail?r=234 -- ___ Python tracker rep...@bugs.python.org

[issue10040] GZipFile failure on large files

2010-10-08 Thread Robert Rohde
Robert Rohde ro...@robertrohde.com added the comment: It's Windows 7 Ultimate (64-bit) on a very high end system. I don't think it would be very practical to distribute a 2 GB test file. Though I might be able to get it to a couple people if someone wanted to really study the issue. Though

  1   2   >