<human>:  Find all files in directory with extension .txt
<bot>: Here is some code to find all files in directory "/mydir" with extension ".txt"

os.chdir('/mydir')
for file in glob.glob('*.txt'):
  pass

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.