On Thu, 1 Apr 2004, Frank Barknecht wrote:
Mathieu Bouchard hat gesagt: // Mathieu Bouchard wrote:
If anyone's interested, I just wrote a Ruby wrapper for communication via netsend and ruby -rsocket -e'TCPSocket.open("localhost",4444){|s|s.print ARGV[0]}' it's shorter than the URL for the Perl wrapper.
Okay, attached is my quick hack Python PdSender-object/script. Either call it directly for a nice command line interface to with history (if readline is available) or use it in a Python script like: from pdsender import PdSender pd = PdSender( "localhost", 3000 ) pd.send("something was sent;") It could be much shorter, probably as short as the Ruby example, if I didn't go for a bit of comfort with readline support and a nicer prompt.
Interesting. I can see however that it loads some kind of pdsender.py ... I don't have that file on my machine. However, my version for Ruby does not require any special modules, as it directly uses the Ruby socket library. Plus you can use it in irb (a nice command line interface with history and readline), like:
s = TCPSocket.open "localhost",4444 s.puts "hello world ;" s.flush s.puts "0 1 1 2 3 5 8 13 ;" s.flush
and so on. (or use s.sync=true, for automatic s.flush's)
Btw where do I download pdsender.py from ?
Mathieu Bouchard http://artengine.ca/matju