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

2020-10-28 Thread Terry Reedy
On 10/28/2020 8: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 the code for any reaso

Re: Python extension module with callbacks into Python

2020-10-28 Thread Barry
> On 28 Oct 2020, at 15:22, Paul Grinberg wrote: > >  >> >> Try calling PyEval_InitThreads() to force the python threading to be all >> setup. > > Can you please clarify where/when I should call PyEval_InitThreads()? Is this > in the main python thread before any pthread callbacks are gen

Re: Python extension module with callbacks into Python

2020-10-28 Thread Paul Grinberg
> Try calling PyEval_InitThreads() to force the python threading to be all > setup. Can you please clarify where/when I should call PyEval_InitThreads()? Is this in the main python thread before any pthread callbacks are generated? If so, should this be done only once? -- https://mail.python.

Re: Python extension module with callbacks into Python

2020-10-28 Thread Barry Scott
> On 28 Oct 2020, at 13:25, Paul Grinberg wrote: > >>> I am running into unpredictable behavior with my Python extension module >>> that wraps around a C++ library that starts a new pthread and, after doing >>> some work, generates callbacks back into the caller. I've greatly >>> simplified

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: Symlinks already present

2020-10-28 Thread none
In article , Cameron Simpson wrote: > >Yeah, makes me ill. That's because these days "pwd" is usually a shell >builtin with funny semantics and a cache/sanity=check against $PWD >(which gets computed as you cd around, typically). And if has a -P >option and friends explicitly because of this hide

Re: Python extension module with callbacks into Python

2020-10-28 Thread Paul Grinberg
> > I am running into unpredictable behavior with my Python extension module > > that wraps around a C++ library that starts a new pthread and, after doing > > some work, generates callbacks back into the caller. I've greatly > > simplified this to a simplistic example which still demonstrates t

Re: Symlinks already present

2020-10-28 Thread none
In article , Grant Edwards wrote: >On 2020-09-01, Richard Damon wrote: > >> Remember, we are talking about a hypothetical OS that handles hardlinks >> to directories, and defines that .. will point to the parent used to >> come to it, NOT just having current *NIX allowing hardlinks to >> directo

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

2020-10-28 Thread ktkelly_1
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 the code for any reason, I can't gather current data and the te

Re: Python extension module with callbacks into Python

2020-10-28 Thread Barry Scott
> On 27 Oct 2020, at 19:21, Paul Grinberg wrote: > > As full disclosure, I posted this question on StackOverflow as well, but it > looks like questions with [Python] [Extension-Module] tags are not frequently > answered. The link to my question there is > https://stackoverflow.com/questions