VPython - Can't reload browser or access from another browser, anyway to set a static port?

28 Views Asked by At

Kind of a multi-part issue so I apologize, firstly really simple example code, I want to use when rectifying this problem.

#Simple Example Code

from vpython import *

scene = canvas(width=1900, height=930, background=color.white, align='left')

test_box = box(canvas=scene,size=vector(5,5,5),color=vector(1,0.5,0.5))

Which works as expected and just displays a box. Onto the issues:

  1. Anytime I close the tab, the program dies even if the original connection is open - is there any way to stop this from occurring. I would like there to be a persistent server which can be connected and disconnected from at the users leisure.

  2. Anytime I have the program open in the browser, if I attempt to create another tab, open it in a different browser or refresh the page, I either get a my blank canvas or I get 'This site can't be reached. ERR_CONNECTION_REFUSED". Is there anyway to rectify this?

  3. Each time the program is executed a new port is assigned to the server - is there anyway to make this static?

I do need to add I haven't really played around with Web Socket or HTTP servers, I am a moderate Python user, not an expert but I have used it for a few years, if anyone can provide solutions code and general explanations are always appreciated.

I have attempted to find any information I can on any of the topics above but couldn't see anything on the docs or mentioned anywhere else.

My end goal is to have the a program reading data from a SQL database, constantly updating and have users be able to open and close the view at their leisure. I was planning to do this either with a centralized server all users to can connect to, though if that is not possible I can also have the program running on each client machine.

Any help anyone can provide is very much appreciated.

Thanks!

0

There are 0 best solutions below