Re: Dreaming of new generation IDE

2010-02-06 Thread Gabriel Genellina
En Sat, 06 Feb 2010 22:34:14 -0300, bartc escribió: "Arnaud Delobelle" wrote in message news:m28wb6ypfs@googlemail.com... "Gabriel Genellina" writes: Note the *literal* part. If you (the programmer) is likely to know the parameter value when writing the code, then the function is actu

Re: xmlrpc slow in windows 7 if hostnames are used

2010-02-06 Thread Gabriel Genellina
En Sat, 06 Feb 2010 22:15:48 -0300, Jean-Michel Pichavant escribió: I'm puzzled. Unless my english is failing me, everything would be solved using hostnames if I follow you. Why don't you do that ? I am no network/IP guru, but it sounds very weird to have requests rejected when using IP a

Re: python admin abuse complaint

2010-02-06 Thread Aahz
In article <0c535d15-967d-4909-a9bb-b59708181...@l24g2000prh.googlegroups.com>, Xah Lee wrote: > >This is a short complaint on admin abuse on #python irc channel on >freenode.net. Let's see, you are complaining about getting banned from #python by CROSS-POSTING between c.l.py and comp.lang.lisp.

Re: TABS in the CPython C source code

2010-02-06 Thread Aahz
In article , Neil Hodgson wrote: >Alf P. Steinbach: >> >> Anyways, I would suggest converting all those tabs to spaces, as e.g. >> the Boost library project does -- no tabs allowed. > > This would damage the usefulness of source control histories (svn >annotate) as all of the converted lines

Re: TABS in the CPython C source code

2010-02-06 Thread Alf P. Steinbach
* Nobody: On Sat, 06 Feb 2010 21:31:52 +0100, Alf P. Steinbach wrote: The size-8 tabs look really bad in an editor configured with tab size 4, as is common in Windows. I'm concluding that the CPython programmers configure their Visual Studio's to *nix convention. 8-column tabs aren't a "*nix

Re: how to make a SimpleXMLRPCServer abort at CTRL-C under windows

2010-02-06 Thread Gabriel Genellina
En Sat, 06 Feb 2010 21:24:33 -0300, News123 escribió: Gabriel Genellina wrote: En Fri, 05 Feb 2010 20:03:51 -0300, News123 escribió: I'm using an XMLRPC server under Windows. What I wonder is how I could create a server, that can be killed with CTRL-C Python 2.6 and up behaves exactly as y

Re: Doctests and decorated methods don't get along

2010-02-06 Thread Terry Reedy
On 2/6/2010 7:51 PM, Steven D'Aprano wrote: I have found an existing report for this issue: http://bugs.python.org/issue4037 The original poster's suggested fix was on the right track, but not complete. I've added a patch which works according to my tests. Since this report is currently unass

Re: C:\Python25\Lib\IDLELIB\idle.pyw won't start

2010-02-06 Thread Gabriel Genellina
En Sat, 06 Feb 2010 08:21:46 -0300, Anthra Norell escribió: Gabriel, Thanks for your hints. I take them up one by one: >>> import os Traceback (most recent call last): File "", line 1, in ImportError: No module named os C:\PYTHON25\LIB>dir os.* OS PY 25,211 08-03-06

Re: TABS in the CPython C source code

2010-02-06 Thread Nobody
On Sat, 06 Feb 2010 21:31:52 +0100, Alf P. Steinbach wrote: > The size-8 tabs look really bad in an editor configured with tab size 4, > as is common in Windows. I'm concluding that the CPython programmers > configure their Visual Studio's to *nix convention. 8-column tabs aren't a "*nix conventi

Re: Help with regex search-and-replace (Perl to Python)

2010-02-06 Thread Schif Schaf
On Feb 7, 12:19 am, "Alf P. Steinbach" wrote: > > I haven't used regexps in Python before, but what I did was (1) look in the > documentation, Hm. I checked in the repl, running `import re; help(re)` and the docs on the `sub()` method didn't say anything about using back-refs in the replacement

Re: Subclassing datetime.date

2010-02-06 Thread Gabriel Genellina
En Sat, 06 Feb 2010 18:42:29 -0300, John Bokma escribió: Sir Wilhelm the Sturdy writes: I recently attempted to subclass the datetime.date object resulting in horror and confusion, before submitting to a has-a relationship. That's all fine and dandy, but out of curiosity I'd like to know w

Re: Help with regex search-and-replace (Perl to Python)

