Running python from ax25d?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Hi all,
  I'm having some problems getting Python to work when called from
ax25d.  Specifically, stdin does not seem to be passed correctly to the
script.

Example:

#!/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

When I call this from the command-line, or indeed from xinetd it behaves
as expected - it starts, prints "Hello", then prints "you typed
<whatever you typed>" when you press return.  If you type "stop", it
stops.

>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.

Any thoughts?

Gordon MM0YEQ


--
To unsubscribe from this list: send the line "unsubscribe linux-hams" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux Newbie]     [Kernel Newbies]     [Memory]     [Git]     [Security]     [Netfilter]     [Linux Admin]     [Bugtraq]     [Photo]     [Yosemite Photos]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [ARM Linux Kernel]     [Linux Networking]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linux Resources]

Add to Google Powered by Linux