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 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2012
    Location
    France
    Posts
    72
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Python on remote server

    Hello,
    I have made a-script which draws graphs of our various sales numbers using pyplot. It works very well on my local machine and I can load the images up to our website. I would like to further refine the system by making a HTML 5 standard webpage with form input which could run the-script on the remote server and display the image in a web page. What would be the best route to implement this? I have done some research around the web and found a number of possible routes, all of which are new to me and wondered if someone might lead me (a relative beginner) in the right direction.
    A talent for speaking differently, rather than for arguing well, is the chief instrument of cultural change. Richard Rorty

  2. #2
    New Coder
    Join Date
    Nov 2016
    Location
    South Africa, Cape Town
    Posts
    49
    Thanks
    1
    Thanked 1 Time in 1 Post
    Does this script already upload the images to the website locally? If so all you're needing to do is create a function in javascript to launch the .py script and the script will do the rest of the work. You will need to make sure the server hosting the website has a python interpreter available and also the version.

  3. #3
    New Coder
    Join Date
    Aug 2012
    Location
    France
    Posts
    72
    Thanks
    19
    Thanked 0 Times in 0 Posts
    Thanks for your input. Yes , I have it running on my local machine and when I run the script it saves the generated .png files to a folder which can be accessed by a local web server (XAMPP). Thanks for the pointer about using JavaScript to launch the file, I will hunt around for some code examples of this. The server does have python 3.4 and an interpreter and I have root access to everything. What I want to do is create a webpage where a small number of logged in users can enter different sales periods and product IDs and see comparisons of this and last year's sales.
    A talent for speaking differently, rather than for arguing well, is the chief instrument of cultural change. Richard Rorty

  4. #4
    New Coder
    Join Date
    Nov 2016
    Location
    South Africa, Cape Town
    Posts
    49
    Thanks
    1
    Thanked 1 Time in 1 Post
    Good luck. From my point of view the hard work is already done. You could refer to this post for more information - Call Python function from Javascript code - Stack Overflow


 

Tags for this Thread

Posting Permissions

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