2010-02-06 Thread Alf P. Steinbach
* Schif Schaf: Hi, I've got some text that looks like this: Lorem [ipsum] dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut [labore] et [dolore] magna aliqua. and I want to make it look like this: Lorem {ipsum} dolor sit amet, consectetur

Re: How to print all expressions that match a regular expression

2010-02-06 Thread Nobody
On Sun, 07 Feb 2010 00:26:36 +, Steven D'Aprano wrote: >> So there isn't such a routine just because some of the regular >> expressions cannot be enumerated. No. There isn't a routine because no-one has yet felt any need to write one. >> However, some of them can be >> enumerated. I guess I

Re: Your beloved python features

2010-02-06 Thread Schif Schaf
On Feb 5, 8:49 am, Roald de Vries wrote: > My reasoning: I needed a language more powerful than bash, but more   > portable and faster to develop (at least small scripts) than C/C++. So   > I needed a scripting language. Python, Ruby, Perl, Tcl, ...? > > Python seems to be the language with the m

Help with regex search-and-replace (Perl to Python)

2010-02-06 Thread Schif Schaf
Hi, I've got some text that looks like this: Lorem [ipsum] dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut [labore] et [dolore] magna aliqua. and I want to make it look like this: Lorem {ipsum} dolor sit amet, consectetur adipisicing elit,

Re: How to print all expressions that match a regular expression

2010-02-06 Thread Alf P. Steinbach
* hzh...@gmail.com: So it seems we both misunderstood the problem. I didn't read the top level article until now, and reading it, I can't make sense of it. [1] Seems that you should read the whole thing before making a post, or else you cannot know what we are talking about. Steven doesn't mi

Re: intolerant HTML parser

2010-02-06 Thread Nobody
On Sat, 06 Feb 2010 11:09:31 -0800, Jim wrote: > I generate some HTML and I want to include in my unit tests a check > for syntax. So I am looking for a program that will complain at any > syntax irregularities. > > I am familiar with Beautiful Soup (use it all the time) but it is > intended to

Re: max / min / smallest float value on Python 2.5

2010-02-06 Thread Steven D'Aprano
On Sun, 07 Feb 2010 03:02:05 +, duncan smith wrote: > The precise issue is that I'm supplying a default value of > 2.2250738585072014e-308 for a parameter (finishing temperature for a > simulated annealing algorithm) in an application. I develop on > Ubuntu64, but (I am told) it's too small a

Re: WCK and PIL

2010-02-06 Thread Nobody
On Fri, 05 Feb 2010 21:05:53 -0800, darnzen wrote: > I've written an app using the wck library (widget construction kit, > see http://www.effbot.org), in addition to the wckGraph module. What > I'd like to do, is take the output of one of my windows (happens to be > a graph), and save it as a *.pn

Re: How to print all expressions that match a regular expression

2010-02-06 Thread hzh...@gmail.com
> > So it seems we both misunderstood the problem. > > I didn't read the top level article until now, and reading it, I can't make > sense of it. > Seems that you should read the whole thing before making a post, or else you cannot know what we are talking about. Steven doesn't misunderstand me.

Re: sshd in python for windows 7

2010-02-06 Thread Jerry Hill
On Sat, Feb 6, 2010 at 7:07 PM, News123 wrote: > Hi, > > I wondered which modules would be best to perform following task: > > A user uses a standard ssh (e.g. putty or openssh) client and performs > an ssh to a windows host > > The windows host would run a python script acting as ssh server. The

Re: Dreaming of new generation IDE

2010-02-06 Thread Alf P. Steinbach
* Steven D'Aprano: On Sun, 07 Feb 2010 01:34:14 +, bartc wrote: For a real-world example, it means instead of having a room with a light-switch in it, if I *know* I want the light on or off, I should have two rooms: one with the light permanently on, and one with it permanently off, and jus

Re: max / min / smallest float value on Python 2.5

2010-02-06 Thread duncan smith
Christian Heimes wrote: duncan smith wrote: Hello, I'm trying to find a clean and reliable way of uncovering information about 'extremal' values for floats on versions of Python earlier than 2.6 (just 2.5 actually). I don't want to add a dependence on 3rd party modules just for this p

Re: How to print all expressions that match a regular expression

2010-02-06 Thread Alf P. Steinbach
* Steven D'Aprano: On Sun, 07 Feb 2010 01:51:19 +0100, Alf P. Steinbach wrote: Regular expressions are programs in a "regex" programming language. What you are asking for is the same as saying: "Is there a program that can enumerate every possible set of data that is usable as valid input for

Re: How to print all expressions that match a regular expression

