8000 how to modify IPython Qt Console.exe work directory · Issue #583 · winpython/winpython · GitHub
[go: up one dir, main page]

Skip to content

how to modify IPython Qt Console.exe work directory #583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hbhuyt opened this issue Dec 26, 2017 · 7 comments
Closed

how to modify IPython Qt Console.exe work directory #583

hbhuyt opened this issue Dec 26, 2017 · 7 comments

Comments

@hbhuyt
Copy link
hbhuyt commented Dec 26, 2017

When I open an Jupyter Qt Console ("C:\WinPython3\IPython Qt Console.exe"), work directory defaults to C:\WinPython3\settings.
How can I change this so to another location(e.g "C:\Projects\Py3")?

@stonebig
Copy link
Contributor

in recent winpython, you can do this:

  • go to C:\WinPython3\scripts\
  • modify qtconsole.bat as follow:
@echo off
call "%~dp0env_for_icons.bat"
rem before: cd/D "%WINPYWORKDIR%"
rem after:
cd/D C:\Projects\Py3
"%WINPYDIR%\scripts\jupyter-qtconsole.exe" %*

or directly change the variable WINPYWORKDIR in C:\WinPython3\scripts\settings\winpython.ini:

[debug]
state = disabled
[environment]
#HOME = %HOMEDRIVE%%HOMEPATH%\Documents\WinPython%WINPYVER%
#JUPYTER_DATA_DIR = %HOME%
#WINPYWORKDIR = %HOMEDRIVE%%HOMEPATH%\Documents\WinPython%WINPYVER%\Notebooks
WINPYWORKDIR = C:\Projects\Py3

@hbhuyt
Copy link
Author
hbhuyt commented Dec 27, 2017

I try the two methods, but nothing changed. I use WinPython3.5.4 64bits, in Windows10.

Jupyter QtConsole 4.3.0
Python 3.5.4 (v3.5.4:3f56838, Aug 8 2017, 02:17:05) [MSC v.1900 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: cd
C:\WinPython364\settings

@stonebig
Copy link
Contributor

if you do "!dir" instead of cd, it works. there is something special in the meaning of "cd" in QtConsole?

@stonebig
Copy link
Contributor

"cd ." behaves normally, "cd" doesn't.

@hbhuyt
Copy link
Author
hbhuyt commented Dec 28, 2017

"cd ." work fine. thanks again.
but how can I do when I run Jupyter QtConsole, type "cd", and get "C:\Projects\Py3".

@stonebig
Copy link
Contributor
stonebig commented Dec 28, 2017

well, it's ipython "magic" translation that is operating there:

I suppose somewhere in there, "cd" is transformed into "!cd %home%"

@hbhuyt
Copy link
Author
hbhuyt commented Dec 28, 2017

Thanks a lot for the detailed explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0