Sphinx 1.0.2 released

2010-08-15 Thread Georg Brandl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I'm happy to announce the release of Sphinx 1.0.2, a bug-fix release in the 1.0 series. What is it? === Sphinx is a tool that makes it easy to create intelligent and beautiful documentation for Python projects (or other documents

Re: OpenCV_Problem

2010-08-15 Thread Rami Chowdhury
On Sun, Aug 15, 2010 at 12:22, arihant nahata forever.arih...@gmail.com wrote: Hi,     I m new to python and openCV. I think you meant to send this to the list ;-) i installed openCV and python and copied the necessary folder. and even appended the sys.path. but then too the same error.

Re: Working with PDFs?

2010-08-15 Thread geremy condra
On Sat, Aug 14, 2010 at 7:58 PM, Terry Reedy tjre...@udel.edu wrote: On 8/14/2010 7:44 PM, jyoun...@kc.rr.com wrote: Just curious if anyone knows if it's possible to work with pdf documents with Python?  I'd like to do the following: search python pdf library reportlab I second the

[ANN]VTD-XML 2.9

2010-08-15 Thread dontcare
VTD-XML 2.9, the next generation XML Processing API for SOA and Cloud computing, has been released. Please visit https://sourceforge.net/projects/vtd-xml/files/ to download the latest version. * Strict Conformance #VTD-XML now fully conforms to XML namespace 1.0 spec * Performance

Re: shelf-like list?

2010-08-15 Thread Martin v. Loewis
Does anyone know of such a module? ZODB supports persistent lists. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Deditor -- pythonic text-editor

2010-08-15 Thread Kruptein
I've noticed that there were a lot of downloads since I posted this topic, but I don't get any response from anyone so I actually still don't know whether it is good, bad, ugly, pretty, easy to use,... So please help me! :) -- http://mail.python.org/mailman/listinfo/python-list

MOVIES SONGS FITNESS FRIENDSHIPS AND MORE

2010-08-15 Thread p.mahalakshmi maha
new movies new songs new fitness tips new friendships new actress MMS new EXCLUSIVE and MORE FREE www.123maza.com/25/shirt156/ www.slim.com/go/g1246010/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is python not written in C++ ?

2010-08-15 Thread Lawrence D'Oliveiro
In message i472rp$i4...@panix5.panix.com, Aahz wrote: Heck, I learned Ada as a sixteen-year-old knowing only BASIC and Pascal. Not so surprising, considering Ada was consciously modelled on Pascal. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Python Sandbox

2010-08-15 Thread Lawrence D'Oliveiro
In message mailman.2115.1281840500.1673.python-l...@python.org, Stephen Hansen wrote: On 8/14/10 2:25 PM, Cameron Simpson wrote: Ok, what about this: run the untrusted code in a separate process, if necessary running as a user with different privileges. Way too much overhead by a really

Re: Python why questions

2010-08-15 Thread Lawrence D'Oliveiro
In message 4c5db0ae$0$1641$742ec...@news.sonic.net, John Nagle wrote: The languages which have real multidimensional arrays, rather than arrays of arrays, tend to use 1-based subscripts. That reflects standard practice in mathematics. Actually I’d go one better, and say that the

Re: shelf-like list?

2010-08-15 Thread kj
In mailman.2125.1281849995.1673.python-l...@python.org Chris Rebert c...@rebertia.com writes: On Sat, Aug 14, 2010 at 5:13 PM, kj no.em...@please.post wrote: In af7fdb85-8c87-434e-94f3-18d8729bf...@l25g2000prn.googlegroups.com Ra= ymond Hettinger pyt...@rcn.com writes: On Aug 12, 1:37=3DA0pm,

Re: shelf-like list?

2010-08-15 Thread kj
In i486al$b...@online.de Martin v. Loewis mar...@v.loewis.de writes: Does anyone know of such a module? ZODB supports persistent lists. Thanks; I'll check it out. ~K -- http://mail.python.org/mailman/listinfo/python-list

Re: Python why questions

