Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NXOpen - python journal - How to stop?

Status
Not open for further replies.

NX-user

Industrial
Mar 22, 2018
1
0
0
DE
I try to run web-server (bottle web-framework) from journal. It works fine. But how can be stopped programmatically the bottle web server and how can be unload the journal?

Python:
#nx: threaded
import NXOpen
from bottle import route, run

theSession  = NXOpen.Session.GetSession()
theUI = NXOpen.UI.GetUI()
lw=theSession.ListingWindow
lw.Open()
lw.WriteLine('start')

@route('/hello')
def hello():
    lw.WriteLine('Hello!')
    return "Hello World!"

run(host='localhost', port=8080, debug=True)
 
Status
Not open for further replies.
Back
Top