我开始学习Python编程,我想运行我的代码,然后使用Python Interpreter中的"-i"选项使用它。但是,当我在我的launch.json文件中定义"args":["-i"]时,-i变成了我的程序的参数。
有没有办法将"-i"作为参数传递给Visual Studio Code中的Python解释器?
例如:
# test.py
dict = [{'name': 'AA', 'price': 32.2, 'shares': 100},
{'name': 'IBM', 'price': 91.1, 'shares': 50},
{'name': 'CAT', 'price': 83.44, 'shares': 150}]
跑
>python.exe -i test.py
>>>dict = [{'name': 'AA', 'price': 32.2, 'shares': 100},
{'name': 'IBM', 'price': 91.1, 'shares': 50},
{'name': 'CAT', 'price': 83.44, 'shares': 150}]
>>>
我不知道Python是否支持它,但请尝试使用runtimeArgs
而不是Args
。