I'll pretend that I know next to nothing about excel.
In excel:
Activate the spreadsheet of interest. If it has graphs, pictures, equations, links, or other stuff you want to ignore and this fails then move only the interesting text like columns onto a new sheet and try again using that sheet.
Note: you could, as far as I know, have a customized spreadsheet for which none of this makes any sense what-so-ever. Indeed, you might have a little clickable box that exports as csv in one shot.
Click File (I think)
Click export in the menu that appears.
wiggle your way through the rest of the menus to reach export as comma separated value (.csv)
Then choose a file name, and know where that file went.
One of my hang ups with MicroSoft Windows is that I like to use the command line, and I like to know where my files are. In the giga-successful Microsoft model one does not need to know path names, they need to know "recent file" or "funny looking picture toward the upper left of my monitor". Python needs a path. Good luck finding this .csv file.
Anyway, why must you invoke python for the task? Here I'd use the "find" command on the DOS command line.
Actually, I wouldn't. I would have installed Cygwin/X onto my Microsoft system and I'd use grep or gawk.
Anyway, here's a python code. By your problem statement I really don't care if the username appears in a specific column.
Code:
'''
example use, this file is p.py in current directory:
$ cat a # display file a
c sea 1
b bee 2
$ python p.py # example misuse.
Use: python p.py username file
$ python p.py sea a # successful example.
yes
$ python p.py sxa a # username is not in the file.
no
$ python p.py sea 'no such file' # another sort of failure
Use: python p.py username file
$
'''
import sys, os
try:
word = sys.argv[1]
filename = sys.argv[2]
os.stat(filename)
except:
print('Use: python '+sys.argv[0]+' username file')
sys.exit(1)
with open(filename,'r') as inf:
print('no yes'.split()[word in inf.read()])