Skip to content

Commit

Permalink
shell script to run and open browser
Browse files Browse the repository at this point in the history
  • Loading branch information
rayidghani committed Jan 29, 2019
1 parent 942245a commit cf731da
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions macrun.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# runs the web app on a random port between 5000-5999, and opens the local browser

from app import app
import random, threading, webbrowser

port = 5000 + random.randint(0, 999)
url = "http://127.0.0.1:{0}".format(port)

threading.Timer(1.25, lambda: webbrowser.open(url) ).start()

app.run(port=port, debug=False)

0 comments on commit cf731da

Please # to comment.