Sep-16-2021, 08:14 PM
First, I am new to both PyCharm and the tornado web server.
I am trying to setup a configuration to run the tornado web server with PyCharm and a remote raspberry Pi. The Pi home directory is connected using SFTP as drive Z. So in Pycharm, the path to my wind sketch is "Z:\home\pi\wind\wind.py" This configuration seems to work but there is a huge problem that I haven't been able to resolve.
So far I have only been able to get it to work by using SSH into the pi and in that sketch directory (wind) executing: "python wind.py&"
That gets the server running successfully on the pi. But if I change the sketch so Hello World becomes Goodbye World and run it PyCharm tells me it is already running and asks if I want to close it and restart. I say yes, but subsequent connections still show "Hello World".
In order to fix that, I kill wind, and then type python wind.py& again. Having to do that every time I update the code is not feasible.
What do I need to do to make it easier to stop wind on the pi and restart it automatically with the changed sketch.
The tornado server is setup with the example Hello World sketch which I named wind.py
I am trying to setup a configuration to run the tornado web server with PyCharm and a remote raspberry Pi. The Pi home directory is connected using SFTP as drive Z. So in Pycharm, the path to my wind sketch is "Z:\home\pi\wind\wind.py" This configuration seems to work but there is a huge problem that I haven't been able to resolve.
So far I have only been able to get it to work by using SSH into the pi and in that sketch directory (wind) executing: "python wind.py&"
That gets the server running successfully on the pi. But if I change the sketch so Hello World becomes Goodbye World and run it PyCharm tells me it is already running and asks if I want to close it and restart. I say yes, but subsequent connections still show "Hello World".
In order to fix that, I kill wind, and then type python wind.py& again. Having to do that every time I update the code is not feasible.
What do I need to do to make it easier to stop wind on the pi and restart it automatically with the changed sketch.
The tornado server is setup with the example Hello World sketch which I named wind.py
import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello, World") def make_app(): return tornado.web.Application([ (r"/", MainHandler), ]) if __name__ == "__main__": app = make_app() app.listen(8888) tornado.ioloop.IOLoop.current().start()Current configuration:
- Windows 10
SFTF 2.0.7877
PyCharm Community 2021.2.2