2010-02-06 Thread Grant Edwards
On 2010-02-06, Roy Smith wrote: >> I am a fresh man with python. I know there is regular expressions in >> Python. What I need is that given a particular regular expression, >> output all the matches. [..] > Please enumerate all the strings which match ".*". Use additional sheets > of paper if

Re: max / min / smallest float value on Python 2.5

2010-02-06 Thread Steven D'Aprano
On Sun, 07 Feb 2010 00:52:48 +, duncan smith wrote: > Hello, >I'm trying to find a clean and reliable way of uncovering > information about 'extremal' values for floats on versions of Python > earlier than 2.6 (just 2.5 actually). I don't want to add a dependence > on 3rd party module

Re: Dreaming of new generation IDE

2010-02-06 Thread Steven D'Aprano
On Sun, 07 Feb 2010 01:34:14 +, bartc wrote: > For a real-world example, it means instead of having a room with a > light-switch in it, if I *know* I want the light on or off, I should > have two rooms: one with the light permanently on, and one with it > permanently off, and just walk into th

Re: max / min / smallest float value on Python 2.5

2010-02-06 Thread Christian Heimes
duncan smith wrote: > Hello, >I'm trying to find a clean and reliable way of uncovering > information about 'extremal' values for floats on versions of Python > earlier than 2.6 (just 2.5 actually). I don't want to add a dependence > on 3rd party modules just for this purpose. e.g. For

Re: How to print all expressions that match a regular expression

2010-02-06 Thread MRAB
Alf P. Steinbach wrote: * Steven D'Aprano: On Sat, 06 Feb 2010 16:05:15 -0800, hzh...@gmail.com wrote: Thanks for your reply. So there isn't such a routine just because some of the regular expressions cannot be enumerated. However, some of them can be enumerated. I guess I have to write a func

Re: Calendar GUI

2010-02-06 Thread Jean-Michel Pichavant
Michael Torrie wrote: Gabriel wrote: On Fri, Feb 5, 2010 at 9:08 PM, William Gaggioli wrote: I'm working on setting up some software for a Peruvian non-profit to help them organize their incoming volunteers. One of the features I'd like to add is a calendar-like view of the different v

Re: Dreaming of new generation IDE

2010-02-06 Thread bartc
"Arnaud Delobelle" wrote in message news:m28wb6ypfs@googlemail.com... "Gabriel Genellina" writes: En Fri, 05 Feb 2010 19:22:39 -0300, bartc escribió: "Steve Holden" wrote in message news:mailman.1998.1265399766.28905.python-l...@python.org... Arnaud Delobelle wrote: Robert Kern writ

Re: How to print all expressions that match a regular expression

2010-02-06 Thread Steven D'Aprano
On Sun, 07 Feb 2010 01:51:19 +0100, Alf P. Steinbach wrote: >> Regular expressions are programs in a "regex" programming language. >> What you are asking for is the same as saying: >> >> "Is there a program that can enumerate every possible set of data that >> is usable as valid input for a given

Re: Your beloved python features

2010-02-06 Thread Paul Rubin
Steve Holden writes: >>EveryThing theEveryThing = new EveryThing(); > http://www.artima.com/weblogs/viewpost.jsp?thread=42242 Pretty cool! I see your blog post criticizing Java's lack of type inference, and then immediately adjacent to the post there's a banner ad for a book called "Programm

Re: max / min / smallest float value on Python 2.5

2010-02-06 Thread Benjamin Kaplan
On Sat, Feb 6, 2010 at 7:52 PM, duncan smith wrote: > Hello, >      I'm trying to find a clean and reliable way of uncovering information > about 'extremal' values for floats on versions of Python earlier than 2.6 > (just 2.5 actually).  I don't want to add a dependence on 3rd party modules > just

Re: max / min / smallest float value on Python 2.5

2010-02-06 Thread Shashwat Anand
On Sun, Feb 7, 2010 at 6:22 AM, duncan smith wrote: > Hello, > I'm trying to find a clean and reliable way of uncovering information > about 'extremal' values for floats on versions of Python earlier than 2.6 > (just 2.5 actually). I don't want to add a dependence on 3rd party modules > just

Re: xmlrpc slow in windows 7 if hostnames are used

2010-02-06 Thread Jean-Michel Pichavant
News123 wrote: Hi JM, Jean-Michel Pichavant wrote: import socket # server server = SimpleXMLRPCServer((socket.gethostname(), 5000), logRequests=False, allow_none=True) # client xmlrpclib.ServerProxy("http://%s.yourdomain.com:%s"; % (socket.gethostname(), 5000)) Well This was exact

Re: Your beloved python features

