Creating PySide2 UI without .ui / Qt Designer

I want to know if its possible to have a PySide2 code with no ui needed. How can I write the widgets into the window without the qtcreator file.

Check these links:
https://doc.qt.io/qtforpython/tutorials/basictutorial/widgets.html
https://doc.qt.io/qtforpython/tutorials/index.html

The beginner tutorial here also now has both PyQt5 & PySide2 code. I’m adding PySide2 code to the other tutorials as I update them.