S-Python is an educational tool that introduces the concepts of static typing and compiling to young learners within the Python programming language.
def gcd(int a, int b)->int:
int t = a
while b != 0:
t = a
a = b
b = t % b
return a
print(gcd(1234342213, 334232))
Install Docker on whatever operating system, see Get Docker for more information.
For PLT2024 graders, you may load the docker image by:
docker load -i spython-docker.tar
or build the docker image may take a minute or two:
docker build -t spython .
for Linux/Mac users, run it to enter the container when the image is ready:
docker run -v $PWD:/plt2024 -it spython
for Windows users:
docker run -v %cd%:/plt2024 -it spython
You can get the latest S-Python from https://github.com/LeslieChn/spython.git
Install the compiler by running the following:
make
Compile the file by running the following:
./spython source.spy [-o output]
Or use the following to install the compiler, compile and run the test files in one shot:
make test
You can clean up the folder by running the following:
make clean