Re: [OT(?)] Ubuntu 18 vim now defaults to 4-space tabs

2019-09-10 Thread Tobiah
Since it does not appear to have "filetype=python" in there, maybe I should have specified "Run vim with a .py filename". Yes, that was a bit that took me a while to figure out! So I used your trick and did: :verbose set shiftwidth? and it revealed: cd /usr/share/vim/vim80/ftplugin A

Announcing Methodfinder

2019-09-10 Thread Bill Six
Sometimes you know the inputs and outputs for a procedure, but you don't remember the name. methodfinder.find tries to find the name. https://github.com/billsix/methodfinder >>> import methodfinder >>> methodfinder.find([]) == 0 len([]) sum([]) >>> methodfinder.find([]) == False any([]) bool([])

Re: [OT(?)] Ubuntu 18 vim now defaults to 4-space tabs

2019-09-10 Thread Eli the Bearded
In comp.lang.python, Tobiah wrote: >> Your subject missed a critical word: vim. > It's there! I added it. > > Run vim. Then ':set' to see what's set different than default. Then, > > if it is tabstop you want to know about, ':verbose set tabstop?' will > > tell you where that setting was last a

Re: Metaclasses and classproperties

2019-09-10 Thread Eko palypse
Thank you for your thoughts. I'm trying to migrating en existing python2 api, which has been build using boost::python with pure python3 code. All of the py2 classes do have these additional properties names and values. You are right, using dict(Ordinal.__members__) for names could have been used

Re: phyton

