Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS Code Flexible Configurations #42

Open
douglowe opened this issue Feb 18, 2024 · 0 comments
Open

VS Code Flexible Configurations #42

douglowe opened this issue Feb 18, 2024 · 0 comments

Comments

@douglowe
Copy link
Collaborator

While adapting the Run Configuration example for VS Code I came across this stackoverflow answer on optional inputs for run configurations: https://stackoverflow.com/questions/43704747/visual-studio-code-run-python-file-with-arguments

It links to VS Code Variables Reference: https://code.visualstudio.com/docs/editor/variables-reference

Following these I created the following configuration file:

{
    "version": "2.0.0",
    "configurations": [
        {
            "name": "Catchment-analysis: Any",
            "type": "python",
            "request": "launch",
            "args" : [ "${input:dataFile}" ],
            "module": "catchment-analysis",
            "console": "integratedTerminal",
            "justMyCode": True            
        }
    ]
    "inputs": [
        {
            "type": "promptString",
            "id": "dataFile",
            "description": "Chose input file",
            "default": "data/rain_data_2015-12.csv"
        }
    ]
}

This is much more flexible than the current configuration (and could be combined with the current configuration if we want to keep some easy to use configs still). Should we switch to this for our course, or will it be too complicated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant