Hi Everyone, I’m getting an NameError when trying to run my inputs to check outputs for a Python file. Here is the autograding.json file that was set through Github Classroom:
"run": "python main.py",
Here is the workflow action of the autograding:
This is happening for all my student’s submissions. Any help is appreciated!
I’ve run into the same issue testing a a sample assignment with a very simple 2 line “Hello World” program. Any solution to the issue is appreciated.
Hi, I’m not sure what the problem is here but I wonder if it has something to do with the line endings. Can you try removing the
\r and use only
\n? I’ll give this a shot as well. If that is indeed the problem it is likely something we could account for.
The code that @Mr-Farid is showing is generated by GitHub Classroom in the autograding.json file. I had a similar thing on my code.
My Python test code was:
variable = input()
For the IO test I had entered in the fields:
Output: Hello Student
Edit: @jeffrafter I will setup a GitHub Classroom assignment with this and can PM the assignment to you (after the outage is over). It’s either an issue or user error (which may need enhancements in the documentation).
It looks like we both had python main.py as our Run Command. For me this is the command I use for Repl.it and other setups as the shell command. Once I finally noticed that, I figured out my issue, so maybe this info will help you or others in the future for Input / Output test setup in Python.
After digging around the documentation I found some info on the Ubuntu machines used in the Auto Grading have both Python 2 and 3 installed. This means if you are trying to setup IO tests the run command is different based on the version of python.
- Python 3 programs should use python3 filename.py
- Python 2 programs should use python filename.py
I have not tested the Python 2 Run Command but I did finally get my simple Python 3 assignment to pass the Input/Output Tests.
I don’t know if this solves the OP issue, but it does for me.