2010-08-15 Thread Lawrence D'Oliveiro
In message mailman.2071.1281719688.1673.python-l...@python.org, Thomas Jollans wrote: Where it all started is that 0-based indexing gives languages like C a very nice property: a[i] and *(a+i) are equivalent in C. From a language design viewpoint, I think that's quite a strong argument. It

Re: Python why questions

2010-08-15 Thread Lawrence D'Oliveiro
In message mailman.2084.1281741048.1673.python-l...@python.org, Ian Kelly wrote: The ability to change the minimum index is evil. Pascal allowed you to do that. And nobody ever characterized Pascal as “evil”. Not for that reason, anyway... --

Re: writing \feff at the begining of a file

2010-08-15 Thread Peter Billam
On 2010-08-14, Martin v. Loewis mar...@v.loewis.de wrote: Is there a standard way to autodetect the encoding of a text file? Use the chardet module: http://chardet.feedparser.org/ Very timely: the python-chardet package just seems to have appeared on debian squeeze :-) After my latest

Re: Python why questions

2010-08-15 Thread Roald de Vries
On Aug 15, 2010, at 1:00 PM, Lawrence D'Oliveiro wrote: It would be if pointers and arrays were the same thing in C. Only they’re not, quite. Which somewhat defeats the point of trying to make them look the same, don’t you think? How are they not the same? The code snippet (in C/C++)

Re: Python why questions

2010-08-15 Thread Roald de Vries
On Aug 7, 2010, at 9:14 PM, John Nagle wrote: FORTRAN, MATLAB, and Octave all use 1-based subscripts. The languages which have real multidimensional arrays, rather than arrays of arrays, tend to use 1-based subscripts. That reflects standard practice in mathematics. True, but that

Re: Python why questions

2010-08-15 Thread geremy condra
On Sun, Aug 15, 2010 at 4:55 AM, Roald de Vries downa...@gmail.com wrote: On Aug 15, 2010, at 1:00 PM, Lawrence D'Oliveiro wrote: It would be if pointers and arrays were the same thing in C. Only they’re not, quite. Which somewhat defeats the point of trying to make them look the same, don’t

Re: Python why questions

2010-08-15 Thread Roald de Vries
On Aug 15, 2010, at 2:16 PM, geremy condra wrote: On Sun, Aug 15, 2010 at 4:55 AM, Roald de Vries downa...@gmail.com wrote: On Aug 15, 2010, at 1:00 PM, Lawrence D'Oliveiro wrote: It would be if pointers and arrays were the same thing in C. Only they’re not, quite. Which somewhat defeats

Re: Pop return from stack?

2010-08-15 Thread Dave Angel
Steven D'Aprano wrote: On Sat, 14 Aug 2010 16:05:05 -0700, bvdp wrote: snip def error(s): print Error, s sys.exit(1) snip This general technique is called monkey patching. snip You can either manually exit from your own error handler: def myerror(s): print new error

Re: shelf-like list?

