0

When running my programs in VS Code terminal, the input and output are printed in the same terminal window.

But I want the input and output to be clearly separated, like in online compilers.

Eg:

enter image description here (from OneCompiler)

Especially when solving CP problems with multiple test cases, I lose track of outputs.

1 Answer 1

0

Here's a task to view input and output, similar to online coding platforms:

{
    "label": "Run Python with i/o",
    "type": "shell",
    "command": "cls; echo Input:; python a.py > temp.txt; echo `n; echo Output:; type temp.txt; Remove-Item temp.txt",
    "options": {
        "shell": {
            "executable": "powershell.exe"
        }
    },
    "presentation": {
        "showReuseMessage": false
    }
}

Result:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.