2010-02-06 Thread Steve Holden
Bruno Desthuilliers wrote: > apeach a écrit : >> I love intuitive type recognition. >> >> no need to 'DIM everything AS Integer' etc.! >> > > not to mention the ever hilarious (that is, when you don't have to > maintain it) typical Java idiom: > >EveryThing theEveryThing = new EveryThing(); >

max / min / smallest float value on Python 2.5

2010-02-06 Thread duncan smith
Hello, I'm trying to find a clean and reliable way of uncovering information about 'extremal' values for floats on versions of Python earlier than 2.6 (just 2.5 actually). I don't want to add a dependence on 3rd party modules just for this purpose. e.g. For the smallest positive float

Re: How to print all expressions that match a regular expression

2010-02-06 Thread Alf P. Steinbach
* Steven D'Aprano: On Sat, 06 Feb 2010 16:05:15 -0800, hzh...@gmail.com wrote: Thanks for your reply. So there isn't such a routine just because some of the regular expressions cannot be enumerated. However, some of them can be enumerated. I guess I have to write a function myself. How do you

Re: Doctests and decorated methods don't get along

2010-02-06 Thread Steven D'Aprano
On Sat, 06 Feb 2010 14:39:00 -0500, Terry Reedy wrote: > On 2/6/2010 6:48 AM, Steven D'Aprano wrote: >> It seems that doctest doesn't discover or execute doctests in methods >> which have been decorated [by method descriptors]. [...] >> This looks like bug to me. Have I missed anything? > > I

Re: xmlrcp - how to marshall objects

2010-02-06 Thread Jean-Michel Pichavant
Adam Tauno Williams wrote: On Fri, 2010-02-05 at 18:24 +0100, Jean-Michel Pichavant wrote: Jean-Michel Pichavant wrote: Deos anyone knows where to find an code sample describing how to implement the interface to marshall one object into XMLRPC compliant structures ? I googled without a

Re: How to print all expressions that match a regular expression

2010-02-06 Thread Steven D'Aprano
On Sat, 06 Feb 2010 16:05:15 -0800, hzh...@gmail.com wrote: > Thanks for your reply. > So there isn't such a routine just because some of the regular > expressions cannot be enumerated. However, some of them can be > enumerated. I guess I have to write a function myself. How do you expect to tell

Re: how to make a SimpleXMLRPCServer abort at CTRL-C under windows

2010-02-06 Thread News123
Hi Gabriel, Gabriel Genellina wrote: > En Fri, 05 Feb 2010 20:03:51 -0300, News123 escribió: > >> I'm using an XMLRPC server under Windows. >> >> What I wonder is how I could create a server, that can be killed with >> CTRL-C >> >> The server aborts easily with CTRL-BREAK but not with CTRL-C (un

sshd in python for windows 7

2010-02-06 Thread News123
Hi, I wondered which modules would be best to perform following task: A user uses a standard ssh (e.g. putty or openssh) client and performs an ssh to a windows host The windows host would run a python script acting as ssh server. Instead of controlling a shell the user would directly have acce

Re: How to print all expressions that match a regular expression

2010-02-06 Thread hzh...@gmail.com
Thanks for your reply. So there isn't such a routine just because some of the regular expressions cannot be enumerated. However, some of them can be enumerated. I guess I have to write a function myself. Zhuo On Feb 6, 5:23 pm, Roy Smith wrote: > In article > , > > > > > >  "hzh...@gmail.com" w

Re: Doctests and decorated methods don't get along

2010-02-06 Thread Steven D'Aprano
On Sat, 06 Feb 2010 14:39:00 -0500, Terry Reedy wrote: > On 2/6/2010 6:48 AM, Steven D'Aprano wrote: >> It seems that doctest doesn't discover or execute doctests in methods >> which have been decorated. [...] > Doctest has to scan the dict, so it does not see the attribute-lookup > result. Aha

Re: new.instancemethod __iter__

2010-02-06 Thread Christian Heimes
Martin Drautzburg wrote: > The first case does what I expected, i.e. it iterates over whatever f() > yields. In the second case nothing is printed. I have the impression > that it still calls the original __iter__() method (the one defined at > the class level). > > Why is that so? > How can I repl

Re: Last M digits of expression A^N

2010-02-06 Thread Mark Dickinson
On Feb 5, 8:14 pm, mukesh tiwari wrote: > I have to find out the last M digits of expression.One thing i can do > is (A**N)%M but my  A and N are too large (10^100) and M is less than > 10^5. The other approach   was  repeated squaring and taking mod of > expression. Is there any other way to do t

Re: merge stdin, stdout?

2010-02-06 Thread jonny lowe
On Feb 5, 11:10 pm, "Gabriel Genellina" wrote: > En Fri, 05 Feb 2010 17:39:07 -0300, jonny lowe > escribió: > > > > > > > On Feb 4, 8:20 pm, exar...@twistedmatrix.com wrote: > >> On 01:56 am, jonny.lowe.12...@gmail.com wrote: > >> >What I want is to have an easy way tomergeinput.txt and thestdout

Re: new.instancemethod __iter__

2010-02-06 Thread Steven D'Aprano
On Sat, 06 Feb 2010 23:53:53 +0100, Martin Drautzburg wrote: > Hello all > > When I create an Object and set its __iter__ method from outside > > s = Sequence #one of my own classes > s.__iter__ = new.instancemethod(f,s,Sequence) I'm confused as to why you are aliasing your class before changin

Re: TABS in the CPython C source code

2010-02-06 Thread Antoine Pitrou
Le Sat, 06 Feb 2010 22:26:55 +, Benjamin Peterson a écrit : > Neil Hodgson gmail.com> writes: >>This would damage the usefulness of source control histories (svn >> annotate) as all of the converted lines would show this recent cosmetic >> change rather than the previous change which is li

Re: Doctests and decorated methods don't get along

2010-02-06 Thread Steven D'Aprano
On Sat, 06 Feb 2010 14:00:28 -0500, John Posner wrote: > On 2/6/2010 6:48 AM, Steven D'Aprano wrote: >> class MyStaticMethod(object): >> """Emulate built-in staticmethod descriptor.""" >> def __init__(self, f): >> self.f = f >> def __get__(self, obj, objtype=None): >>

Re: Last M digits of expression A^N

2010-02-06 Thread Dave Angel
monkeys paw wrote: mukesh tiwari wrote: Hello everyone. I am kind of new to python so pardon me if i sound stupid. I have to find out the last M digits of expression.One thing i can do is (A**N)%M but my A and N are too large (10^100) and M is less than 10^5. The other approach was repeated

new.instancemethod __iter__

2010-02-06 Thread Martin Drautzburg
Hello all When I create an Object and set its __iter__ method from outside s = Sequence #one of my own classes s.__iter__ = new.instancemethod(f,s,Sequence) I get different results, depending on whether I call for x in y.__iter__(): print x or for x in y: print x The first case does

Re: How to print all expressions that match a regular expression

2010-02-06 Thread Ben Finney
Roy Smith writes: > "hzh...@gmail.com" wrote: > > What I need is that given a particular regular expression, output > > all the matches. […] > Please enumerate all the strings which match ".*". Use additional > sheets of paper if needed. +1 QOTW -- \ “Are you pondering what I'm ponderi

Re: determining which value is the first to appear five times in a list?

2010-02-06 Thread Terry Reedy
On 2/6/2010 3:25 PM, Wolodja Wentland wrote: On Sat, Feb 06, 2010 at 14:42 -0500, Terry Reedy wrote: On 2/6/2010 2:09 PM, Wolodja Wentland wrote: I think you can use the itertools.groupby(L, lambda el: el[1]) to group elements in your *sorted* list L by the value el[1] (i.e. the identifier) a

Re: Last M digits of expression A^N

2010-02-06 Thread Shashwat Anand
a nice exercise to do can be this problem : http://www.codechef.com/MARCH09/problems/A4/ , it deals with both cases, first and last k digits and can be performed within O(log n) On Sun, Feb 7, 2010 at 3:58 AM, Shashwat Anand wrote: > Yes, it can be done. Have a look at : > http://en.wikipedia.org

Re: TABS in the CPython C source code

2010-02-06 Thread Benjamin Peterson
Alf P. Steinbach start.no> writes: > Anyways, I would suggest converting all those tabs to spaces This has been discussed to death of Python-dev. We use spaces for all new files and tabs for historical reasons in old files. Mixed ones should be converted one way or the other. > > That's much m

Re: Last M digits of expression A^N

2010-02-06 Thread Shashwat Anand
Yes, it can be done. Have a look at : http://en.wikipedia.org/wiki/Modular_exponentiation The algorithm is also mentioned in CLRS.I tried writing my own modular-exponentiation code following CLRS but observed that python pow() function is much more efficient. Have a look at this problem : https://w

Re: TABS in the CPython C source code

2010-02-06 Thread Benjamin Peterson
Neil Hodgson gmail.com> writes: >This would damage the usefulness of source control histories (svn > annotate) as all of the converted lines would show this recent cosmetic > change rather than the previous change which is likely to be a > substantive modification. That's not completely true

Re: How to print all expressions that match a regular expression

2010-02-06 Thread Roy Smith
In article , "hzh...@gmail.com" wrote: > Hi, > > I am a fresh man with python. I know there is regular expressions in > Python. What I need is that given a particular regular expression, > output all the matches. For example, given ³[1|2|3]{2}² as the regular > expression, the program should o

Re: Dreaming of new generation IDE

2010-02-06 Thread Arnaud Delobelle
"Gabriel Genellina" writes: > En Fri, 05 Feb 2010 19:22:39 -0300, bartc escribió: >> "Steve Holden" wrote in message >> news:mailman.1998.1265399766.28905.python-l...@python.org... >>> Arnaud Delobelle wrote: Robert Kern writes: > I prefer Guido's formulation (which, naturally, I

Re: Code snippet: dualmethod descriptor

2010-02-06 Thread Arnaud Delobelle
Steven D'Aprano writes: > On Thu, 04 Feb 2010 00:09:02 -0300, Gabriel Genellina wrote: > >> En Sat, 30 Jan 2010 03:06:18 -0300, Steven D'Aprano >> escribió: >> >>> class dualmethod(object): > [...] > >> Seems useful! >> Perhaps a better place to post it would be >>

how to add pydoc strings to 'Data and other attributes'

2010-02-06 Thread News123
I'm having some problems with pydoc and I was not very sucessful in googling. (probably missng one key word) Is there soemthing like a documentation of pydoc (execpt pydocs output of pydoc, which doesn't seem to answer my question ) I can add docstrings to - the file head - to a class - to a cla