2010-08-15 Thread Dave Angel
kj wrote: snip self.save() Even though it is saved periodically to disk, it looks like the whole list remains in memory all the time? (If so, it's not what I'm looking for; the whole point of saving stuff to disk is to keep the list's memory footprint low.) ~K It sounds

Simple Problem but tough for me if i want it in linear time

2010-08-15 Thread ChrisChia
dataList = [a, b, c, ...] where a, b, c are objects of a Class X. In Class X, it contains self.name and self.number If i wish to test whether a number (let's say 100) appears in one of the object, and return that object, is that only fast way of solving this problem without iterating through

Re: Python why questions

2010-08-15 Thread Dave Angel
Roald de Vries wrote: div class=moz-text-flowed style=font-family: -moz-fixedOn Aug 15, 2010, at 2:16 PM, geremy condra wrote: On Sun, Aug 15, 2010 at 4:55 AM, Roald de Vries downa...@gmail.com wrote: On Aug 15, 2010, at 1:00 PM, Lawrence D'Oliveiro wrote: It would be if pointers and arrays

Re: OpenCV_Problem

2010-08-15 Thread Rami Chowdhury
Hi Arihant, Please make sure your response goes out to the list -- I suggest using 'reply all' rather than 'reply'. Also, please make sure the previous conversation is included in your email -- otherwise people might not understand your problem and be able to help. On Sunday 15 August 2010

Re: Simple Problem but tough for me if i want it in linear time

2010-08-15 Thread Peter Otten
ChrisChia wrote: dataList = [a, b, c, ...] where a, b, c are objects of a Class X. In Class X, it contains self.name and self.number If i wish to test whether a number (let's say 100) appears in one of the object, and return that object, is that only fast way of solving this problem

Re: Simple Problem but tough for me if i want it in linear time

2010-08-15 Thread MRAB
ChrisChia wrote: dataList = [a, b, c, ...] where a, b, c are objects of a Class X. In Class X, it contains self.name and self.number If i wish to test whether a number (let's say 100) appears in one of the object, and return that object, is that only fast way of solving this problem without

2 threads; 1 more Tkinter and 1 more terminal. problem

2010-08-15 Thread ChrisChia
Hi all, i am trying to do a GUI with Tkinter package, but i am stuck no matter what... The problem right now is that my GUI has a label= 'A' (where 'A' is the text on display) i wish to run a program with 2 threads... one for my GUI and the other for the terminal where the terminal will keep

Mecca direct transfer 24 hours

2010-08-15 Thread nais-saudi
Mecca direct transfer 24 hours You will not believe your eyes what you feel that a direct http://ar.justin.tv/bidayatv#/w/312906784/30 Fairy scenes The sections that cried and asked YouTube viewers translation: http://www.youtube.com/v/IFq9cjtrWlQrel=0

Re: math symbols in unicode (grouped by purpose)

2010-08-15 Thread Kenneth Tilton
On 8/13/2010 5:18 PM, Xah Lee wrote: some collection of math symbols in unicode. • Math Symbols in Unicode http://xahlee.org/comp/unicode_math_operators.html I am surprised you do not include the numeric character codes. kt • Arrows in Unicode

Re: Simple Problem but tough for me if i want it in linear time

2010-08-15 Thread Steven D'Aprano
On Sun, 15 Aug 2010 05:47:04 -0700, ChrisChia wrote: dataList = [a, b, c, ...] where a, b, c are objects of a Class X. In Class X, it contains self.name and self.number If i wish to test whether a number (let's say 100) appears in one of the object, and return that object, is that only

Re: shelf-like list?

2010-08-15 Thread Emile van Sebille
On 8/15/2010 3:58 AM kj said... Ini486al$b...@online.de Martin v. Loewismar...@v.loewis.de writes: Does anyone know of such a module? ZODB supports persistent lists. Thanks; I'll check it out. I wouldn't expect a low memory footprint however. :) Emile --

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-15 Thread Baba
Hi John, Thanks for your submission! I've improved a lot and everone's help so far has been thrilling amd is very good for my self-study motivation :) ok so i think i'm clear on how to approach this problem and on how to write basic but clean Python code to solve it. The next step is to

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-15 Thread Baba
Hi John, Thanks for your submission! I've improved a lot and everone's help so far has been thrilling and is very good for my self-study motivation :) ok so i think i'm clear on how to approach this problem and on how to write basic but clean Python code to solve it. The next step is to

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-15 Thread Emile van Sebille
On 8/15/2010 8:44 AM Baba said... Hi John, Thanks for your submission! I've improved a lot and everone's help so far has been thrilling and is very good for my self-study motivation :) ok so i think i'm clear on how to approach this problem and on how to write basic but clean Python code to

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-15 Thread Ian Kelly
On Sun, Aug 15, 2010 at 9:58 AM, Emile van Sebille em...@fenx.com wrote: On 8/15/2010 8:44 AM Baba said... Hi John, Thanks for your submission! I've improved a lot and everone's help so far has been thrilling and is very good for my self-study motivation :) ok so i think i'm clear on how

Re: Python why questions

2010-08-15 Thread John Nagle
On 8/15/2010 4:00 AM, Lawrence D'Oliveiro wrote: In messagemailman.2071.1281719688.1673.python-l...@python.org, Thomas Jollans wrote: Where it all started is that 0-based indexing gives languages like C a very nice property: a[i] and *(a+i) are equivalent in C. From a language design

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-15 Thread John Posner
On 8/15/2010 11:38 AM, Baba wrote: In addition to the points that Emile and Ian made ... def diophantine_nuggets(x,y,z): cbc=0 #cbc=can_buy counter packages =[x,y,z] You can take advantage of a nifty syntax convenience feature here. Instead of loading all of the function's

