Re: Compiling new Pythons on old Windows compilers

2017-03-12 Thread Michael Torrie
On 03/12/2017 09:26 PM, Michael Torrie wrote: > On 03/12/2017 02:45 PM, eryk sun wrote: >> On Sun, Mar 12, 2017 at 5:02 PM, Eric Frederich >> wrote: >>> Any idea why compatibility was dropped recently? There used to be a PC >>> directory with different VS directories in the source tree, now it is

Re: Compiling new Pythons on old Windows compilers

2017-03-12 Thread Michael Torrie
On 03/12/2017 02:45 PM, eryk sun wrote: > On Sun, Mar 12, 2017 at 5:02 PM, Eric Frederich > wrote: >> Any idea why compatibility was dropped recently? There used to be a PC >> directory with different VS directories in the source tree, now it isn't >> there any more. > > CPython 3.5+ uses the Un

Re: When will os.remove fail?

2017-03-12 Thread Steve D'Aprano
On Mon, 13 Mar 2017 05:45 am, Alain Ketterlin wrote: > Steve D'Aprano writes: [...] >> It seems that os.remove on Linux will force the delete even if the file >> is read-only or unreadable, provided you own the file. > > Your permissions on the file do not really matters. It's all about your > p

Re: How to iterate through the columns in a row using sqlite3.Row

2017-03-12 Thread Paul Rubin
Chris Green writes: > self.conn = sqlite3.connect(dbname) > self.conn.row_factory = sqlite3.Row > self.cursor = self.conn.cursor() > self.table = table > ... > ... > sql = "SELECT * FROM " + self.table + " WHERE firstName||lastName = ?" >

Substitute a mock object for the metaclass of a class

2017-03-12 Thread Ben Finney
How can I override the metaclass of a Python class, with a `unittest.mock.MagicMock` instance instead? I have a function whose job involves working with the metaclass of an argument:: # lorem.py class Foo(object): pass def quux(existing_class): … metaclass =

Re: How to iterate through the columns in a row using sqlite3.Row

2017-03-12 Thread MRAB
On 2017-03-12 22:44, Chris Green wrote: This should be simple but I can't manage it at the moment! :-) I have opened a database connection and have set the row_factory to sqlite3.Row. So how do I actually iterate through a row of data having used fetchone to read a row. I.e. I have:-

Re: Does one create an event to notify parent window/GUI of something?

2017-03-12 Thread Michael Torrie
On 03/12/2017 06:14 AM, Chris Green wrote: > There are (of course) event handlers for the 'Save' and 'Cancel' > button click events in abookeditgui, what I need is hooks from these > to run some code in abookgui after the abookeditgui has completed. How > should one do this, is there a way for a cl

How to iterate through the columns in a row using sqlite3.Row

2017-03-12 Thread Chris Green
This should be simple but I can't manage it at the moment! :-) I have opened a database connection and have set the row_factory to sqlite3.Row. So how do I actually iterate through a row of data having used fetchone to read a row. I.e. I have:- self.conn = sqlite3.connect(dbname)

Re: Does one create an event to notify parent window/GUI of something?

2017-03-12 Thread Chris Green
Vlastimil Brom wrote: > 2017-03-12 13:14 GMT+01:00 Chris Green : > ... > > > > This question relates to how one communicates between windows/GUIs. > > > > When the program starts theres a main GUI, class name abookgui. If > > you want to add new entries or modify existing entries an edit GUI is >

Re: Regular expression query

