I am building my website which contains a python(.py) file, html, css and JS file. I want to know that how can I run my python script in siteground from my hosting account so that it can scrape data from a site and output a JSON file to Javascript file which can display it on the webpage.
I would use cron jobs to run jobs in the foreground
Related
I created a website using HTML and CSS and now, I need to crawl through it to download the images. If the link for locally hosted website is like:
http://localhost/Webpage.html Is it possible?
Yes, why not ? As long as your program is running on a machine which has access to this address.
I have few scripts written and trying to map those scripts with web page so that any user want to run a script just need to click the button on the web page and script will run at background, output will show on the web screen...
I have no idea how to proceed on this. Can someone help me ??
For you to accomplish this you will need to write some backend code that initiates your script from your webserver. This is because your browser can only run JavaScript. Python would have to run on the webserver.
There are many Python frameworks that can make this task easier such as Django, Bottle and Flask.
I have a scraping script made with Python (beautiful Soup) that scraps data from few websites and saves the data in CSV files.
I need to run this script every day at a certain times.
I am currently running it locally with Schedule Task.
I was wondering if it is possible to run such scripts on a third party hosting server and what kind of characterstic I should look into this web server for it to work.
I would like to avoid the necessity to automatically switch on my pc every day and instead to let everything happen automatically on-line
I am aware of Django and that you can make dynamic HTML pages with it but mime is a different thing and I can not find information regarding it.
I have a standalone python script that I currently run from the command line, that I would like to use from a static webpage. I've currently deployed it to heroku, and can run it from console in a dyno, but that's as far as I've gotten.
My script takes .txt files as input, and generates a .csv file as output. I would like to use the tag to request the input file from the user on a form page, pass that file to the python script and execute the script, then make the output file available for user download.
I realize this is a broad question, so I'm not really asking for a step by step solution, but rather an overview of how this needs to be handled, and maybe some links to appropriate docs/tutorials. I've been searching google for hours, but most of the results are framework based webapp tutorials, which is not what I need at this time.
Cheers
I am trying out Python on Bluemix. To do this I decided to move an example from a book that worked fine on my Windows laptop. I created the Bluemix example app, then replaced the index.html with the html file from the sample and built my directory tree beneath the static directory. The server starts up fine and displays the intro html file as expected, but when I click on a link that should build my html page it displays the page as source code instead of executing it. On Windows this works perfectly. My call to the page looks like this:
My data.
I have heard that on Linux environments you sometimes need to point out the python executable, but what is the right location of that in a Bluemix environment? Another question would be if the .py file is set to executable, but I don't know how you set such a thing in Bluemix.
All help is appreciated.
You can't directly link to a Python file in a Python webapp. You should use something like Flask to serve your application. Flask can do routing for you.
Additionally, in Bluemix and other Platform as a Services' there is only a single binary entry point to your app. You can't have multiple binary entry points.
See this example app on how to deploy a Flask app.
Additionally, you can click the button below to directly deploy the example app to Bluemix.