Can someone translate a small .PY to Perl?
From: GMane Python (s_david_rose_at_hotmail.com)
Date: 12/27/04
- Next message: Andrew Gaffney: "Re: Can someone translate a small .PY to Perl?"
- Previous message: Jonathan Paton: "Re: Variable Value into MySQL DB"
- Next in thread: Andrew Gaffney: "Re: Can someone translate a small .PY to Perl?"
- Reply: Andrew Gaffney: "Re: Can someone translate a small .PY to Perl?"
- Maybe reply: Andrew Gaffney: "Re: Can someone translate a small .PY to Perl?"
- Maybe reply: Luke Bakken: "RE: Can someone translate a small .PY to Perl?"
- Reply: Dave Gray: "Re: Can someone translate a small .PY to Perl?"
- Reply: GMane Python: "Re: Can someone translate a small .PY to Perl?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: beginners@perl.org Date: Mon, 27 Dec 2004 14:48:30 -0500
Hello Everyone.
Whil e reading the Python Cookbook as a means of learning Python, I
came across the script by Nicola Larosa. Not knowing anything about PERL, I
was wondering if there were a translation in PERL so I could have my Netware
servers send heartbeats to the heartbeat server?
I am beginning to learn the Python language after a 10-year
programming 'vacation' from my last class in college. Looking at this, I
think it'll end up being a rather quick translation, but although I'm
searching for translations, I'd really like to be able to just get my
Netware server to send heartbeats and not take flack from my boss for
'having to learn PERL' just to get the server to send a beat packet, so
that's why I'm asking for someone's help who knows the syntax of the
language.
Thanks!
Dave
Title: PyHeartbeat - detecting inactive computers
Submitter: Nicola Larosa
# Filename: HeartbeatClient.py
"""Heartbeat client, sends out an UDP packet periodically"""
import socket, time
SERVER_IP = '127.0.0.1'; SERVER_PORT = 43278; BEAT_PERIOD = 5
print ('Sending heartbeat to IP %s , port %d\n'
'press Ctrl-C to stop\n') % (SERVER_IP, SERVER_PORT)
while True:
hbSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
hbSocket.sendto('PyHB', (SERVER_IP, SERVER_PORT))
if __debug__: print 'Time: %s' % time.ctime()
time.sleep(BEAT_PERIOD)
- Next message: Andrew Gaffney: "Re: Can someone translate a small .PY to Perl?"
- Previous message: Jonathan Paton: "Re: Variable Value into MySQL DB"
- Next in thread: Andrew Gaffney: "Re: Can someone translate a small .PY to Perl?"
- Reply: Andrew Gaffney: "Re: Can someone translate a small .PY to Perl?"
- Maybe reply: Andrew Gaffney: "Re: Can someone translate a small .PY to Perl?"
- Maybe reply: Luke Bakken: "RE: Can someone translate a small .PY to Perl?"
- Reply: Dave Gray: "Re: Can someone translate a small .PY to Perl?"
- Reply: GMane Python: "Re: Can someone translate a small .PY to Perl?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|