Re: How do I give a decorator acces to the class of a decorated function

2019-09-04 Thread dieter
Antoon Pardon writes: > What I am trying to do is the following. > > class MyClass (...) : > @register > def MyFunction(...) > ... > > What I would want is for the register decorator to somehow create/mutate > class variable(s) of MyClass. > > Is that possible or do I have to rethi

Re: pandas loc on str lower for column comparison

2019-09-04 Thread Sayth Renshaw
On Sunday, 1 September 2019 10:48:54 UTC+10, Sayth Renshaw wrote: > I've created a share doc same structure anon data from my google drive. > > https://drive.google.com/file/d/0B28JfFTPNr_lckxQRnFTRF9UTEFYRUVqRWxCNVd1VEZhcVNr/view?usp=sharing > > Sayth I tried creating the df1 dataframe by usin

Re: Formatting floating point

2019-09-04 Thread DL Neil via Python-list
On 5/09/19 5:12 AM, Dave via Python-list wrote: ... My question is why, and where do I find a reliable source of information on formatting numbers?  Not interested in replacement values like '{} {}'.format(1, 2). Agreed: there's ton(ne)s of information 'out there', much of it old, eg Python

Re: How to remove a string from a txt file?

2019-09-04 Thread Tobiah
On 9/4/19 8:08 AM, Spencer Du wrote: Hi I want to remove a string from a txt file and then print out what I have removed. How do I do this. The txt file is in this format and should be kept in this format. txt.txt: laser,cameras, Thanks Do you want to remove one of the fields by using an

Re: How to remove a string from a txt file?

2019-09-04 Thread DL Neil via Python-list
On 5/09/19 3:08 AM, Spencer Du wrote: Hi I want to remove a string from a txt file and then print out what I have removed. How do I do this. The txt file is in this format and should be kept in this format. txt.txt: laser,cameras, Is this a homework assignment? What code do you have so far

Re: How to remove a string from a txt file?

2019-09-04 Thread Joel Goldstick
On Wed, Sep 4, 2019 at 11:11 AM Spencer Du wrote: > > Hi > > I want to remove a string from a txt file and then print out what I have > removed. How do I do this. > > The txt file is in this format and should be kept in this format. > > txt.txt: > laser,cameras, > > Thanks > -- > https://mail.pyt

CVE-2019-9636 - Can this be exploit over the wire?

2019-09-04 Thread Barry Scott
I have been looking into CVE-2019-9636 and I'm not sure that python code that works in bytes is vulnerable to this. The "trick" that to make the CVE dangerous assumes that you have a unicode string with \uff03 (FULLWIDTH NUMBER SIGN') that under NFKC turns into '#'. The discussion in https://bugs

Re: Formatting floating point

2019-09-04 Thread Dave via Python-list
On 9/4/19 1:38 PM, Rhodri James wrote: On 04/09/2019 18:12, Dave via Python-list wrote: My question is why, and where do I find a reliable source of information on formatting numbers?  Not interested in replacement values like '{} {}'.format(1, 2). Here: https://docs.python.org/3/library/str

Re: Formatting floating point

2019-09-04 Thread Dave via Python-list
On 9/4/19 1:25 PM, Chris Angelico wrote: On Thu, Sep 5, 2019 at 3:16 AM Dave via Python-list wrote: All, I have been going in circles trying to format a floating point number so there is only 1 decimal place. In reading all of the gobble-gook that passes for Python advice, it looked like I s

Re: Formatting floating point

2019-09-04 Thread Rhodri James
On 04/09/2019 18:12, Dave via Python-list wrote: My question is why, and where do I find a reliable source of information on formatting numbers?  Not interested in replacement values like '{} {}'.format(1, 2). Here: https://docs.python.org/3/library/string.html#format-specification-mini-langu

Re: Formatting floating point

