Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'configure': 0.04; 'output': 0.04; 'root': 0.04; 'subject:Python': 0.05; 'dynamically': 0.07; 'python': 0.09; 'directory)': 0.09; 'solution,': 0.09; 'subject:files': 0.09; 'url:github': 0.09; '2.7': 0.13; 'files.': 0.13; 'dec': 0.15; 'file,': 0.15; 'server,': 0.15; "(i'm": 0.16; '(within': 0.16; 'csv': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'index.html': 0.16; 'locally,': 0.16; 'script.)': 0.16; 'url:py': 0.16; 'wrote:': 0.17; 'instance': 0.17; 'instance,': 0.17; 'app': 0.19; 'trying': 0.21; 'work.': 0.23; "haven't": 0.23; "i've": 0.23; 'host': 0.24; 'script': 0.24; 'allows': 0.25; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message- id:@mail.gmail.com': 0.27; 'actual': 0.28; 'run': 0.28; 'hosting': 0.28; '(maybe': 0.29; 'publicly': 0.29; "i'm": 0.29; 'designated': 0.30; 'figure': 0.30; 'server.': 0.32; 'file': 0.32; 'running': 0.32; 'accessible': 0.33; 'to:addr:python-list': 0.33; 'tutorial': 0.33; 'another': 0.33; 'skip:d 20': 0.34; "can't": 0.34; 'received:google.com': 0.34; 'jason': 0.35; 'received:209.85.220': 0.35; 'remote': 0.35; 'received:209.85': 0.35; 'next': 0.35; 'but': 0.36; "didn't": 0.36; 'anything': 0.36; 'should': 0.36; 'possible': 0.37; 'drop': 0.37; 'received:209': 0.37; 'well.': 0.37; 'subject:: ': 0.38; 'store': 0.38; 'files': 0.38; 'things': 0.38; 'to:addr:python.org': 0.39; 'google': 0.39; 'header:Received:5': 0.40; 'end': 0.40; 'your': 0.60; 'address': 0.60; 'you.': 0.61; 'world': 0.63; 'more': 0.63; 'within': 0.64; 'night,': 0.65; 'home': 0.66; 'secure': 0.67; 'box,': 0.69; 'sounds': 0.71 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=7k7qaGfVo7qeL3f5k6mki0rBzoO+DNz8ocZkfnEOeSw=; b=KS3vDfoh/Q27hccfSl22RRYiAnwcFM5JypKx4k2YN00B0L9LuJCcG4A51JUa5LS0z+ jZNkyPBWCBBg1FJppjoIKiFAPgzYJ5GgWXKKK9g6mcbT0g60O4MrcHBD27NuZWemENVB RenRVxN/kNy0SXjhiBZjheD+EkeHX3e9gGJ6XA/3ZT5vkUjWoFBVEgUt8BC5YeSILCaC s76lmuDQ4MJC0vc8DjQovQquNlyKQ8qcXlZOLZF+FtnRG+Y/Dkyr5WaTrO2lTaTvEDW2 HTsTAd22c7wpWX7owrqUHPco+9+/M2uJVc9pGkYrG8g2eXYbIykFtqz03wU6t6gqTJbu ZwwA== MIME-Version: 1.0 In-Reply-To: References: Date: Sun, 9 Dec 2012 11:38:26 +1100 Subject: Re: Running a Python app on a remote server and displaying the output files From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 47 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1355013509 news.xs4all.nl 6881 [2001:888:2000:d::a6]:41181 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34511 On Sun, Dec 9, 2012 at 7:22 AM, Jason Hsu wrote: > I have a Python 2.7 script at https://github.com/jhsu802701/dopplervaluei= nvesting . When I run the screen.py script locally, the end result is a new= screen-output sub-directory (within the root directory) and a results.csv = file within it. > > What I'm trying to do is put this script on a remote server, run this scr= een.py script every night, and make the results.csv file publicly readable. Sounds like a cron job and a web server. > I've tried to do this on Google App Engine, but I can't get it to work. T= he Google App Engine tutorial revolves around trying to dynamically create = a web site, and I haven't been able to figure out how to make anything othe= r than an index.html file in the root directory work. HOW DO I MAKE OTHER F= ILES PUBLICLY READABLE? I don't know Google App Engine, but the normal way to do these things is to simply drop a file into your web server's designated root - for instance, /var/www/results.csv would be accessible as http://yourserver/results.csv - just put it next to index.html. But you may need to configure it, if it's set to a more secure default setup that allows only html files. > 1. How do I run my Python script in Google App Engine and make the output= results.csv file publicly available? > 2. If Google App Engine isn't the solution for me, should I use WebFactio= n? (I already tried Heroku, and it didn't work for me.) > 3. What are my other options? > > I'm willing to pay for a solution, but only if I get web hosting as well.= (I'm not willing to pay for MDDHosting for my dopplervalueinvesting.com we= b site AND another host for running my script.) Here's a possible solution for you. Make your screen.py web-accessible (maybe with a password or IP address check, if you don't want it public) as your means of regenerating the file, and create another one that returns it. You can then have a cron job on any other computer in the world - your own home box, for instance - that runs: wget http://yourserver/screen.py You can store the csv file as an actual file, or in a database, or whatever's convenient. You just need the other script to be able to find it. ChrisA