I'm used to ending the python interactive interpreter using Ctrl-d using Linux and OS X. On windows though, you have to use Ctrl-z and then enter. Is there any way to use Ctrl-d?
You can change the key set that Idle should be using.
Under Options->"Configure IDLE..." go to the "Keys" tab.
On the right you can select the "IDLE Classic Unix" key set.
You can't use CTRL-D on windows.
CTRL-Z is a windows-specific control char that prints EOF. On *nix, it is typically CTRL+D. That's the reason for the difference.
You can, however, train yourself to use exit()
, which is cross-platform.
Ctrl-d works to exit from IPython
(installed by python(x,y) package).
- OS: WinXP
- Python version: 2.5.4
Edit: I've been informed in the comments by the OP, Jason Baker, that Ctrl-d functionality on Windows OSes is made possible by the PyReadline package: "The pyreadline package is a python implementation of GNU readline functionality it is based on the ctypes based UNC readline package by Gary Bishop. It is not complete. It has been tested for use with windows 2000 and windows xp."
Since you're accustomed to *nix you may like that IPython also offers *nix-like shell functionality without using something like Cygwin...
- Proper bash-like tab completion.
- Use of / instead of \, everywhere
- Persistent %bookmark's
- %macro
- %store. Especially when used with macros and aliases.
- cd -. (easily jump around directory history). Directory history persists across sessions.
- %env (see cookbook)
- Shadow history - %hist and %rep (see cookbook)
- %mglob
- Expansion of $python_variables in system commands
- var = !ls -la (capture command output to handy string lists)
Run Cygwin Python if windowisms are bothering you... Unless what you are doing depends on pywin32 that is.