Parent object to empty object without selecting them manually

Add a cube at the origin.


Create an empty object.


#parent of a is b

I want parent them for using controller.
when i run this script create an cube with empty object and empty object parent of cube or any object that i was add in script …