2019-09-10 Thread Pankaj Jangid
inhahe writes: > On Tue, Sep 10, 2019 at 8:41 AM Pankaj Jangid > wrote: > >> You can do something like this ;-) >> >> >> import math >> >> def add_vat(a, b): >> return math.ceil(100*(a * 0.57 + sum([ord(c) for c in list(b)]) * >> 0.15538))/100 >> >> print(add_vat(101, 'high')) >> print(add_v

Re: Why is "Subscribing to topic topic/test" printed in console log before connect message?

2019-09-10 Thread Chris Angelico
On Wed, Sep 11, 2019 at 3:01 AM Spencer Du wrote: > > Hi > > I have code for publish and subscribe over mqtt. In the console log I have > "Subscribing to topic topic/test" printed before connect message why is this? > I want to this to be printed after the connect message. How do I fix this > p

Re: phyton

2019-09-10 Thread Chris Angelico
On Tue, Sep 10, 2019 at 10:54 PM tim.gast--- via Python-list wrote: > > Op dinsdag 10 september 2019 14:45:58 UTC+2 schreef inhahe: > > On Tue, Sep 10, 2019 at 8:41 AM Pankaj Jangid > > wrote: > > > > > tim.g...@quicknet.nl writes: > > > > > > > For school i need to write the right code to get th

Re: Why is "Subscribing to topic topic/test" printed in console log before connect message?

2019-09-10 Thread MRAB
On 2019-09-10 17:59, Spencer Du wrote: Hi I have code for publish and subscribe over mqtt. In the console log I have "Subscribing to topic topic/test" printed before connect message why is this? I want to this to be printed after the connect message. How do I fix this problem. Please run gui.

Why is "Subscribing to topic topic/test" printed in console log before connect message?

2019-09-10 Thread Spencer Du
Hi I have code for publish and subscribe over mqtt. In the console log I have "Subscribing to topic topic/test" printed before connect message why is this? I want to this to be printed after the connect message. How do I fix this problem. Please run gui.py to test. gui.py import paho.mqtt.cl

Re: phyton

2019-09-10 Thread inhahe
On Tue, Sep 10, 2019 at 12:06 PM tim.gast--- via Python-list < python-list@python.org> wrote: > Op dinsdag 10 september 2019 13:03:46 UTC+2 schreef tim...@quicknet.nl: > > Hi everybody, > > > > For school i need to write the right code to get the following outcome. > > Can someone help me with thi

Re: Metaclasses and classproperties

2019-09-10 Thread Peter Otten
Eko palypse wrote: > I'm fairly new when it comes to metaclass programming and therefore the > question whether the following makes sense or not. > > The goal is to have two additional class properties which return a > dictionary name:class_attribute and value:class_attribute for an IntEnum > cla

Re: [OT(?)] Ubuntu 18 vim now defaults to 4-space tabs

2019-09-10 Thread Tobiah
Your subject missed a critical word: vim. It's there! Run vim. Then ':set' to see what's set different than default. Then, if it is tabstop you want to know about, ':verbose set tabstop?' will tell you where that setting was last altered. Nothing that seems to point to space indent: backg

Re: phyton

2019-09-10 Thread tim.gast--- via Python-list
Op dinsdag 10 september 2019 13:03:46 UTC+2 schreef tim...@quicknet.nl: > Hi everybody, > > For school i need to write the right code to get the following outcome. > Can someone help me with this > I can't find a solution to link the word high to 1.21. > > 11 print(add_vat(101, 'high')) > 12

phyton

2019-09-10 Thread tim.gast--- via Python-list
Hi everybody, For school i need to write the right code to get the following outcome. Can someone help me with this I can't find a solution to link the word high to 1.21. 11 print(add_vat(101, 'high')) 12 print(add_vat(101, 'low')) Outcome: 122.21 110.09 Thanks! -- https://mail.python.org

Metaclasses and classproperties

2019-09-10 Thread Eko palypse
I'm fairly new when it comes to metaclass programming and therefore the question whether the following makes sense or not. The goal is to have two additional class properties which return a dictionary name:class_attribute and value:class_attribute for an IntEnum class and after reading about it I

Python library maintainers: PEP 602 needs your feedback

2019-09-10 Thread Łukasz Langa
Hey there, Python library maintainers! Python is looking into increasing its release cadence. You can read the current proposal here: https://python.org/dev/peps/pep-0602/ More importantly, we need your input. Read the PEP and please let us know what you

Re: phyton

2019-09-10 Thread tim.gast--- via Python-list
Op dinsdag 10 september 2019 14:45:58 UTC+2 schreef inhahe: > On Tue, Sep 10, 2019 at 8:41 AM Pankaj Jangid > wrote: > > > tim.g...@quicknet.nl writes: > > > > > For school i need to write the right code to get the following outcome. > > > Can someone help me with this > > > I can't find a so

Re: phyton

2019-09-10 Thread Frank Millman
On 2019-09-10 2:29 PM, tim.gast--- via Python-list wrote: Op dinsdag 10 september 2019 13:03:46 UTC+2 schreef tim...@quicknet.nl: Hi everybody, For school i need to write the right code to get the following outcome. Can someone help me with this I can't find a solution to link the word high

Re: phyton

2019-09-10 Thread inhahe
On Tue, Sep 10, 2019 at 8:41 AM Pankaj Jangid wrote: > tim.g...@quicknet.nl writes: > > > For school i need to write the right code to get the following outcome. > > Can someone help me with this > > I can't find a solution to link the word high to 1.21. > > > > 11 print(add_vat(101, 'high'))

Re: phyton

2019-09-10 Thread tim.gast--- via Python-list
Op dinsdag 10 september 2019 14:36:13 UTC+2 schreef Pankaj Jangid: > tim.g...@quicknet.nl writes: > > > For school i need to write the right code to get the following outcome. > > Can someone help me with this > > I can't find a solution to link the word high to 1.21. > > > > 11 print(add_vat(

Re: phyton

2019-09-10 Thread Pankaj Jangid
tim.g...@quicknet.nl writes: > For school i need to write the right code to get the following outcome. > Can someone help me with this > I can't find a solution to link the word high to 1.21. > > 11 print(add_vat(101, 'high')) > 12 print(add_vat(101, 'low')) > > Outcome: > > 122.21 > 110.09 >

Re: phyton

2019-09-10 Thread inhahe
On Tue, Sep 10, 2019 at 8:31 AM inhahe wrote: > > > On Tue, Sep 10, 2019 at 8:10 AM tim.gast--- via Python-list < > python-list@python.org> wrote: > >> Op dinsdag 10 september 2019 13:03:46 UTC+2 schreef tim...@quicknet.nl: >> > Hi everybody, >> > >> > For school i need to write the right code to

Re: phyton

2019-09-10 Thread inhahe
On Tue, Sep 10, 2019 at 8:10 AM tim.gast--- via Python-list < python-list@python.org> wrote: > Op dinsdag 10 september 2019 13:03:46 UTC+2 schreef tim...@quicknet.nl: > > Hi everybody, > > > > For school i need to write the right code to get the following outcome. > > Can someone help me with this

Re: phyton

2019-09-10 Thread tim.gast--- via Python-list
Op dinsdag 10 september 2019 13:03:46 UTC+2 schreef tim...@quicknet.nl: > Hi everybody, > > For school i need to write the right code to get the following outcome. > Can someone help me with this > I can't find a solution to link the word high to 1.21. > > 11 print(add_vat(101, 'high')) > 12

Re: phyton

2019-09-10 Thread Joel Goldstick
On Tue, Sep 10, 2019 at 8:10 AM tim.gast--- via Python-list wrote: > > Op dinsdag 10 september 2019 13:03:46 UTC+2 schreef tim...@quicknet.nl: > > Hi everybody, > > > > For school i need to write the right code to get the following outcome. > > Can someone help me with this > > I can't find a

Re: phyton

2019-09-10 Thread tim.gast--- via Python-list
Op dinsdag 10 september 2019 13:03:46 UTC+2 schreef tim...@quicknet.nl: > Hi everybody, > > For school i need to write the right code to get the following outcome. > Can someone help me with this > I can't find a solution to link the word high to 1.21. > > 11 print(add_vat(101, 'high')) > 12

Re: pandas loc on str lower for column comparison

2019-09-10 Thread Piet van Oostrum
Sayth Renshaw writes: >> >> That actually creates another error. >> >> A value is trying to be set on a copy of a slice from a DataFrame. >> Try using .loc[row_indexer,col_indexer] = value instead >> >> See the caveats in the documentation: >> http://pandas.pydata.org/pandas-docs/stable/indexi

Re: phyton

2019-09-10 Thread Piet van Oostrum
tim.g...@quicknet.nl writes: > Hi everybody, > > For school i need to write the right code to get the following outcome. > Can someone help me with this > I can't find a solution to link the word high to 1.21. > > 11 print(add_vat(101, 'high')) > 12 print(add_vat(101, 'low')) > > Outcome: > >

Re: numpy array - convert hex to int

2019-09-10 Thread Piet van Oostrum
Sharan Basappa writes: > On Sunday, 8 September 2019 11:16:52 UTC-4, Luciano Ramalho wrote: >> >>> int('C0FFEE', 16) >> 12648430 >> >> There you go! >> >> On Sun, Sep 8, 2019 at 12:02 PM Sharan Basappa >> wrote: >> > >> > I have a numpy array that has data in the form of hex. >> > I would li

Re: Is it 'fine' to instantiate a widget without parent parameter?

2019-09-10 Thread jfong
Terry Reedy於 2019年9月10日星期二 UTC+8下午5時16分19秒寫道: > On 9/10/2019 12:02 AM, jf...@ms4.hinet.net wrote: > > > Got it. The first Tk object is always the default one no matter where it > > was created. The default one is always the one which the widget > > constructor refer to when required. > > Or on

Re: How to correctly use 'in_' argument in tkinter grid()?

2019-09-10 Thread jfong
Peter Otten於 2019年9月10日星期二 UTC+8下午5時04分27秒寫道: > jf...@ms4.hinet.net wrote: > > > I had tried the following script test.py: > > > > import tkinter as tk > > > > class Demo(tk.Frame): > > def __init__(self): > > tk.Frame.__init__(self, name='demo') > > self.pack() > >

Re: issue in handling CSV data

2019-09-10 Thread Piet van Oostrum
Sharan Basappa writes: >> >> Note that the commas are within the quotes. I'd say Andrea is correct: >> This is a tab-separated file, not a comma-separated file. But for some >> reason all fields except the last end with a comma. >> However, genfromtxt is not a full-fledged CSV parser. It does

Re: Is it 'fine' to instantiate a widget without parent parameter?

2019-09-10 Thread Terry Reedy
On 9/10/2019 12:02 AM, jf...@ms4.hinet.net wrote: Got it. The first Tk object is always the default one no matter where it was created. The default one is always the one which the widget constructor refer to when required. Or one can call tkinter.NoDefaultRoot() and not worry about default

Re: How to correctly use 'in_' argument in tkinter grid()?

2019-09-10 Thread Peter Otten
jf...@ms4.hinet.net wrote: > I had tried the following script test.py: > > import tkinter as tk > > class Demo(tk.Frame): > def __init__(self): > tk.Frame.__init__(self, name='demo') > self.pack() > > panel = tk.Frame(self, name='panel') > pan

Re: UserList from module collections

2019-09-10 Thread Gregory Ewing
ast wrote: So what UserList is used for ? It's mostly a leftover from the days when you couldn't subclass built-in types. But it can still be useful if you want a custom sequence object that doesn't inherit all of the built-in list type's behaviour. -- Greg -- https://mail.python.org/mailman/

Re: issue in handling CSV data

2019-09-10 Thread Gregory Ewing
Sharan Basappa wrote: Now, if you see the print after getting the data, it looks like this: ## [['"\t"81' '"\t5c'] ['"\t"04' '"\t11'] ['"\t"e1' '"\t17'] ['"\t"6a' '"\t6c'] ['"\t"53' '"\t69'] ['"\t"98' '"\t87'] ['"\t"5c' '"\t4b'] #

UserList from module collections

2019-09-10 Thread ast
Hello I read in a course that class UserList from module collections can be used to create our own custom list Example >>> from collections import UserList >>> class MyList(UserList): ... def head(self): ... return self.data[0] ... def queue(self): ... return self.data[1