From: Tomi Manninen <oh2bns@sral.fi>
To: Gordon JC Pearce <gordonjcp@gjcp.net>
Cc: linux-hams@vger.kernel.org
Subject: Re: Running python from ax25d?
Date: Wed, 10 Nov 2010 09:34:05 +0200 [thread overview]
Message-ID: <4CDA4AED.8020100@sral.fi> (raw)
In-Reply-To: <1289341791.7453.6.camel@localhost.localdomain>
Gordon JC Pearce wrote:
> #!/usr/bin/python2 -u
> # saved as /home/gordonjcp/test.py
> # corresponding line in ax25d.conf is
> # default * * * * * * - gordonjcp /home/gordonjcp/test.py test.py
> import sys
> a=""
> print "Hello"
> while(a.strip()!="stop"):
> a = sys.stdin.readline()
> print "you typed " + a
End-of-line problems maybe? On packet radio CR is the de facto EOL
character. Python file objects readline() method probably seeks
for a LF...
Have you tried eg. sys.stdin.read(1) to see if you get what you
wrote back one character at a time?
>>From ax25d, it prints "Hello" but does not respond to any keyboard
> input. Furthermore, if I close down the connection from call(1) I get
> the following:
>
> Traceback (most recent call last):
> File "/home/gordonjcp/test.py", line 7, in <module>
> a = sys.stdin.readline()
> IOError: [Errno 107] Transport endpoint is not connected
>
> The IO error seems to suggest that there is no connection from stdin as
> handled by ax25d to Python. I'm not sure if this is because stdin goes
> away when the connection is closed, or because it was never there to
> begin with.
I'd say it's because the connection was closed. Although ENOTCONN is
a somewhat strange error here... hmm.
/Tomi
prev parent reply other threads:[~2010-11-10 7:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-09 22:29 Running python from ax25d? Gordon JC Pearce
2010-11-10 7:34 ` Tomi Manninen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CDA4AED.8020100@sral.fi \
--to=oh2bns@sral.fi \
--cc=gordonjcp@gjcp.net \
--cc=linux-hams@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox