Re: .title() - annoying mistake

2021-03-22 Thread Karen Shaeffer via Python-list
Hi Chris, Thanks for your comment. > Python doesn't work with UTF-8 encoded code points; it works with > Unicode code points. Are you looking for something that checks whether > something is a palindrome, or locates palindromes within it? > > def is_palindrome(txt): >return txt == txt[::-1] >

Re: .title() - annoying mistake

2021-03-19 Thread Karen Shaeffer via Python-list
> On Mar 19, 2021, at 9:42 AM, Grant Edwards wrote: > > On 2021-03-19, Skip Montanaro wrote: >>> >>> That's annoying. You have to roll your own solution! >>> >> >> Certainly seems like a known issue: >> >> https://bugs.python.org/issue12737 > > While that is an issue with string.title(),

Re: What's the meaning the "backlog" in the socket.listen(backlog) is?

2021-02-17 Thread Karen Shaeffer via Python-list
> On Feb 17, 2021, at 12:25 AM, Karen Shaeffer via Python-list > wrote: > > > >> On Feb 16, 2021, at 8:10 PM, Jason Friedman wrote: >> >>> >>> I set listen(2) and expect to see "error" when more clients than "the >>> ma

Re: What's the meaning the "backlog" in the socket.listen(backlog) is?

2021-02-17 Thread Karen Shaeffer via Python-list
> On Feb 16, 2021, at 8:10 PM, Jason Friedman wrote: > >> >> I set listen(2) and expect to see "error" when more clients than "the >> maximum number of queued connections" trying to connect the server. But, no >> error!! Even 4 clients can run normally without problem. >> >> Am I misunderstan

io.TextIOWrapper.readlines

2020-11-11 Thread Karen Shaeffer via Python-list
Hi folks, import io with io.open(filename, ‘r’) as fd: lines = fd.readlines(hint=1000) for line in lines: # do something I was just looking at the io module. io.open(‘file’, ‘r') returns an io.TextIOWrapper object, which has the io.TextIOWrapper.readlines(hint=-1/) method. >>>

Re: Live Write to File with Code That is Reading File and Writing to Serial Port

2020-10-28 Thread Karen Shaeffer via Python-list
> On Oct 28, 2020, at 5:49 AM, ktkelly_1 wrote: > > Currently have a code that takes in a .txt file and submits commands to the > serial. Then it reads the reply from the serial port and writes it to a > hardcoded .txt file. The problem is it doesn't save it live and so if I need > to stop th

Re: Debugging a memory leak

2020-10-22 Thread Karen Shaeffer via Python-list
> On Oct 22, 2020, at 5:51 PM, Pasha Stetsenko wrote: > > Dear Python gurus, > > I'm a maintainer of a python library "datatable" (can be installed from > PyPi), and i've been recently trying to debug a memory leak that occurs in > my library. > The program that exposes the leak is quite simp

Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-15 Thread Karen Shaeffer via Python-list
Hi Sam, I’ve been using abseil python API. https://abseil.io/docs/python/guides/flags https://abseil.io/docs/python/quickstart It’s a distributed command line system with features that appear to support you

Re: Threading plus multiprocessing plus cv2 error

2020-08-30 Thread Karen Shaeffer via Python-list
> On Aug 29, 2020, at 10:12 PM, Stephane Tougard via Python-list > wrote: > > On 2020-08-29, Dennis Lee Bieber wrote: >> Under Linux, multiprocessing creates processes using fork(). That means >> that, for some fraction of time, you have TWO processes sharing the same >> thread and all t

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-19 Thread Karen Shaeffer via Python-list
> On Aug 19, 2020, at 8:47 AM, Tim Daneliuk wrote: > > On 8/19/20 8:35 AM, Alexandre Brault wrote: >> I've not seen anyone objecting to the idea of removing the reference to >> Strunk and White in favour of the underlying message of "be understandable >> by others who may read your comments"

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-18 Thread Karen Shaeffer via Python-list
> On Aug 18, 2020, at 6:13 PM, Richard Damon wrote: > > On 8/18/20 7:34 PM, rmli...@riseup.net wrote: >> I would also caution against relying on the idea of human rights when >> defending against accusations of being political, since they too are >> political. Life is political. We continue to