vscode-code-runner icon indicating copy to clipboard operation
vscode-code-runner copied to clipboard

remove quote mark in $dir

Open Yensan opened this issue 8 years ago • 2 comments

When a python project is beyond simple, the import statement can be very complex, such as from py_c.c_api import sample . If PYTHONPATH is not set, there may cause ImportError. So, Pycharm put ${fileDir} and ${WorkSpaceRoot} in PYTHONPATH before run *.py file. For this simple file tree:

D:/proj/ --------foo/ -------------foo.py

I guess the command line what pycharm use is: "cd D:/pro/ && set PYTHONPATH=D:/pro/;D:/pro/foo/&& C:/Python27/python.exe D:/pro/foo/foo.py"

I use these manner to run a python project in code-runner

"code-runner.executorMap": "python": "cd $workspaceRoot &&set PYTHONPATH=$dir;$workspaceRoot&& C:/Python3632/python $fullFileName"

But, the variable $dir in code-runner is : "D:/pro/foo/" have a quote mark ", so it raise an ERROR. I must use some complex DOS shell snip to remove it.

"python": "cd $workspaceRoot &set p=$dir&&set PYTHONPATH=%p:"=%;$workspaceRoot&& C:/Python3632/python $fullFileName"

maybe remove all of quote mark in the $var string is a better design. Users can add quote mark " by themselves.

Yensan avatar Dec 07 '17 12:12 Yensan

agree, same issue

NathanIceSea avatar Mar 08 '18 07:03 NathanIceSea

Any news?

kylichist avatar Nov 05 '24 07:11 kylichist