Re: TABS in the CPython C source code

2010-02-06 Thread John Bokma
"Alf P. Steinbach" writes: > Just trying to delve into the CPython source code. > > Pleasant surprise: while e.g. the gcc compiler is written in K&R C > (1975 style C), CPython seems to be written in almost modern C (1989 > and on). > > But, hey, TABS used for indenting, combined haphazardly and

Re: Subclassing datetime.date

2010-02-06 Thread John Bokma
Sir Wilhelm the Sturdy writes: F> Hi all, > > I recently attempted to subclass the datetime.date object resulting in > horror and confusion, before submitting to a has-a relationship. > That's all fine and dandy, but out of curiosity I'd like to know what > I'm missing. > > I was attempting to al

Re: TABS in the CPython C source code

2010-02-06 Thread Neil Hodgson
Alf P. Steinbach: > The size-8 tabs look really bad in an editor configured with tab size 4, > as is common in Windows. I'm concluding that the CPython programmers > configure their Visual Studio's to *nix convention. Most of the core developers use Unix. > Anyways, I would suggest converting

Re: TABS in the CPython C source code

2010-02-06 Thread Alf P. Steinbach
* Andrej Mitrovic: On Feb 6, 9:31 pm, "Alf P. Steinbach" wrote: Just trying to delve into the CPython source code. Pleasant surprise: while e.g. the gcc compiler is written in K&R C (1975 style C), CPython seems to be written in almost modern C (1989 and on). But, hey, TABS used for indenting

