Re: Getting back into PyQt and not loving it.

2016-06-27 Thread codewizard
On Sunday, June 26, 2016 at 5:45:18 PM UTC-4, Michael Torrie wrote: > > Qt's a fantastic toolkit, and the most mature of any of them, and the > most portable, but man the bindings are not Pythonic at all. Enaml feels pretty Pythonic to me: https://github.com/nucleic/enaml --

Re: Continuing indentation

2016-03-02 Thread codewizard
On Wednesday, March 2, 2016 at 3:44:07 PM UTC-5, Skip Montanaro wrote: > > if (some_condition and > some_other_condition and > some_final_condition): > play_bingo() How about: continue_playing = ( some_condition and some_other_condition and

Re: Two-Dimensional Expression Layout

2016-08-19 Thread codewizard
On Friday, August 19, 2016 at 6:38:34 PM UTC-4, Chris Angelico wrote: > On Sat, Aug 20, 2016 at 8:31 AM, Lawrence D’Oliveiro > wrote: > > On Saturday, August 20, 2016 at 9:56:05 AM UTC+12, codew...@gmail.com wrote: > >> > >> On Friday, August 19, 2016 at 5:30:22 PM UTC-4,

Re: Two-Dimensional Expression Layout

2016-08-19 Thread codewizard
On Friday, August 19, 2016 at 5:30:22 PM UTC-4, Lawrence D’Oliveiro wrote: > On Saturday, August 20, 2016 at 7:52:09 AM UTC+12, codew...@gmail.com wrote: > > if any([ > > not isinstance(src, Image), > > mask != None and not isinstance(mask, Image), > > not

Re: Two-Dimensional Expression Layout

2016-08-19 Thread codewizard
For some special cases, I prefer the versions below. On Friday, August 19, 2016 at 4:56:31 AM UTC-4, Lawrence D’Oliveiro wrote: > [snip] > > Computing a variable value (using redundant parentheses to avoid > backslash-continuations): > > dest_rect = \ > ( > draw_bounds

Re: What do you think: good idea to launch a marketplace on python+django?

2016-12-02 Thread codewizard
On Friday, December 2, 2016 at 2:01:57 AM UTC-5, Gus_G wrote: > Hello, what do you think about building a marketplace website on connection > of python+django? End effect-side should look and work similar to these: > https://zoptamo.com/uk/s-abs-c-uk, https://www.ownerdirect.com/ . What are >

Re: pandas creating a new column based on row values

2017-03-28 Thread codewizard
On Tuesday, March 28, 2017 at 3:36:57 PM UTC-4, zlju...@gmail.com wrote: > [snip] > > Can I somehow generate a new column by concatenating values for the other > columns in a row? > Try this (not tested): def myfunc(row): return 'Start_{}_{}_{}_{}_End'.format(row['coverage'], row['name'],

Re: @lru_cache on functions with no arguments

2017-07-31 Thread codewizard
On Monday, July 31, 2017 at 7:31:52 PM UTC-4, t...@tomforb.es wrote: > As part of the Python 3 cleanup in Django there are a fair few uses of > @functools.lru_cache on functions that take no arguments. A lru_cache isn't > strictly needed here, but it's convenient to just cache the result. Some

Re: Out of memory while reading excel file

2017-05-12 Thread codewizard
On Thursday, May 11, 2017 at 5:01:57 AM UTC-4, Mahmood Naderan wrote: > Excuse me, I changed > > csv.writer(outstream) > > to > > csv.writer(outstream, delimiter =' ') > > > It puts space between cells and omits "" around some content. However, > between two lines there is a new empty

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread codewizard
On Sunday, January 28, 2018 at 3:27:06 PM UTC-5, Chris Angelico wrote: > On Mon, Jan 29, 2018 at 7:13 AM, Chris Warrick wrote: > > On 28 January 2018 at 20:19, Chris Angelico wrote: > >> The vanilla Windows console (conhost.exe IIRC) is far from ideal for > >>

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Gro

2018-02-09 Thread codewizard
On Saturday, February 3, 2018 at 7:15:16 PM UTC-5, pyotr filipivich wrote: > [snip] > Those of us who do not use google-groups may not notice the loss > of the google groupies. I use GG to read comp.lang.python because of the following combination of factors. I would definitely be happier

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Gro

2018-02-09 Thread codewizard
On Friday, February 9, 2018 at 2:48:17 PM UTC-5, Chris Green wrote: > codew...@gmail.com wrote: > > On Saturday, February 3, 2018 at 7:15:16 PM UTC-5, pyotr filipivich wrote: > > > [snip] > > > Those of us who do not use google-groups may not notice the loss > > > of the google groupies. >

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Gro

2018-02-09 Thread codewizard
On Friday, February 9, 2018 at 5:03:45 PM UTC-5, Richard Damon wrote: > On 2/9/18 4:12 PM, Chris Angelico wrote: > > On Sat, Feb 10, 2018 at 8:05 AM, wrote: > >> On Friday, February 9, 2018 at 2:48:17 PM UTC-5, Chris Green wrote: > >>> codew...@gmail.com wrote: > On

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Gro

2018-02-09 Thread codewizard
On Friday, February 9, 2018 at 6:45:18 PM UTC-5, Richard Damon wrote: > On 2/9/18 6:19 PM, codew...@gmail.com wrote: > > On Friday, February 9, 2018 at 5:03:45 PM UTC-5, Richard Damon wrote: > >> On 2/9/18 4:12 PM, Chris Angelico wrote: > >>> On Sat, Feb 10, 2018 at 8:05 AM,

Re: translating foreign data

2018-06-21 Thread codewizard
On Thursday, June 21, 2018 at 1:08:35 PM UTC-4, Ethan Furman wrote: > I need to translate numeric data in a string format into a binary format. I > know there are at least two different > methods of representing parts less that 1, such as "10.5" and "10,5". The > data is encoded using code

Re: variable scope in try ... EXCEPT block.

2018-07-12 Thread codewizard
On Thursday, July 12, 2018 at 5:45:52 AM UTC-4, Ben Bacarisse wrote: > aleiphoenix writes: > > [snip] > > When an exception has been assigned using as target, it is cleared at > the end of the except clause. This is as if > > except E as N: > foo > > was translated to > >

Re: variable scope in try ... EXCEPT block.

2018-07-12 Thread codewizard
On Thursday, July 12, 2018 at 7:16:48 PM UTC-4, Chris Angelico wrote: > On Fri, Jul 13, 2018 at 8:10 AM Igor wrote: > > On Thursday, July 12, 2018 at 5:45:52 AM UTC-4, Ben Bacarisse wrote: > >> aleiphoenix writes: > >> > >> [snip] > >> > >> When an exception has been assigned using as target, it

Re: Can mock.mock_open.read return different values?

2018-03-12 Thread codewizard
On Monday, March 12, 2018 at 4:51:53 AM UTC-4, Tim Golden wrote: > I'm contributing to a codebase which makes heavy use of mock in the test > suite, a technique which I'm aware of but have used only rarely. In one > situation it uses mock.mock_open(read_data="...") and then asserts again >

Re: Pandas, create new column if previous column(s) are not in [None, '', np.nan]

2018-04-11 Thread codewizard
On Wednesday, April 11, 2018 at 2:49:01 PM UTC-4, zlju...@gmail.com wrote: > I have a dataframe: > > import pandas as pd > import numpy as np > > df = pd.DataFrame( { 'A' : ['a', 'b', '', None, np.nan], > 'B' : [None, np.nan, 'a', 'b', '']}) > > A B > 0 a

Re: Style Q: Instance variables defined outside of __init__

2018-03-20 Thread codewizard
On Tuesday, March 20, 2018 at 1:10:19 PM UTC-4, Irv Kalb wrote: > I am aware of all the issues involved. My example code was an attempt to > demonstrate the clearest, simplest case possible. My question is not about > this small case. In classes designed for full games, I often have a "reset"

Re: From Mathematica to Jypyter

2018-10-10 Thread codewizard
On Wednesday, October 10, 2018 at 12:09:41 PM UTC-4, Rhodri James wrote: > On 10/10/18 08:32, Robin Becker wrote: > > > > I'm a great fan of erroneous spelling and this blog needs a spelling > > check as this quote shows > > > > "Mathematica exemplifies the horde of new Vandals whose pursuit of

Re: Spread a statement over various lines

2019-09-18 Thread codewizard
On Wednesday, September 18, 2019 at 9:01:21 AM UTC-4, Manfred Lotz wrote: > On Wed, 18 Sep 2019 08:30:08 +0200 > Peter Otten <__pete...@web.de> wrote: > > > Manfred Lotz wrote: > > > > > I have a function like follows > > > > > > def regex_from_filepat(fpat): > > > rfpat = fpat.replace('.',