hoangKnLai / vscode-ipython

VSCode Extension integrating Editor with IPython console.
MIT License
18 stars 5 forks source link

Feature request: run file in the file directory. #23

Closed chinabiue closed 1 year ago

chinabiue commented 1 year ago

Like in VScode default python interpreter. when I click run button , the terminal will auto 'cd' to the file directory, and then run the file, which we can have a setting in "Python.Terminal.Execute in File Dir". I can not figure out a way to do this when using vscode-ipython extension. I think there is a way to achieve this using "Ipython.Startup Commands", but I failed. is any one can achieve this or we need a new feature to run ipython in File Dir?

hoangKnLai commented 1 year ago

Hi, while I'm thinking about adding this as a new feature, here are some options you might want to try.

Side note, I'm familiar with the run in file dir feature but found it in the past to be a poor feature. Because changing directory of the terminal to run a file can sometime be a problem with the environment variables. Just out of curiosity, can you describe what the use case here for this feature? Thanks!

chinabiue commented 1 year ago

When writting a py file with reference to other file contents(txt/csv/excel...) which put together with py file. this situation can not success when cwd is your home directory. I have to switch to the file dir first then run it. :) Any way, thanks for your response. your suggestion is kind of solution for me. Thanks.