Re: TABS in the CPython C source code

2010-02-06 Thread Andrej Mitrovic
On Feb 6, 9:31 pm, "Alf P. Steinbach" wrote: > Just trying to delve into the CPython source code. > > Pleasant surprise: while e.g. the gcc compiler is written in K&R C (1975 style > C), CPython seems to be written in almost modern C (1989 and on). > > But, hey, TABS used for indenting, combined h

Re: Last M digits of expression A^N

2010-02-06 Thread monkeys paw
mukesh tiwari wrote: Hello everyone. I am kind of new to python so pardon me if i sound stupid. I have to find out the last M digits of expression.One thing i can do is (A**N)%M but my A and N are too large (10^100) and M is less than 10^5. The other approach was repeated squaring and taking

Re: PyQt4 designer custom properties - combo box style

2010-02-06 Thread David Boddie
On Saturday 06 February 2010 10:32, Andrew wrote: > I'm attempting to create a drop down property for a custom widget I'm > creating. So when in designer and you scroll down to the custom > properties, under the regular widget properties, one of them would be > a drop down menu. The data to popula

TABS in the CPython C source code

2010-02-06 Thread Alf P. Steinbach
Just trying to delve into the CPython source code. Pleasant surprise: while e.g. the gcc compiler is written in K&R C (1975 style C), CPython seems to be written in almost modern C (1989 and on). But, hey, TABS used for indenting, combined haphazardly and randomly with SPACES used for indenti

