Where does win32 python command prompt history happen?
Duncan Booth
duncan at NOSPAMrcp.co.uk
Thu May 15 05:29:36 EDT 2003
"drs" <drs at ecp.cc> wrote in
news:NUwwa.14330$%_3.7230412 at newssrv26.news.prodigy.com:
> "Gary Bishop" <gb at cs.unc.edu> wrote in message
> news:3ec27298_2 at news.unc.edu...
>> When I run python in a command window (dos box) on WindowsXP, I get
>> simple command history. For example I can press the up-arrow key to
>> get previous commands typed to the prompt.
>
> in win9x days one had to enably doskey in the auotexec.bat file to get
> this. afaik, at least since win2k, this has been part of the command
> prompt. I doubt it is in the kernel, but it is part of windows.
>
[Please don't top-post, it makes it hard to maintain a properly trimmed
context in the thread, I've had to reformat the above]
It seems worth adding that the other DosKey functions also work. From
DOSKEY /?:
UP and DOWN ARROWS recall commands; ESC clears command line; F7 displays
command history; ALT+F7 clears command history; F8 searches command
history; F9 selects a command by number; ALT+F10 clears macro definitions.
You can even define macros from a DOS command prompt e.g.:
C:\>doskey /EXENAME=Python.exe p=import pprint;pprint.pprint($*)
C:\>python
Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> p sys.path
['',
'D:\\Python22\\lib\\site-packages\\Pythonwin',
'D:\\Python22\\lib\\site-packages\\win32',
'D:\\Python22\\lib\\site-packages\\win32\\lib',
'D:\\Python22\\lib\\site-packages',
'd:\\Python22\\DLLs',
'd:\\Python22\\lib',
'd:\\Python22\\lib\\lib-tk',
'd:\\Python22',
'd:\\Python22\\PIL112']
>>>
--
Duncan Booth duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
More information about the Python-list
mailing list