adding a windows item to a menu bar dynamically

2010-08-15 Thread Chris Hare
I want to add a Windows menu item to my menu bar, so when another Toplevel window is opened, I can add that to the menu bar in case the user accidentally clicks on a different window and moves the Toplevel under something else. Then when the window is closed, remove the window from the menu

NZEC what is it?

2010-08-15 Thread Mikael B
Hi I use, among other things, a site, http://www.codechef.com to learn python. I don't know what platform they use. I use linux. When I submit this little piece of code to them: import sys import math #main s=sys.stdin.read() int_list=s.split() for a in int_list[1:]: print

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-15 Thread Baba
Hi All, @Emile tnx for spotting the mistake. Should have seen it myself. @John Ian i had a look around but couldn't find a general version of below theorem If it is possible to buy x, x+1,…, x+5 sets of McNuggets, for some x, then it is possible to buy any number of McNuggets = x, given that

Re: NZEC what is it?

2010-08-15 Thread MRAB
Mikael B wrote: Hi I use, among other things, a site, http://www.codechef.com to learn python. I don't know what platform they use. I use linux. When I submit this little piece of code to them: import sys import math #main s=sys.stdin.read() int_list=s.split() for a in

Re: math symbols in unicode (grouped by purpose)

2010-08-15 Thread Xah Lee
hi kenny! Xah Lee wrote: some collection of math symbols in unicode. • Math Symbols in Unicode    http://xahlee.org/comp/unicode_math_operators.html Kenneth Tilton wrote: I am surprised you do not include the numeric character codes. i thought about it, but the page would get unwieldy. To

Re: 2 threads; 1 more Tkinter and 1 more terminal. problem

2010-08-15 Thread Terry Reedy
On 8/15/2010 10:22 AM, ChrisChia wrote: Hi all, i am trying to do a GUI with Tkinter package, but i am stuck no matter what... The problem right now is that my GUI has a label= 'A' (where 'A' is the text on display) i wish to run a program with 2 threads... one for my GUI and the other for the

Opposite of split

2010-08-15 Thread Alex van der Spek
Looking for a method that does the opposite of 'split', i.e. elements in a list are automatically concatenated with a user selectable spacer in between e.g. '\t'. This is to prepare lines to be written to a sequential file by 'write'. All hints welcome. Regards, Alex van der Spek --

Re: Opposite of split

2010-08-15 Thread Wieland Hoffmann
On 15.08.2010 20:24, Alex van der Spek wrote: Looking for a method that does the opposite of 'split', i.e. elements in a list are automatically concatenated with a user selectable spacer in between e.g. '\t'. .join([i,am,a,list]) 'i am a list' Wieland --

Re: Opposite of split

2010-08-15 Thread Gary Herron
On 08/15/2010 11:24 AM, Alex van der Spek wrote: Looking for a method that does the opposite of 'split', i.e. elements in a list are automatically concatenated with a user selectable spacer in between e.g. '\t'. This is to prepare lines to be written to a sequential file by 'write'. All

Programmers (esp. Windows) needed for SpamBayes

2010-08-15 Thread skip
If you have some time to devote to a popular open source Python project, we can use some development help with SpamBayes, particularly on Windows and with Outlook 2010: http://wiki.python.org/moin/VolunteerOpportunities#SpamBayesProject Thanks, -- Skip Montanaro - s...@pobox.com -

RE: NZEC what is it?

2010-08-15 Thread Mikael B
From: mba...@live.se To: pyt...@mrabarnett.plus.com Subject: RE: NZEC what is it? Date: Sun, 15 Aug 2010 19:58:44 +0200 Date: Sun, 15 Aug 2010 18:22:54 +0100 From: pyt...@mrabarnett.plus.com To: python-list@python.org Subject: Re: NZEC what is it? Mikael B wrote: Hi I

Re: OpenCV_Problem

