Блог пользователя LZDQ

Автор LZDQ, 12 месяцев назад, По-английски

This is a new CLI tool succeeding xalanq/cf-tool. It is designed for average (neo)vim enjoyers by saving you several seconds wasted on the browser.

project link

Why another CLI tool?

Codeforces added bot detection recently, and AFAIK all the existing CLI tools are blocked. ref1 ref2

Features

  • Parse sample testcases.
  • Test your solution with parsed testcases.
  • Submit code.
  • Generate code from templates.
  • Start a contest (parse sample testcases for all problems and optionally gen template).

Platform and requirements

Linux, Mac and Windows. python>=3.10

Installation

pip install pyforces-cli

(recommend using a virtual environment managed by conda)

Usage

  • pyforces config to login and configure your tool. Please follow the video tutorial on github to login.
  • pyforces race 2092 to start the contest 2092.
  • pyforces test in the problem folder, like ~/pyforces/contest/2092/a, to test your solution against parsed sample testcases.
  • pyforces submit in the problem folder, to submit your solution.
  • pyforces parse in the problem folder to parse sample testcases.
  • pyforces gen in the problem folder to generate a file from template.

Vim config

Example neovim config (vim users need to replace term by !):

" test, and submit on success"
au FileType cpp nnoremap <buffer><F5> :w<CR>:term pyforces test -f % && pyforces submit -f %<CR>
" test"
au FileType cpp nnoremap <buffer><F6> :term pyforces test<CR>
" submit"
au FileType cpp nnoremap <buffer><F7> :w<CR>:term pyforces submit -f %<CR>

For more details like the login video tutorial, please see README in github. Leave a star if you find this tool helpful!

Полный текст и комментарии »

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится