Re: [newbie] trying socket as a replacement for nc

2013-12-11 Thread Conor Hughes
Jean Dubois  writes:

> I have an ethernet-rs232 adapter which allows me to connect to a
> measurement instrument by means of netcat on a linux system.
> e.g. entering nc 10.128.59.63 7000
> allows me to enter e.g.
> *IDN?
> after which I get an identification string of the measurement
> instrument back.
> I thought I could accomplish the same using the python module "socket"
> and tried out the sample program below which doesn't work however:

In what way does it not work? Do you not get any data? Do you get the
wrong data? Does your program block at a point which you do not
understand?

Probably more to the point, are you sure you are sending exactly the
same data as you did with netcat? netcat running with stdin a terminal
sends data line-by-line, and includes the newline in the data that it
sends. You didn't send a newline in your example.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Experiences/guidance on teaching Python as a first programming language

2013-12-09 Thread Conor Hughes
Terry Reedy  writes:

> A few years ago, MIT switched from Scheme (which I believe originated
> at MIT) to Python for its first course. There might faculty blogs
> discussing the reasons. In any case, the course is one of MIT's free
> online offerings.

Berkeley recently made the same transition. They had been mirroring the
MIT Scheme-based 6.001 quite closely; I believe the Python-based
replacement at Berkeley doesn't concern itself with tracking the new
6.001 at MIT. In any case, much (read: some) ink was spilled and
consternation felt about the transition, but all in all my impression
was that it went OK. IMHO, if you're going to switch from Scheme to
something else for first-time programmers, Python is quite nice, as it
reads exceptionally well and is very close to pseudocode in
appearance sometimes. Of course, given that I didn't learn on Python,
my opinions may be colored by prior experience.
-- 
https://mail.python.org/mailman/listinfo/python-list