2010-08-15 Thread arihant nahata
Hi, There is no file named _cv.dll file in the directory that you mentioned -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Python Sandbox

2010-08-15 Thread jacek2v
On Aug 14, 1:37 am, Stephen Hansen me+list/pyt...@ixokai.io wrote: Can you think of a way out of such a sandbox? A way to access disallowed stuff, not a way to DOS. Hi, I have strange idea :): use Google Apps. You'll need prepare some interfaces for your apps (for example via WebServices) Maybe

Re: Opposite of split

2010-08-15 Thread Steven Howe
On 08/15/2010 11:35 AM, Gary Herron wrote: On 08/15/2010 11:24 AM, Alex van der Spek wrote: Looking for a method that does the opposite of 'split', i.e. elements in a list are automatically concatenated with a user selectable spacer in between e.g. '\t'. This is to prepare lines to be written

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-15 Thread Mel
Baba wrote: Hi All, @Emile tnx for spotting the mistake. Should have seen it myself. @John Ian i had a look around but couldn't find a general version of below theorem If it is possible to buy x, x+1,…, x+5 sets of McNuggets, for some x, then it is possible to buy any number of

Re: OpenCV_Problem

2010-08-15 Thread arihant nahata
Hi, There is no file named _cv.dll file in the directory that you mentioned -- http://mail.python.org/mailman/listinfo/python-list

Re: Pop return from stack?

2010-08-15 Thread John Nagle
On 8/14/2010 4:05 PM, bvdp wrote: Assuming I have a module 'foo.py' with something like this: def error(s): print Error, s sys.exit(1) def func(s): ... do some processing ... call error() if bad .. go to system exit. ... more processing Fix func. That's terrible

Tkinter/threading issue

2010-08-15 Thread Jerrad Genson
Hello, I'm learning Tkinter, and I have an issue that I'd appreciate help with. I have a program that initializes a GUI (I'll call this the GUI process), then spawns another process that listens on a network via the TCP/IP protocol for incoming strings (I'll call this the server process).

Re: Tkinter/threading issue

2010-08-15 Thread Jerrad Genson
I should also mention that I'm running Ubuntu 10.04 and Python 2.6.5. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter/threading issue