2019-09-04 Thread Chris Angelico
On Thu, Sep 5, 2019 at 3:16 AM Dave via Python-list wrote: > > All, > > I have been going in circles trying to format a floating point number so > there is only 1 decimal place. In reading all of the gobble-gook that > passes for Python advice, it looked like I should have done this: > > numStr =

Formatting floating point

2019-09-04 Thread Dave via Python-list
All, I have been going in circles trying to format a floating point number so there is only 1 decimal place. In reading all of the gobble-gook that passes for Python advice, it looked like I should have done this: numStr = '3.14159' num = float(numstr) # OK so far numFmt = format(num, '{

Re: Proper way to pass Queue to process when using multiprocessing.imap()?

2019-09-04 Thread Chris Angelico
On Thu, Sep 5, 2019 at 2:07 AM Israel Brewster wrote: > > > > > On Sep 3, 2019, at 11:09 AM, Israel Brewster wrote: > > > >> > >> On Sep 3, 2019, at 10:49 AM, Peter Otten <__pete...@web.de> wrote: > >> > >> Israel Brewster wrote: > >> > >>> When using pool.imap to apply a function over a list of

Re: Proper way to pass Queue to process when using multiprocessing.imap()?

2019-09-04 Thread Israel Brewster
> > On Sep 3, 2019, at 11:09 AM, Israel Brewster wrote: > >> >> On Sep 3, 2019, at 10:49 AM, Peter Otten <__pete...@web.de> wrote: >> >> Israel Brewster wrote: >> >>> When using pool.imap to apply a function over a list of values, what is >>> the proper way to pass additional arguments to the

Re: How to only read words within brackets/ parentheses (in .txt file) using Python

2019-09-04 Thread Peter Otten
A S wrote: > I understand that reading lines in .txt files would look something like > this in Python: > > > with open('filename','r') as fd: >lines = fd.readlines() > > > However, how do I run my code to only read the words in my .txt files that > are within each balanced parenthesis? >

Re: How do I give a decorator acces to the class of a decorated function

2019-09-04 Thread Peter Otten
Antoon Pardon wrote: > What I am trying to do is the following. > > class MyClass (...) : > @register > def MyFunction(...) > ... > > What I would want is for the register decorator to somehow create/mutate > class variable(s) of MyClass. > > Is that possible or do I have to ret

How to only read words within brackets/ parentheses (in .txt file) using Python

2019-09-04 Thread A S
I understand that reading lines in .txt files would look something like this in Python: with open('filename','r') as fd: lines = fd.readlines() However, how do I run my code to only read the words in my .txt files that are within each balanced parenthesis? I am not sure how to go about it

How to remove a string from a txt file?

2019-09-04 Thread Spencer Du
Hi I want to remove a string from a txt file and then print out what I have removed. How do I do this. The txt file is in this format and should be kept in this format. txt.txt: laser,cameras, Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: How do I give a decorator acces to the class of a decorated function

2019-09-04 Thread Chris Angelico
On Thu, Sep 5, 2019 at 12:23 AM Antoon Pardon wrote: > > What I am trying to do is the following. > > class MyClass (...) : > @register > def MyFunction(...) > ... > > What I would want is for the register decorator to somehow create/mutate > class variable(s) of MyClass. > > Is th

Re: How do I give a decorator acces to the class of a decorated function

2019-09-04 Thread Rhodri James
On 04/09/2019 15:21, Antoon Pardon wrote: What I am trying to do is the following. class MyClass (...) : @register def MyFunction(...) ... What I would want is for the register decorator to somehow create/mutate class variable(s) of MyClass. Is that possible or do I have to

How do I give a decorator acces to the class of a decorated function

2019-09-04 Thread Antoon Pardon
What I am trying to do is the following. class MyClass (...) : @register def MyFunction(...) ... What I would want is for the register decorator to somehow create/mutate class variable(s) of MyClass. Is that possible or do I have to rethink my approach? -- Antoon Pardon. -- h

failed to install anaconda packages

2019-09-04 Thread Mangwendeza Simbarashe
-- https://mail.python.org/mailman/listinfo/python-list