Re: Python equivalent of Perl's $/

2007-08-20 Thread John K Masters
On 19:19 Mon 20 Aug , [EMAIL PROTECTED] wrote: > > import StringIO > > text = """\ > To mimic Perl's input record separator in > Python, you can use a generator. > And a substring test. > Perhaps something like the following > is what you wanted. > """ > > mockfile = StringIO.StringIO(text)

Re: Python equivalent of Perl's $/

2007-08-20 Thread John K Masters
On 10:30 Mon 20 Aug , Nick Craig-Wood wrote: > Something like this maybe? > > import re > > input_data = """I am currently working my way through Jeffrey Friedl's book > Mastering > Regular Expressions. Great book apart from the fact it uses Perl for the > examples. > > One particular expre

Python equivalent of Perl's $/

2007-08-20 Thread John K Masters
I am currently working my way through Jeffrey Friedl's book Mastering Regular Expressions. Great book apart from the fact it uses Perl for the examples. One particular expression that interests me is '$/ = ".\n"' which, rather than splitting a file into lines, splits on a period-newline boundary.

Re: replacement for string.printable

2007-08-15 Thread John K Masters
On 19:03 Wed 15 Aug , Marc 'BlackJack' Rintsch wrote: > On Wed, 15 Aug 2007 19:56:01 +0100, John K Masters wrote: > > > From what I have read the string module is obsolete and [???] > > The `string` module isn't obsolete. It even contains a more or less

replacement for string.printable

2007-08-15 Thread John K Masters
>From what I have read the string module is obsolete and should not be used but I am working on a project that parses printable files created in a DOS program and creates a web page for each file. I am using the string.printable constant to determine which characters should be kept; the files conta

Re: negative polar axis

2007-08-13 Thread John K Masters
On 10:58 Mon 13 Aug , Erik Max Francis wrote: > Steve Holden wrote: > > > About the best interpretation I can think of is to add 180 degrees to > > the angle and reverse the sign of the magnitude, but this would be a > > hack. Where are those coordinates coming from? > > Well, sometimes in

Re: Puzzled by "is"

2007-08-09 Thread John K Masters
On 15:53 Thu 09 Aug , Steve Holden wrote: > Dick Moores wrote: > > At 10:46 AM 8/9/2007, Bill Scherer wrote: > >> Dick Moores wrote: > [...] > >> There is only one empty tuple. > >> Does that clear it up for you? > > > > But isn't that the same as saying, "That's just the reality of > > Pytho

Re: Wing IDE for Python v. 3.0 beta1 released

2007-08-02 Thread John K Masters
On 08:00 Thu 02 Aug , [EMAIL PROTECTED] wrote: > On Aug 1, 6:42 pm, John K Masters <[EMAIL PROTECTED]> wrote: > > To suggest that, because the autocompletion worked on one method of a > > module and not on another was because I had not configured the > > PYTH

Re: Wing IDE for Python v. 3.0 beta1 released

2007-08-02 Thread John K Masters
On 18:23 Wed 01 Aug , Steve Holden wrote: > Joshua J. Kugler wrote: > > On Wednesday 01 August 2007 13:53, Robert Dailey wrote: > >> He's secretly an employee of Wing IDE in disguise!!! > > > > Sorry to destroy your conspiracy theories, but no, I've never been employed > > by Wing IDE in any f

Re: Wing IDE for Python v. 3.0 beta1 released

2007-08-01 Thread John K Masters
On 13:45 Wed 01 Aug , Joshua J. Kugler wrote: > On Wednesday 01 August 2007 13:28, John K Masters wrote: > > > On 15:34 Tue 31 Jul , Wingware wrote: > >> Hi, > >> > >> I'm happy to announce the first beta release of Wing IDE 3.0. It is >

Re: Wing IDE for Python v. 3.0 beta1 released

2007-08-01 Thread John K Masters
On 15:34 Tue 31 Jul , Wingware wrote: > Hi, > > I'm happy to announce the first beta release of Wing IDE 3.0. It is > available from http://wingware.com/wingide/beta > If their support for paid customers is anything like their support for prospective customers then I would leave well alone.

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread John K Masters
On 16:33 Thu 26 Jul , brad wrote: > [EMAIL PROTECTED] wrote: > > Python is a better language, with php support, anyway, but I am fed up > > with attitudes of comp.lang.perl.misc. Assholes in this newsgroup ruin > > Perl experience for everyone. Instead of being helpful, snide remarks, > > back-

Re: sqlite tuples

2007-07-17 Thread John K Masters
On 17:30 Tue 17 Jul , Carsten Haese wrote: > On Tue, 2007-07-17 at 21:49 +0100, John K Masters wrote: > > I am fairly new to Python and am trying to get to grips with pysqlite2. > > >From what I have read data is returned as a list of tuples when using > > SELECT via c

sqlite tuples

2007-07-17 Thread John K Masters
I am fairly new to Python and am trying to get to grips with pysqlite2. >From what I have read data is returned as a list of tuples when using SELECT via connection.cursor. But I have not, despite frantic googling, found how to INSERT a list of tuples into a sqlite table. If I convert the tuple to

Re: ten small Python programs

2007-05-26 Thread John K Masters
On 11:43 Sat 26 May , Steve Howell wrote: > I've always thought that the best way to introduce new > programmers to Python is to show them small code > examples. > > When you go to the tutorial, though, you have to wade > through quite a bit of English before seeing any > Python examples. >

Re: GUI tutorial

2007-05-14 Thread John K Masters
On 15:03 Mon 14 May , Jarek Zgoda wrote: > John K Masters napisaƂ(a): > > > Can someone point me in the direction of a good tutorial on programming > > python with a GUI? I'm just starting out with python and have written a > > few scripts successfully but would

GUI tutorial

2007-05-13 Thread John K Masters
Can someone point me in the direction of a good tutorial on programming python with a GUI? I'm just starting out with python and have written a few scripts successfully but would like to add a graphical front end to them to make it easier for my work colleagues, most of whom have never used a comma