2010-08-15 Thread Thomas Jollans
On Sunday 15 August 2010, it occurred to Jerrad Genson to exclaim: Hello, I'm learning Tkinter, and I have an issue that I'd appreciate help with. I have a program that initializes a GUI (I'll call this the GUI process), then spawns another process that listens on a network via the TCP/IP

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-15 Thread Baba
Hi Mel, indeed i thought of generalising the theorem as follows: If it is possible to buy n, n+1,…, n+(x-1) sets of McNuggets, for some x, then it is possible to buy any number of McNuggets = x, given that McNuggets come in x, y and z packs. so with diophantine_nuggets(7,10,21) i would need 7

Re: Tkinter/threading issue

2010-08-15 Thread Jerrad Genson
Thank you for the reply. When I said TCP/IP protocol, what I meant was this: http://en.wikipedia.org/wiki/Internet_Protocol_Suite. The reason the server is in a separate process is because it needs to continually be listening for network packets, which would disrupt the GUI. In any case, that

Re: Tkinter/threading issue

2010-08-15 Thread Jerrad Genson
class MessageServer: '''Creates a message server object that listens for textual information and sends it back to the main program. Intended to be spawned as a separate process. ''' def __init__(self, port_number, server_send, server_receive): '''@param

Re: Tkinter/threading issue

2010-08-15 Thread Jerrad Genson
def check_message(self, spawn=True): '''Method for pulling message from server process.''' if spawn: self.pid2 = os.fork() if self.pid2 == 0: if verbose: print('message checker initialized') # repeat message check forever while True:

Re: segfault with small pyqt script

2010-08-15 Thread Hans-Peter Jansen
On Thursday 12 August 2010, 01:07:25 Gelonida wrote: Hi Guys, I'm desperate. I'm having a real application, which fails rather often when finishing it. I'm not sure, whether any serious problem could be hidden behind it The script is a pyqt script, which segfaults most of the time on my

execfile() and locals()

2010-08-15 Thread fons
Hello all, The documentation on execfile() and locals() makes it clear that code executed from execfile() can not modify local variables in the function from wich execfile() was called. Two questions about this: 1. Is there some way to circumvent this limitation (apart from explicitly copying

Re: NZEC what is it?

2010-08-15 Thread Ian Kelly
On Sun, Aug 15, 2010 at 12:56 PM, Mikael B mba...@live.se wrote: Hi  I use, among other things,  a site,  http://www.codechef.com  to learn python. I don't know what platform they use. I use  linux. When I submit this little piece of  code to them: import sys import math #main

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-15 Thread Ian Kelly
On Sun, Aug 15, 2010 at 4:36 PM, Baba raoul...@gmail.com wrote: Hi Mel, indeed i thought of generalising the theorem as follows: If it is possible to buy n, n+1,…, n+(x-1) sets of McNuggets, for some x, then it is possible to buy any number of McNuggets = x, given that McNuggets come in x, y

RE: NZEC what is it?

2010-08-15 Thread Mikael B
From: ian.g.ke...@gmail.com Date: Sun, 15 Aug 2010 17:39:57 -0400 Subject: Re: NZEC what is it? To: python-list@python.org On Sun, Aug 15, 2010 at 12:56 PM, Mikael B mba...@live.se wrote: Hi I use, among other things, a site, http://www.codechef.com to learn python. I don't

Re: execfile() and locals()

2010-08-15 Thread Thomas Jollans
On Sunday 15 August 2010, it occurred to f...@kokkinizita.net to exclaim: Hello all, The documentation on execfile() and locals() makes it clear that code executed from execfile() can not modify local variables in the function from wich execfile() was called. Two questions about this: 1.

Re: execfile() and locals()

2010-08-15 Thread Steven D'Aprano
On Sun, 15 Aug 2010 23:21:51 +0200, fons wrote: Hello all, The documentation on execfile() and locals() makes it clear that code executed from execfile() can not modify local variables in the function from wich execfile() was called. Two questions about this: 1. Is there some way to

Re: Opposite of split

2010-08-15 Thread Steven D'Aprano
On Sun, 15 Aug 2010 12:10:10 -0700, Steven Howe wrote: Strings have a join method for this: '\t'.join(someList) Gary Herron or maybe: - res = for item in myList: res = %s\t%s % ( res, item ) Under what possible circumstances would you

python strings and {} in Tkinter entry widgets

2010-08-15 Thread Chris Hare
I have some code that pulls a value from a database. In this case, it is three space delimited words. When I display the value in a Tkinter.Entry widget, the text has curly braces around it, even when there are none in the surrounding the text in the database. Is this normal, and how do I

Python 2.7 re.IGNORECASE broken in re.sub?

2010-08-15 Thread Christopher
I have the following problem: Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32 Type help, copyright, credits or license for more information. t=Python26 import re re.sub(rpython\d\d, Python27, t) 'Python26' re.sub(rpython\d\d, Python27, t, re.IGNORECASE)

Re: Opposite of split

2010-08-15 Thread Roy Smith
In article 4c687936$0$11100$c3e8...@news.astraweb.com, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Sun, 15 Aug 2010 12:10:10 -0700, Steven Howe wrote: Strings have a join method for this: '\t'.join(someList) Gary Herron or maybe:

Re: Opposite of split

2010-08-15 Thread D'Arcy J.M. Cain
On 15 Aug 2010 23:33:10 GMT Steven D'Aprano st...@remove-this-cybersource.com.au wrote: Under what possible circumstances would you prefer this code to the built- in str.join method? I assumed that it was a trap for someone asking for us to do his homework. I also thought that it was a waste

Re: Python 2.7 re.IGNORECASE broken in re.sub?

2010-08-15 Thread Steven D'Aprano
On Sun, 15 Aug 2010 16:45:49 -0700, Christopher wrote: I have the following problem: t=Python26 import re re.sub(rpython\d\d, Python27, t) 'Python26' re.sub(rpython\d\d, Python27, t, re.IGNORECASE) 'Python26' re.sub(rPython\d\d, Python27, t, re.IGNORECASE) 'Python27' Is this a known

Re: Opposite of split

2010-08-15 Thread Steven D'Aprano
On Sun, 15 Aug 2010 19:58:54 -0400, Roy Smith wrote: Actually, there is (at least) one situation where this produces the correct result, can you find it? When myList is empty, it correctly gives the empty string. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Python why questions

2010-08-15 Thread Gregory Ewing
Ian Kelly wrote: On Fri, Aug 13, 2010 at 11:53 AM, Martin Gregorie mar...@address-in-sig.invalid wrote: real sample[-500:750]; Ugh, no. The ability to change the minimum index is evil. Not always; it can have its uses, particularly when you're using the array as a mapping rather

Re: Python 2.7 re.IGNORECASE broken in re.sub?

2010-08-15 Thread Alex Willmer
On Aug 16, 1:07 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: You're passing re.IGNORECASE (which happens to equal 2) as a count argument, not as a flag. Try this instead: re.sub(rpython\d\d + '(?i)', Python27, t) 'Python27' Basically right, but in-line flags must be

Re: Python why questions

2010-08-15 Thread Gregory Ewing
Roald de Vries wrote: On Aug 15, 2010, at 1:00 PM, Lawrence D'Oliveiro wrote: Which somewhat defeats the point of trying to make them look the same, don’t you think? How are they not the same? One way to see that they're not *exactly* the same is the fact that sizeof(python rocks) is

Re: Python why questions

2010-08-15 Thread Gregory Ewing
On Aug 7, 2010, at 9:14 PM, John Nagle wrote: The languages which have real multidimensional arrays, rather than arrays of arrays, tend to use 1-based subscripts. That reflects standard practice in mathematics. Not always -- mathematicians use whatever starting index is most convenient for

Re: Python why questions

2010-08-15 Thread Roy Smith
In article 8crg0effb...@mid.individual.net, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Not always -- mathematicians use whatever starting index is most convenient for the problem at hand. Which may be 0, 1, or something else. There are plenty of situations, for example, where you

Re: Python 2.7 re.IGNORECASE broken in re.sub?

2010-08-15 Thread MRAB
Alex Willmer wrote: On Aug 16, 1:07 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: You're passing re.IGNORECASE (which happens to equal 2) as a count argument, not as a flag. Try this instead: re.sub(rpython\d\d + '(?i)', Python27, t) 'Python27' Basically right, but

Re: Pop return from stack?

2010-08-15 Thread bvdp
On Aug 15, 12:52 pm, John Nagle na...@animats.com wrote: On 8/14/2010 4:05 PM, bvdp wrote: Assuming I have a module 'foo.py' with something like this: def error(s):      print Error, s      sys.exit(1) def func(s):      ... do some processing      ... call error() if bad .. go to

Re: Tkinter/threading issue

2010-08-15 Thread Jerrad Genson
Well, I figured it out. Thanks anyway for your help. -- http://mail.python.org/mailman/listinfo/python-list

Python XML and tables using math

2010-08-15 Thread flebber
I am looking at a project that will import and modify an XML file and then export it to a table. Currently a flat file table system should be fine. I want to export the modified data to the table and then perform a handful of maths(largely simple statistical functions) to the data and then print

Re: Pop return from stack?

2010-08-15 Thread Carey Tilden
On Sun, Aug 15, 2010 at 6:43 PM, bvdp b...@mellowood.ca wrote: Not to belabor the point .. but func is not a standard lib module. It's part of a much larger application ... and in that application it makes perfect sense to terminate the application if it encounters an error. I fail to see the

Re: Python why questions

2010-08-15 Thread Lawrence D'Oliveiro
In message 8crg0effb...@mid.individual.net, Gregory Ewing wrote: For example, the constant term of a polynomial is usually called term 0, not term 1. That is not some kind of ordinal numbering of the terms, that is the power of the variable involved. And polynomials can have negative powers,

Re: 2 threads; 1 more Tkinter and 1 more terminal. problem

2010-08-15 Thread ChrisChia
On Aug 16, 4:17 am, Terry Reedy tjre...@udel.edu wrote: On 8/15/2010 10:22 AM, ChrisChia wrote: Hi all, i am trying to do a GUI with Tkinter package, but i am stuck no matter what... The problem right now is that my GUI has a label= 'A' (where 'A' is the text on display) i wish to

Re: 2 threads; 1 more Tkinter and 1 more terminal. problem

2010-08-15 Thread 金鑫鑫
Hi Man, I have done that according to your requirements Here is the code {code} #!/usr/bin/python import Tkinter import threading root=Tkinter.Tk() root.geometry(100x100) v=Tkinter.StringVar() label=Tkinter.Label(root,textvariable=v,fg=red) label.pack(fill=Tkinter.X,expand=1)

Re: 2 threads; 1 more Tkinter and 1 more terminal. problem

2010-08-15 Thread Jemy
On Mon, Aug 16, 2010 at 5:13 AM, 金鑫鑫 jemyg...@gmail.com wrote: Hi Man, I have done that according to your requirements Here is the code {code} #!/usr/bin/python import Tkinter import threading root=Tkinter.Tk() root.geometry(100x100) v=Tkinter.StringVar()

Re: 2 threads; 1 more Tkinter and 1 more terminal. problem

2010-08-15 Thread Jemy
I attached the source file On Mon, Aug 16, 2010 at 5:17 AM, Jemy jemyg...@gmail.com wrote: On Mon, Aug 16, 2010 at 5:13 AM, 金鑫鑫 jemyg...@gmail.com wrote: Hi Man, I have done that according to your requirements Here is the code {code} #!/usr/bin/python import Tkinter import

Re: 2 threads; 1 more Tkinter and 1 more terminal. problem

2010-08-15 Thread Jemy
http://effbot.org/tkinterbook/label.htm Hope this url will be of some help to you all. Regards Jemy -- http://mail.python.org/mailman/listinfo/python-list

Re: Pop return from stack?

2010-08-15 Thread Carl Banks
On Aug 15, 6:43 pm, bvdp b...@mellowood.ca wrote: On Aug 15, 12:52 pm, John Nagle na...@animats.com wrote: On 8/14/2010 4:05 PM, bvdp wrote: Assuming I have a module 'foo.py' with something like this: def error(s):      print Error, s      sys.exit(1) def func(s):      

[issue9545] Adding _collections to static build

2010-08-15 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Re msg113792: Nick, running the clean step before configure is not possible. It requires a Makefile, which isn't there yet. -- ___ Python tracker rep...@bugs.python.org

[issue444582] Finding programs in PATH, adding shutil.which

2010-08-15 Thread Iztok Kavkler
Iztok Kavkler iztok.kavk...@gmail.com added the comment: There is a subtle problem in the reference implementation: it will break if one of the paths in PATH contains quoted path separator. On windows that would be quted with : c:\path;with;sep and on *nix something like /path\:with\:sep

[issue9603] os.ttyname() and os.ctermid() don't decode result according to PEP 383

2010-08-15 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Commited to 3.1 as r84061 and to 3.2 as r84060. Thanks David. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9603

[issue9545] Adding _collections to static build

2010-08-15 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: On Sun, Aug 15, 2010 at 6:44 PM, Martin v. Löwis rep...@bugs.python.org wrote: Martin v. Löwis mar...@v.loewis.de added the comment: Re msg113792: Nick, running the clean step before configure is not possible. It requires a Makefile, which

[issue9604] os.initgroups() doesn't accept PEP 383 usernames returned by pwd module

2010-08-15 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Commited to 3.2 as r84062. Thanks David. (Python 3.1 has no posix.initgroups() function) -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org

[issue9605] os.getlogin() should use PEP 383 decoding to match the pwd module

2010-08-15 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Commited to 3.1 as r84064 and to 3.2 as r84063. Thanks David. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9605

[issue9608] Re-phrase best way of using exceptions in doanddont.rst

2010-08-15 Thread Floris Bruynooghe
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com: The description of how to best use exceptions is slightly confusing and led me to believe there was an issue when using open() as a context manager. The main issue is that the wording seems to suggest the example above it is

[issue9607] Test file 'test_keyword.py' submission for use with keyword.py

2010-08-15 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9607 ___ ___ Python-bugs-list

  1   2   >