Creating and Destroying Windows on the fly?

So I am trying to design a program that can open and close panda3d windows on the fly, where each window has its own properties and rendernode. This is my current solution:

base = ShowBase()

class my_exp():

	#first window gets cam 0, because base window is closed
	camCounter = -1

	def __init__(self, windowname, x=None, y=None):
		#create window and render node for the experiment
		self.mwindow = base.openWindow()
		self.mRender = NodePath('mRender')

		#set window name, size if given
		self.mwp = WindowProperties()
		if (x and y):
			self.mwp.setSize(x, y)

		#make camera accessible
		my_exp.camCounter += 1
		self.camNumber = my_exp.camCounter
	def addActor(self, actorPath, x, y, z, scale):
		tempActor = Actor.Actor(actorPath)
		tempActor.setPos(x, y, z)
		tempActor.setScale(scale, scale, scale)

        #this function definitely isn't right...
	def expClose(self):

x = my_exp("experiment x")
x.addActor("models/panda-model", 0, 0, 0, 0.003)

y = my_exp("experiment y", 100, 100)
y.addActor("models/panda-model", 0.01, 0.01, 0.01, 0.001)

However, calling here just creates both windows. How could I, for example, create window x, wait 5 seconds, close window x and create window y? I feel like I’m using Showbase wrong, and maybe I shouldn’t even be using it??