1

I have deployed my Flask python application on Heroku. The problem is that in one line of my python code I must open an HTML file (where some javascript gets executed).

Obviously, it locally works in my mac, but in Heroku it doesn't' seem to recognise the 'open' command, in fact I get:

/bin/sh: 1: open: not found

This is the python code in my script:

p = Popen('open last.html', shell=True)

I need the file to be opened to get the javascript executed. Is there a way to solve this and get the HTML file to be opened?

0

While some Linux systems may have an open command (mine does) that has different semantics, open in the sense you're using it is Mac OS X-specific.

This Stack Overflow question covers a number of alternatives to open on a Linux-based environment, with the clearest analogue being xdg-open. You'll have to evaluate what the best option is in your Heroku dyno environment based on the tools you've got available there, but it's very unlikely to be called open.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.