kattis / kattis-cli Goto Github PK
View Code? Open in Web Editor NEWKattis online judge command line tool
License: MIT License
Kattis online judge command line tool
License: MIT License
Since apple has removed the system-provided Python 2 installation, the second line in the kattis
script gives the following error on newer macs:
/Users/user/kattis-cli/kattis: line 2: python: command not found
Setting an alias in your .zshrc
does not solve the problem since it is not processed by the script.
Easiest fix is probably to make it python3 only. With python2, the user needs to go to some effort to make it work. At least on Mac and Ubuntu 14.04 it doesn't work out of the box with python2.
Workarounds:
When submitting on scoring problems, the result given is simply Accepted and does not include the score.
This means you have to open the website to see the score of your submission.
It would be nice if the score was added so that instead of
Accepted (0.05 s)
the user would see
Accepted (25) (0.05 s)
when scoring 25 points out of say 100.
Running submit.py on Windows gives the following erorr:
Traceback (most recent call last):
File "submit.py", line 365, in
main()
File "submit.py", line 280, in main
cfg = get_config()
File "submit.py", line 75, in get_config
if not cfg.read([os.path.join(os.getenv('HOME'), '.kattisrc'),
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2288.0_x64__qbz5n2kfra8p0\lib\ntpath.py", line 76, in join
path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not NoneType
This is because os.getenv('HOME') returns noneType.
$ python3 SUBMIT.py 2048.py
Problem: 2048
Language: Python 3
Files: 2048.py
Mainclass: 2048
Submit (y/N)?
y
Mainclass name containing non valid characters.
I was able to successfully submit my solution through the web interface though.
So, if you don't have requests installed, you get something like this:
$ python3 submit.py hello.py
Traceback (most recent call last):
File "submit.py", line 9, in <module>
import requests
ImportError: No module named ‘requests'
PROBLEM:
Firstly, the function executes submissions_url = get_url(cfg, 'submissionsurl', 'submissions')
, which is an error as .kattisrc
contains submissionurl
, not submissionsurl
.
Secondly, the url is for accessing submissions is https://open.kattis.com/submissions/
, not https://open.kattis.com/submit/
.
FIX:
I added the line opensubmission: https://open.kattis.com/submissions
to the end of.kattisrc
and also changed submissions_url = get_url(cfg, 'submissionsurl', 'submissions')
on line 170 to submissions_url = get_url(cfg, 'opensubmission', 'submissions')
This would require the modification of the file at https://open.kattis.com/download/kattisrc
I am trying to use PostMan.exe to study and replicate the results from submit.py line 97
[requests.post(login_url, data=login_args, headers=_HEADERS)]
I am new to Postman and am not having any luck if any of you developers could instruct me in this it would be appreciated.
Kind Regards,
Mark
Hey!
I was trying to submit a JavaScript solution to the brokenswords problem and got an error.
attila@attila-desktop broken_swords % kattis brokenswords.js
Problem: brokenswords
Language: JavaScript
Files: brokenswords.js
Submit (y/N)?
y
Invalid language
attila@attila-desktop broken_swords %
The language is correctly detected as well as the problem, but after submission I got the 'Invalid language' error.
Explicitly setting the language to something else, for instance C, works as expected.
attila@attila-desktop [130] broken_swords % kattis -l c -p brokenswords brokenswords.js
Problem: brokenswords
Language: c
Files: brokenswords.js
Submit (y/N)?
y
Submission received. Submission ID: 7267240.
Open in browser (y/N)?
n
attila@attila-desktop broken_swords %
Submitting on the website provides two options for Java Script: Node.js and SpiderMonkey.
I suspect that that has something to do with the problem.
Is there a way to set Node.js explicitly when submitting a solution?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.