Python 3 scaffolding for solving Kattis problems.
- Install VS Code
- Install VS Code Extensions:
- Clone this repo
- Install python packages from requirements.txt
- Log in to Open Kattis
- Download your personal configuration file to your home path.
From Scripts directory, run
.\init.ps1 [POBLEM_NAME]
This should create a Python directory next to where you cloned the scaffolding repo, download sample test files for your problem and open VS Code instance ready for you to start working on your solution.
Solutions should go in Solution.py file.
For unit tests to work all output needs to be written to out
def solve(self, in_file_stream, out=sys.stdout):
out.write('expected output')
Be sure to uncomment this line:
Solution().solve(sys.stdin, sys.stdout)
Run submit.bat.
Scaffolding is set to work with Visual Studio Code, but if you prefer to use PyCharm you can by commenting line 32 and uncommenting line 31 in projectSetup.ps1.
31. #Start-Process Pycharm $workingDir.ToString()
32. Start-Process code $workingDir.ToString() -NoNewWindow