Geometry selecting to python console

Hello,
I have an object selected by mouse in object browser.
I want it to recognized by console. What python method to use to get the selected object in geometry to a python object in console?
I tried
obj = geompy.GetObject(‘entry’)

It doesnt give error but i cannot do operations on obj. For example if i do
geompy.addToStudy(obj, ‘obj’)
It fails to addin study
Also if i create a mesh over it by

smesh = smeshBuilder.New()
New_mesh= smesh.Mesh(obj,“obj”)
par_mesh = smesh.ParallelMesh(obj, name =“par_mesh”)
I get sigsegv error

What to do?

Thanks and Regards
Anirudh Nehra

Here you have how to select an object Give an argument to an script run from the python console of salome - #5 by franco.ota