Triggering a Python process
Chris Liechti
cliechti at gmx.net
Fri Jan 11 17:44:32 EST 2002
"DeepBleu" <DeepBleu at DeepBleu.org> wrote in
news:u3u7qegthndc3 at corp.supernews.com:
> The Python project I am working on so far does the following:
> 1. Allows users via a browser to upload a file to a Solaris 8 machine
> using Python CGI. The script inspects the file uploaded to determine
> if it is zipped or not. If zipped, it unzips it into its components.
> Then it performss some rules on the text in the file, Then it FTP's it
> into ANOTHER Solaris 8 machine. This is all in one script.
> 2. The files received on the second machine are then sent using a
> second Python script into an Oracle database processing facility.
>
> The second Python script is run every couple of hours to check for any
> files that were FTP'd.
why use FTP? if its only a python<->python conversation you could use pyro
http://pyro.sourceforge.net/ the you can simply call method on an object on
the second machine with the data.
or handcraft you own protocol over TCP and implment it in both python
scripts.
> So, this is my question:
> Are there any 'fancy' methods by which the second Python script on the
> second machine is automatically triggered when the file is FTP'd
> successfully from the first macine to the second machine?
- maybe your FTP server has some scripts that can be executed on
login/logout? then you could use signals.
- open a socket on second machine ant wait for a command
- you could even login to the remote machine (via telnetlib or better ssh
and os.popen) and execute such an update tool
> I ask out of curiousity and trying to see if it is possible to
> streamline the whole project to flow in one step across different
> macihines. By the way, this is my first project on a Unix.
> Any hints are welcome.
> DeepBleu
>
>
>
--
Chris <cliechti at gmx.net>
More information about the Python-list
mailing list