pythonshellpython-3.x

Open python shell in the current directory


I want to open a python shell in the current directory like cmd. My system is windows 10. How can I achieve that?

I would like to perform something like that:

Suppose that I open a directory on D disk, let's say the path is D:\PythonProjects. I open cmd in current directory, in cmd I type python to get a python shell, but the work directory of python didn't change.


Solution

  • Did you try something like this in command line?

    C:> D:
    D:> cd PythonProjects
    D:\PythonProjects> python
    [Something about Python interpreter]
    >>>