2017-03-12 Thread Vlastimil Brom
2017-03-12 17:22 GMT+01:00 : > Hi All, > > I have a string which looks like > > a,b,c "4873898374", d, ee "3343,23,23,5,,5,45", f > "5546,3434,345,34,34,5,34,543,7" > > It is comma saperated string, but some of the fields have a double quoted > string as part of it (and t

Re: Does one create an event to notify parent window/GUI of something?

2017-03-12 Thread Vlastimil Brom
2017-03-12 13:14 GMT+01:00 Chris Green : ... > > This question relates to how one communicates between windows/GUIs. > > When the program starts theres a main GUI, class name abookgui. If > you want to add new entries or modify existing entries an edit GUI is > started in a separate window, class

Re: Compiling new Pythons on old Windows compilers

2017-03-12 Thread eryk sun
On Sun, Mar 12, 2017 at 5:02 PM, Eric Frederich wrote: > Any idea why compatibility was dropped recently? There used to be a PC > directory with different VS directories in the source tree, now it isn't > there any more. CPython 3.5+ uses the Universal CRT on Windows, which is a system component

Re: Regular expression query

2017-03-12 Thread Tim Chase
On 2017-03-12 09:22, rahulra...@gmail.com wrote: > a,b,c "4873898374", d, ee "3343,23,23,5,,5,45", > f "5546,3434,345,34,34,5,34,543,7" > > It is comma saperated string, but some of the fields have a double > quoted string as part of it (and that double quoted string can ha

Re: When will os.remove fail?

2017-03-12 Thread Alain Ketterlin
Steve D'Aprano writes: > On Linux, if I call os.remove on a file which I own but don't have write > permission on, the file is still deleted: > > > py> f = open('/tmp/no-write', 'w') > py> os.path.exists('/tmp/no-write') > True > py> os.chmod('/tmp/no-write', 0) # Forbid ALL access. > py> os.rem

Re: When will os.remove fail?

2017-03-12 Thread Larry Martell
On Sun, Mar 12, 2017 at 1:48 PM, Steve D'Aprano wrote: > On Linux, if I call os.remove on a file which I own but don't have write > permission on, the file is still deleted: > > > py> f = open('/tmp/no-write', 'w') > py> os.path.exists('/tmp/no-write') > True > py> os.chmod('/tmp/no-write', 0) #

Re: When will os.remove fail?

2017-03-12 Thread Lele Gaifax
Steve D'Aprano writes: > Under what circumstances will os.remove fail to remove a file? > > If you don't own the file and have no write permission, if it is on > read-only media, anything else? I would say that what matter is the permission on the directory containing the file, not on the file i

When will os.remove fail?

2017-03-12 Thread Steve D'Aprano
On Linux, if I call os.remove on a file which I own but don't have write permission on, the file is still deleted: py> f = open('/tmp/no-write', 'w') py> os.path.exists('/tmp/no-write') True py> os.chmod('/tmp/no-write', 0) # Forbid ALL access. py> os.remove('/tmp/no-write') py> os.path.exists('

Re: Regular expression query

2017-03-12 Thread Jussi Piitulainen
rahulra...@gmail.com writes: > Hi All, > > I have a string which looks like > > a,b,c "4873898374", d, ee "3343,23,23,5,,5,45", f > "5546,3434,345,34,34,5,34,543,7" > > It is comma saperated string, but some of the fields have a double > quoted string as part of it (and th

Compiling new Pythons on old Windows compilers

2017-03-12 Thread Eric Frederich
There is a commercial application which allows customizations through a C API. There are 3 different releases of this application each compiled with different versions of Visual Studio, 2008, 2010, and 2012. I'd like to release a customization which embeds a Python interpreter, but I'd like to use

Re: Regular expression query

2017-03-12 Thread Larry Martell
On Sun, Mar 12, 2017 at 12:22 PM, wrote: > Hi All, > > I have a string which looks like > > a,b,c "4873898374", d, ee "3343,23,23,5,,5,45", f > "5546,3434,345,34,34,5,34,543,7" > > It is comma saperated string, but some of the fields have a double quoted > string as part

Regular expression query

2017-03-12 Thread rahulrasal
Hi All, I have a string which looks like a,b,c "4873898374", d, ee "3343,23,23,5,,5,45", f "5546,3434,345,34,34,5,34,543,7" It is comma saperated string, but some of the fields have a double quoted string as part of it (and that double quoted string can have commas). Ab

Re: Does one create an event to notify parent window/GUI of something?

2017-03-12 Thread Chris Green
Dennis Lee Bieber wrote: > On Sun, 12 Mar 2017 12:14:32 +, Chris Green declaimed the > following: > > >This is a rather a beginner question. I'm heavily modifying some code > >that was an LDAP address book to be a sqlite3 based address book. I > >have the basic GUI working and I'm now gett

Does one create an event to notify parent window/GUI of something?

2017-03-12 Thread Chris Green
This is a rather a beginner question. I'm heavily modifying some code that was an LDAP address book to be a sqlite3 based address book. I have the basic GUI working and I'm now getting the database connections to work. This question relates to how one communicates between windows/GUIs. When the