optparse print_help question

2010-02-06 Thread mark.wendell
Is there a way to use the optparser parser.print_help() so that it ONLY prints out the options, and NOT the usage? thanks -- http://mail.python.org/mailman/listinfo/python-list

Stephen -- Bruce?

2010-02-06 Thread Alf P. Steinbach
What's this about all the Stephen'ses here? Shouldn't it be Bruce? - Alf (wondering) -- http://mail.python.org/mailman/listinfo/python-list

Re: list.extend([]) Question

2010-02-06 Thread Bruno Desthuilliers
Gerald Britton a écrit : I think it's because when you do ['a'].extend([]) or whatever, the result is whatever the method "extend" returns. But "extend" has no return value It does : it returns None. -- http://mail.python.org/mailman/listinfo/python-list

Re: Your beloved python features

2010-02-06 Thread Bruno Desthuilliers
apeach a écrit : I love intuitive type recognition. no need to 'DIM everything AS Integer' etc.! not to mention the ever hilarious (that is, when you don't have to maintain it) typical Java idiom: EveryThing theEveryThing = new EveryThing(); -- http://mail.python.org/mailman/listinfo/p

Re: Your beloved python features

2010-02-06 Thread Bruce C. Baker
"Terry Reedy" wrote in message news:mailman.1929.1265328905.28905.python-l...@python.org... > Iterators, and in particular, generators. > A killer feature. > > Terry Jan Reedy > Neither unique to Python. And then're the other killer "features" superfluous ":"s and rigid formatting! -- http

Re: Stephen -- Bruce?

2010-02-06 Thread Mensanator
On Feb 4, 5:13 pm, "Alf P. Steinbach" wrote: > What's this about all the Stephen'ses here? > > Shouldn't it be Bruce? Of course. We just call everyone Stephen to avoid confusion. > > - Alf (wondering) -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing parameters in URL

2010-02-06 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : Diez B. Roggisch a écrit : (snip) Making this a post means that you need to resort to javascript to populate & submit a hidden HTML-form. I beg your pardon This is total nonsense. Sorry, posted too fast, John alredy adressed this. -- http://mail.python.o

Re: Passing parameters in URL

2010-02-06 Thread Bruno Desthuilliers
Diez B. Roggisch a écrit : Am 03.02.10 19:11, schrieb John Bokma: Alan Harris-Reid writes: I have a web-page where each row in a grid has edit/delete buttons to enable the user to maintain a selected record on another page. The buttons are in the form of a link with href='/item_edit?id=123',

Re: Passing parameters in URL

2010-02-06 Thread Diez B. Roggisch
Am 04.02.10 01:42, schrieb John Bokma: "Diez B. Roggisch" writes: Am 03.02.10 19:11, schrieb John Bokma: Alan Harris-Reid writes: I have a web-page where each row in a grid has edit/delete buttons to enable the user to maintain a selected record on another page. The buttons are in the fo

Re: Passing command line argument to program from within IDLE?

2010-02-06 Thread Alan Biddle
Terry, CLICK, the light just came on. Knowing that it is writable, I can look at the length to determine whether there are any arguments. If not, I can switch to interactive input within the program, and input the values that way. A few easy extra lines. Whatever works. Thanks!! -- Alan --

Re: Passing command line argument to program from within IDLE?

2010-02-06 Thread Alan Biddle
Yes, that is what I was trying to do. I need to puzzle a bit on the solution, being a newbie. Thanks! -- Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: Google AI Challenge at U of Waterloo

2010-02-06 Thread Man-wai Chang to The Door (24000bps)
Eh? Just about every interesting programming challenge is mostly about algorithm selection. Try some Project Euler for example. Everyone back then has abused the "programming" word to meant doing everything (algorithms (system analysis & design), data structures, coding, testing, documentati

Re: Google AI Challenge at U of Waterloo

2010-02-06 Thread Paul Rubin
"Man-wai Chang to The Door (24000bps)" writes: > It's definitely *not* exactly a programming challenge, but algorithm > challenge. > A programming (only) challenge should only require the players to > write codes to implement an algorithm. Eh? Just about every interesting programming challenge i

Re: Google AI Challenge at U of Waterloo

2010-02-06 Thread Jeff Cameron
On Feb 5, 11:18 pm, "Man-wai Chang to The Door (24000bps)" wrote: > On 06-Feb-10 08:02, Forthminder wrote: > > > Contest runs from 4 February to 26 February 2010. > >http://csclub.uwaterloo.ca/contest/problem_description.php > > Bonne Chance! > > It's definitely *not* exactly a programming challen

Re: Google AI Challenge at U of Waterloo

2010-02-06 Thread John Nagle
Forthminder wrote: ... Ignore. Well-known nut. See "http://www.nothingisreal.com/mentifex_faq.html"; John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Google AI Challenge at U of Waterloo

2010-02-06 Thread Andrej Mitrovic
Sweet, something to keep my brain busy for the next couple of weeks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Building a multiline string

2010-02-06 Thread Duncan Booth
lallous wrote: > Now should I be using method 2 or 3 in production code? Also Method1a: # Method1a x = ("line1" + # can use comments! "line2"+ "line3") Use Method1a or Method3 as you prefer: either of these generates a single string constant. Method2 is dumb. -- http://mail.python.

Need installer recommendation

2010-02-06 Thread Alan Biddle
Hi, I could use a recommendation on a free installer for use by an unsophisticated programmer, that would be me, for some simple programs which are a bit more than "Hello World," but only a little. Basically reading text files and processing the results. Nothing fancy. I am using PY2EXE to crea

How Uninstall MatPlotLib?

2010-02-06 Thread W. eWatson
See Subject. -- http://mail.python.org/mailman/listinfo/python-list

Google AI Challenge at U of Waterloo

2010-02-06 Thread Forthminder
Contest runs from 4 February to 26 February 2010. You may choose a programming language, such as Java, C++, Python, Ruby or Haskell. See details at http://csclub.uwaterloo.ca/contest/problem_description.php Bonne Chance! Mentifex -- http://www.scn.org/~mentifex/mindforth.txt -- http://mail.py

Re: determining which value is the first to appear five times in a list?

2010-02-06 Thread Wolodja Wentland
On Sat, Feb 06, 2010 at 14:42 -0500, Terry Reedy wrote: > On 2/6/2010 2:09 PM, Wolodja Wentland wrote: > >I think you can use the itertools.groupby(L, lambda el: el[1]) to group > >elements in your *sorted* list L by the value el[1] (i.e. the > >identifier) and then iterate through these groups un

Subclassing datetime.date

2010-02-06 Thread Sir Wilhelm the Sturdy
Hi all, I recently attempted to subclass the datetime.date object resulting in horror and confusion, before submitting to a has-a relationship. That's all fine and dandy, but out of curiosity I'd like to know what I'm missing. I was attempting to allow more flexible instancing of an object, like

Re: how to fix bugs (python)

2010-02-06 Thread Shashwat Anand
Thanks Terry. I am looking on it. :) On Sun, Feb 7, 2010 at 1:19 AM, Terry Reedy wrote: > On 2/6/2010 1:54 PM, Shashwat Anand wrote: > >> I am interested in fixing bugs in python. Are there entry-level bugs in >> python which makes me familiarize with the process just like gnome have >> gnome-l

Re: how to fix bugs (python)

2010-02-06 Thread Terry Reedy
On 2/6/2010 1:54 PM, Shashwat Anand wrote: I am interested in fixing bugs in python. Are there entry-level bugs in python which makes me familiarize with the process just like gnome have gnome-love ? Just a small start-up guidance will be a big favour as I have never fixed any. Go to python.org

Re: determining which value is the first to appear five times in a list?

2010-02-06 Thread Terry Reedy
On 2/6/2010 2:09 PM, Wolodja Wentland wrote: On Sat, Feb 06, 2010 at 13:24 -0500, Chris Colbert wrote: [(match_val_291, identifier_b), (match_val_23, identifier_b), (match_val_22, identifer_k) ] Now, what I would like to do is step through this list and find the identifier which appears fi

How to print all expressions that match a regular expression

2010-02-06 Thread hzh...@gmail.com
Hi, I am a fresh man with python. I know there is regular expressions in Python. What I need is that given a particular regular expression, output all the matches. For example, given “[1|2|3]{2}” as the regular expression, the program should output all 9 matches, i.e., "11 12 13 21 22 23 31 32 33"

Re: intolerant HTML parser

2010-02-06 Thread Jim
Thank you, John. I did not find that by looking around; I must not have used the right words. The speed of the unit tests are not critical so this seems like the solution for me. Jim -- http://mail.python.org/mailman/listinfo/python-list

Re: Doctests and decorated methods don't get along

2010-02-06 Thread Terry Reedy
On 2/6/2010 6:48 AM, Steven D'Aprano wrote: It seems that doctest doesn't discover or execute doctests in methods which have been decorated. Here is my test file: # == class MyStaticMethod(object): """Emulate built-in staticmethod descriptor.""" def __init__(self, f): se

  1   2   >