Article Summary: checkio-client allows you to solve checkio problems even if you're not in a browser
checkio is a Python and Typescript learning service (or rather a coding game?). The characteristic point is that questions that emphasize practicality are asked. For example, instead of "the problem of detecting a specific character string using a regular expression", "the problem of selecting emails that are difficult to handle" Questions will be given in the form of. Unlike general teaching materials that let you learn one knowledge per question, the difficulty level is generally high because one basic problem requires various knowledge (sometimes even the lowest difficulty level Elementary cannot be solved. (Dent) definitely contributes to improving the quality and motivation of learning. It's great to be able to share your answers with others.
Although it is a convenient service, it has one problem. ** The answer screen is messed up and hard to use. ** ** I type the script into an editor on the Web, but since the command completion function is not provided, I often forget to close the typo and parentheses, and code that does not follow pep8 frequently. Debugging work is also difficult. It's bad that I usually rely on the completion function of vscode, but I don't want to devote my thinking resources to correcting such mistakes one by one. What to do with the result ** I wrote a script in vscode, debugged it, and if it worked, I copied it to the answer screen of the browser **.
If you have such a useless process, please send the script file and answer it ... ↓ You can send py files with API!
I learned the fact for the first time after using checkio for 2 years, so I will introduce it here.
pip3 install checkio_client
checkio config
Which domain you want to use by default? (code required)
[py] - https://py.checkio.org
[js] - https://js.checkio.org
[epy] - https://empireofcode.com
[ejs] - https://empireofcode.com
by default:py
Code for domain[py]:
Since python is used, enter as it is
What is your KEY for https://py.checkio.org ?
You can find one on https://py.checkio.org/profile/edit/
KEY:
Enter API key
Choose folder for your solutions [/home/user/py_checkio_solutions]:
Enter the directory where you want to save the file (default is ok)
checkio sync ~/py_checkio_solutions
Unzipped files are synced to the specified directory
From the second time onwards
checkio sync
You can just sync.
Write the answer to the synchronized py file. Since the question text is also described in the file, there is no need to open the question text in the browser.
If the assert statement passes, send the answer and test
When solving Zigzag Array
zigzag_array.py --check
Start checking...
*** Basics ***
->[3, 5]
<-[[1, 2, 3, 4, 5], [10, 9, 8, 7, 6], [11, 12, 13, 14, 15]]
->[5, 1]
<-[[1], [2], [3], [4], [5]]
->[3, 3, 5]
<-[[5, 6, 7], [10, 9, 8], [11, 12, 13]]
*** Extra ***
->[0, 3]
<-[]
->[3, 0]
<-[[], [], []]
->[0, 0]
<-[]
->[10, 1]
<-[[1], [2], [3], [4], [5], [6], [7], [8], [9], [10]]
->[4, 2]
<-[[1, 2], [4, 3], [5, 6], [8, 7]]
!!! Congratulation !!!
Link for checking solution of other users: https://py.checkio.org/mission/zigzag-array/publications/
Link for sharing solution: https://py.checkio.org/mission/zigzag-array/publications/add/
Pass the test when Congratulation is displayed.
Access the link for Link for sharing solution and submit your answer Posting is complete when a notification such as "Shared Clear solution ..." is displayed in Activity on the user page.
It is very convenient because you can complete the process of "selecting a problem-> solving-> testing" on vscode.
If you want to know more about checkio-client, please refer to the official blog. https://py.checkio.org/blog/new-tool-checkio-client/
There seems to be a browser extension, but I don't feel like using it much because the review score is low and the last update is terrible at the end of 2018 (as of June 2020). http://www.checkio.org/local-editor/chrome/extension/
Recommended Posts