Python - glob () - How to grep same files with different extension files

Hi
I Have a directory and i have some files below

abc.txt
abc.gif
gtee.txt
ghod.pid
umni.log
unmi.tar

How can use glob function to grep abc files , i have created a variable "text" and i assigned value as "abc", please suggest me how can we use glob.glob( ) to get the output as below

abc.txt
abc.gif

i have written like below

text = abc
same_name_files = glob.glob (  ) //here i got struc//

suggest me how can i get it?

First: use code tags por your sample code.

This is the correct way for your needs:

import glob
text = 'abc*'
same_name_files = glob.glob(text)

But the problem is

i assigned value from the command like below

text = socket.gethostname()

then i want to grep.