I'm trying to execute a Python script stored in the 'private' folder of a web2py application. My code, in the index() function of the default.py controller
import os
def index():
fp = os.path.join(request.folder, 'private', 'runscrape.py')
did_scrape = True if os.system('python ' + fp) else False
This code should execute every time the index is loaded. while did_scrape is returning True, the script is certainly not executing. did_scrape returns true whether I use the fp variable above or hardcode the path directly. Am I missing something basic about executing scripts in web2py?