Re: sqlite3 double quote behavior

2022-12-15 Thread John K. Parejko
:58, Chris Angelico wrote: > > On Wed, 14 Dec 2022 at 08:19, Roel Schroeven wrote: >> >> Chris Angelico schreef op 13/12/2022 om 20:01: >>> On Wed, 14 Dec 2022 at 06:00, Roel Schroeven wrote: >>>> >>>> Stefan Ram schreef op 13/12/2022 om 8:42: >

sqlite3 double quote behavior

2022-12-12 Thread John K. Parejko
Asking here before I file an improvement request issue on the python GitHub: sqlite has a known misfeature with double-quoted strings, whereby they will be interpreted as string literals if they don’t match a valid identifier [1]. The note in the sqlite docs describe a way to disable this

[issue47028] Incorrect behaviour when zipping a bunch of maps

2022-03-15 Thread John K.
New submission from John K. : map(f, itr) is supposed to be the lazy way to do [f(val) for val in itr]. However, when unpacking and zipping a list of maps, I get a different result from when evaluating eagerly. More precisely: Python 3.10.2 | packaged by conda-forge | (main, Mar 8 2022, 15

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

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) def

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

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 recent new addition: `Template`. Only

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 polar

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 Python; it is what it

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 fashion, nor

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 PYTHONPATH properly is at least insulting. We

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

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 I've had excellent support from them. I'm sorry to hear your

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-biting,

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: 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 connection.cursor. But I have

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

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 like to add a graphical front end

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