This script doesn't work anymore because of recent security upgrade from codeforces team. If you have any suggestions about Codeforces API, please read this marat.snowbear's blog post: /blog/entry/18185
Hi. Recently I decided to write such script, and it turned out to be very simple task.
First of all, install
requests library into your python 3.x (I didn't tested it under 2.x) distribution. Just like that:
pip install requests.
csrf_token variables. Look for
X-User in your browser cookies, and for
X-Csrf-Token in this page source. Update them every time you login.
Third, your submission language will be determined by file extension. By default,
.java is bound to codeforces Java 8,
.cpp to GNU C++ 0x 4, and
.py to Python 3.3. If you want to change this behavior, edit
If you prefer
cf_domain variable to
python cfsubmit.py C:\contests\123a.cpp python cfsubmit.py 123B.py
Solution filename have to be in exactly this format. Case doesn't matter.