Re: async serial port in Python.

2017-12-18 Thread Les Cargill

Les Cargill wrote:


What I'd like to do is set up *some* sort of method in Python to
asynchronously use callbacks to receive characters from a serial port
or 20 serial ports.

If I have to hook an event loop or even spawn a thread - fine! but it
needs to allow for making things event-driven. For lack of a better
term, I'd like this to at least have "select()/epoll() semantics".

And then I'd like to extend that to TCP and UDP ports.

Is this even possible? I keep running into "not done yet"
stuff on this front, but I'm not very up on Python. It may
be ... what's the term ... ? ... un-Pythonic, and I would accept
that as an explanation.


And no, I do not have a pet distro or version of Python. Any is fine
with me.



The Brent Welch book for Tcl has a totally complete example of this
laid out in great detail. That's so 15-20 years ago - try to catch
up, guys :)




Update: Found this:

http://pyserial-asyncio.readthedocs.io/en/latest/index.html

Seems to work. It's still "experimental"?

--
Les Cargill



--
https://mail.python.org/mailman/listinfo/python-list


async serial port in Python.

2017-12-18 Thread Les Cargill


What I'd like to do is set up *some* sort of method in Python to
asynchronously use callbacks to receive characters from a serial port
or 20 serial ports.

If I have to hook an event loop or even spawn a thread - fine! but it
needs to allow for making things event-driven. For lack of a better
term, I'd like this to at least have "select()/epoll() semantics".

And then I'd like to extend that to TCP and UDP ports.

Is this even possible? I keep running into "not done yet"
stuff on this front, but I'm not very up on Python. It may
be ... what's the term ... ? ... un-Pythonic, and I would accept
that as an explanation.


And no, I do not have a pet distro or version of Python. Any is fine
with me.



The Brent Welch book for Tcl has a totally complete example of this
laid out in great detail. That's so 15-20 years ago - try to catch
up, guys :)



--
Les Cargill
--
https://mail.python.org/mailman/listinfo/python-list


Re: [OT] Python and Excel

2017-12-18 Thread Les Cargill

oliver wrote:

That would be amazing. I still have nightmares of when I had to create this
big options analysis VBA program in Excel 2007.




Odd - I haven't found VBA itself to be all that horrible. Yeah, it's got 
some serious weaknesses but it jut hasn't bit me badly, yet. Then again,

it's not something I do a lot of.



On Mon, Dec 18, 2017, 14:21 MRAB, <pyt...@mrabarnett.plus.com> wrote:


Those who use Excel might find this interesting:

Microsoft Considers Adding Python as an Official Scripting Language to
Excel

https://www.bleepingcomputer.com/news/microsoft/microsoft-considers-adding-python-as-an-official-scripting-language-to-excel/
--
https://mail.python.org/mailman/listinfo/python-list



--
Les Cargill
--
https://mail.python.org/mailman/listinfo/python-list


What is a mechanism equivalent to "trace variable w ..." in Tcl for Python?

2016-09-30 Thread Les Cargill


A really interesting design approach in Tcl is to install a callback
when a variable is written to. This affords highly event-driven 
programming.


Example ( sorry; it's Tcl  ) :


namespace eval events {
set preRPM -1
proc handleRPM { args } {
# do stuff to handle an RPM change here
variable ::motor::RPM
variable preRPM
puts "RPM changed from $preRPM to $RPM
set preRPM $RPM
}
}

...

trace variable ::motor::RPM w ::events::handleRPM

...

set ::motor::RPM 33.33

What is an equivalent mechanism in Python?

Thanks in advance.

--
Les Cargill
--
https://mail.python.org/mailman/listinfo/python-list


Re: Is Microsoft Windows secretly downloading childporn to your computer ?!

2015-12-02 Thread Les Cargill

Juha Nieminen wrote:

In comp.lang.c++ Steve Hayes <hayes...@telkomsa.net> wrote:

You download things FROM a computer, you upload them TO a computer.


It's a matter of perspective. If a hacker breaks into your computer and
starts a download from somewhere else into your computer, isn't the hacker
"downloading" things to your computer?

--- news://freenews.netfront.net/ - complaints: n...@netfront.net ---



Down is towards an end node; up is towards the backbone. Servers
live closer to the backbone. Usually. Or rather did when the
nomenclature was forged.

--
Les Cargill
--
https://mail.python.org/mailman/listinfo/python-list