What is `runfile` command in IPython?

Viewed 949

When running a file using console in Pycharm, I see on top of the console that Pycharm had simply executed this command in the console:

runfile('C:/Users/Alex/code/proj1/asset_management.py', wdir='C:/Users/Alex/code')

However, I find runfile is strange and seems to be unique to Pycharm console. Any more information on this?

BTW, I find it more powerful than Vscode which rule files like this

 & C:/Users/Alex/.conda/envs/ve/python.exe c:/Users/Alex/code/proj1/asset_management.py

without specifying working directory causing relative import errors. So, I'd love to be able to have access to runfile in a different IDE other than Pycharm.

1 Answers

You can add this in the settings.json file: "python.terminal.executeInFileDir": true,

Related