channel.py 350 B

1234567891011121314151617
  1. import os
  2. from pyfzf.pyfzf import FzfPrompt
  3. import sys
  4. fzf = FzfPrompt()
  5. global se
  6. with open('config/channels.txt') as f:
  7. se = f.read().splitlines()
  8. sl = fzf.prompt(se)
  9. ls = "".join(sl)
  10. ind = se.index(ls)
  11. with open('config/scripts.txt') as g:
  12. es = g.read().splitlines()
  13. script = es[int(ind)]
  14. os.system(f"python3 channels/{script}")