Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to embed javascript in python?

    Hi All,

    I have a python script on server that automates a certain procedure. It is working fine on the server machine. But for accessing it I need to have a javascript for that.
    I have a python script named test.py
    Code:
    class autoTest():
                 
     def auto_ftp_download
    {
    }
    It automates a particular application when run through command line.

    I have an apache server setup on window XP. I want to have a python code (with embedded javascript on server) to launch this code on client machine once remotely accessed. Clicking on this script on server (test.py) shall start the automated procedure. I used subprocess.Popen but it wont work if remotely accessed. How can I use javascript to launch it?

    I tried opening notepad.exe using a javascript along with ActiveX object. So on server there was a script named runnotepad.py. Clicking on it reads another file(open("htdocs/test/Upload/wsgi_app/notepad.html", "rb").read()) in the same directory named as notepad.html (with javascript embedded). It worked fine. But I do not know how to make it available to a client to launch that python script (that automates the procedure) from the server??

    Regards,

    Ejaz Shah
    Last edited by ejazshah; 10-14-2009 at 02:11 AM. Reason: More detail added of what exactly I am trying to do and what have I already tried.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •