Forums

Show the terminal output without showing the python code

Hi everyone, My questions maybe of very basic stuff :) Using Pythonanywhere resources, is it possible for me to show the students the terminal output without showing the python code? The purpose is to show the students the required output and they are to write the code to get the similar output.

Sure. Just put the code in a file and then run the file in a console and that will not show the code.

Thank you for your reply, Glenn. Yes, I will use this method during class. Another consideration: If I want to assign the work as an after class work, is there a way for the file to be run without my presence? Meaning, the student runs the file and is not able to view the content of the file.

No, if the student can run the file, they can also view its contents.

Is it possible to be done through a web application instead? That the student can only see the output, while the code resides in the server not accessible to the student.

You could do it. Something like https://blog.pythonanywhere.com/169/ ?

Thank you very much for the link. It is a very good source for learning :)

Glad to hear that!