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

Use vscode to debug tango #571

Open
SimLif opened this issue May 24, 2023 · 0 comments
Open

Use vscode to debug tango #571

SimLif opened this issue May 24, 2023 · 0 comments

Comments

@SimLif
Copy link

SimLif commented May 24, 2023

  • File tree
.
├── components.py
├── config.jsonnet
├── debug.py
  • The agent file called debug.py.
import sys
import runpy
import os

base_path = os.path.dirname(__file__)
os.chdir(base_path)

args = 'python -m tango run config.jsonnet -i components -w ../workspace'


args = args.split()
if args[0] == 'python':
    """pop up the first in the args"""
    args.pop(0)

if args[0] == '-m':
    """pop up the first in the args"""
    args.pop(0)
    fun = runpy.run_module
else:
    fun = runpy.run_path

sys.argv.extend(args[1:])

fun(args[0], run_name='__main__')
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