How to use object based coding to create dialog box in wxpython add only close button

There is no close button noted at https://www.tutorialspoint.com/wxpython/wx_dialog_class.htm
Either that or you meant only that top right X? I can't tell from your post.

Given only what you wrote so far I am guessing you want no buttons at all. Try:
wx.MessageBox('Nothing to see here.', ' ',0)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.